> ## 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.

# Set Alias

> POST /v2/naas/submerchants/alias — set the URL slug used in static payment link URLs.

Sets the URL slug used to build static payment link URLs for a sub-merchant. The alias becomes the `{slug}` in `https://checkout.noxpay.io/pay/{slug}/{link_path}`.

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

The alias can be updated at any time — it overwrites the previous value.

## Payload fields

| Field            | Type          | Required | Description                                                         |
| ---------------- | ------------- | -------- | ------------------------------------------------------------------- |
| `correlation_id` | string (UUID) | Yes      | UUID returned by [Enroll Sub-merchant](/api-reference/naas/enroll). |
| `alias`          | string        | Yes      | URL slug. Letters, numbers, `_` and `-` only. Max 32 characters.    |

## Response `200 OK`

```json theme={null}
{ "alias": "acmepay" }
```

**`400`** — missing or invalid `correlation_id` or `alias`; `alias` fails format validation.

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

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://checkout.noxpay.io/v2/naas/submerchants/alias \
    -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",
        "alias": "acmepay"
      }
    }'
  ```

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

  body, sig = sign_envelope({
      "correlation_id": "a1b2c3d4-e5f6-4789-abcd-000000000001",
      "alias": "acmepay",
  })
  response = requests.post(
      "https://checkout.noxpay.io/v2/naas/submerchants/alias",
      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",
    alias: "acmepay",
  });
  const response = await fetch("https://checkout.noxpay.io/v2/naas/submerchants/alias", {
    method: "POST",
    headers: { "api-key": "<key>", "X-Signature": signature, "Content-Type": "application/json" },
    body,
  });
  const data = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  { "alias": "acmepay" }
  ```

  ```json 400 theme={null}
  { "error": "alias contains invalid characters" }
  ```
</ResponseExample>
