> ## Documentation Index
> Fetch the complete documentation index at: https://docs.noxpay.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Static Link

> POST /v2/naas/submerchants/static_link — create a permanent static payment link for a sub-merchant.

Creates a static payment link for a sub-merchant. The link resolves the sub-merchant's slug automatically and routes checkout through their account.

<Warning>
  This endpoint operates at the master merchant level. **Do not include `correlation_id` in the envelope** — pass it inside `payload` instead.
</Warning>

<Info>
  The sub-merchant must have completed KYB and have a portal account. `link_path` must be unique per sub-merchant and is permanent once created.
</Info>

## Payload fields

| Field            | Type          | Required | Description                                                                                               |
| ---------------- | ------------- | -------- | --------------------------------------------------------------------------------------------------------- |
| `correlation_id` | string (UUID) | Yes      | UUID returned by [Enroll Sub-merchant](/api-reference/naas/enroll).                                       |
| `link_path`      | string        | Yes      | URL path segment. Letters, numbers, `_` and `-` only. Max 32 characters. Must be unique per sub-merchant. |
| `currency_code`  | string        | Yes      | Currency code for this link (e.g. `USDT_POLYGON`, `BTC`).                                                 |
| `amount_fiat`    | number        | No       | Fixed BRL amount. Omit to allow the payer to enter the amount.                                            |
| `amount_crypto`  | number        | No       | Fixed crypto amount. Mutually exclusive with `amount_fiat`.                                               |
| `webhook`        | string        | No       | URL that receives a POST notification when the payment completes.                                         |
| `return_url`     | string        | No       | URL the payer is redirected to after checkout.                                                            |

## Response `201 Created`

```json theme={null}
{ "link": "https://checkout.noxpay.io/pay/acmepay/plano-basico" }
```

The `link` is constructed from the sub-merchant's alias (set via [Set Alias](/api-reference/naas/alias)). If no alias has been set, an auto-generated slug is used.

**`400`** — missing required fields; `link_path` format invalid; or `link_path` already exists for this sub-merchant.

**`404`** — `correlation_id` not found or does not belong to this master merchant.

**`422`** — sub-merchant has no portal account yet (KYB not completed).

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://checkout.noxpay.io/v2/naas/submerchants/static_link \
    -H "api-key: <key>" \
    -H "X-Signature: <signed-body-signature>" \
    -H "Content-Type: application/json" \
    -d '{
      "timestamp": "2026-05-27T14:30:00Z",
      "payload": {
        "correlation_id": "a1b2c3d4-e5f6-4789-abcd-000000000001",
        "link_path": "plano-basico",
        "currency_code": "USDT_POLYGON",
        "amount_fiat": 99.90,
        "webhook": "https://yourserver.com/payment-webhook",
        "return_url": "https://acme.com/obrigado"
      }
    }'
  ```

  ```python Python theme={null}
  import requests

  body, sig = sign_envelope({
      "correlation_id": "a1b2c3d4-e5f6-4789-abcd-000000000001",
      "link_path":      "plano-basico",
      "currency_code":  "USDT_POLYGON",
      "amount_fiat":    99.90,
      "webhook":        "https://yourserver.com/payment-webhook",
      "return_url":     "https://acme.com/obrigado",
  })
  response = requests.post(
      "https://checkout.noxpay.io/v2/naas/submerchants/static_link",
      headers={"api-key": "<key>", "X-Signature": sig, "Content-Type": "application/json"},
      data=body,
  )
  print(response.json())
  ```

  ```javascript Node.js theme={null}
  const { body, signature } = signEnvelope({
    correlation_id: "a1b2c3d4-e5f6-4789-abcd-000000000001",
    link_path:      "plano-basico",
    currency_code:  "USDT_POLYGON",
    amount_fiat:    99.90,
    webhook:        "https://yourserver.com/payment-webhook",
    return_url:     "https://acme.com/obrigado",
  });
  const response = await fetch("https://checkout.noxpay.io/v2/naas/submerchants/static_link", {
    method: "POST",
    headers: { "api-key": "<key>", "X-Signature": signature, "Content-Type": "application/json" },
    body,
  });
  const data = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  { "link": "https://checkout.noxpay.io/pay/acmepay/plano-basico" }
  ```

  ```json 400 theme={null}
  { "error": "link_path already exists for this sub-merchant" }
  ```

  ```json 422 theme={null}
  { "error": "sub-merchant has no portal account" }
  ```
</ResponseExample>
