# Create an onboarding link for a merchant

Creates a link the merchant opens to complete onboarding. Send `attribution` to record the sales agent, channel and partners on the merchant application at the same time. A new link expires every earlier link for the same merchant.

Endpoint: POST /v1/onboarding_links
Version: v1
Security: api-key-secret

## Security:

  - `api-key-secret` (unknown)
    http basic

## Request fields (application/json):

  - `merchant_id` (string, required)
    Merchant the link onboards.
    Example: merchant_2x4y6z8a0b1c2d3e4f5g6h7j8k

  - `return_url` (string)
    URL to send the merchant to after onboarding is complete.
    Example: https://dashboard.example.com/onboarding/done

  - `type` (string)
    Kind of onboarding link. Only account_onboarding exists.
    Enum: "account_onboarding"

  - `attribution` (object)
    Sales attribution to record on the merchant application when the link is created: the agent, channel, source, reseller and referral partner.

  - `attribution.user_id` (number, required)
    CRM user ID of the sales agent to assign to the merchant application.
    Example: 12345

  - `attribution.channel_id` (number)
    CRM channel (group) ID to assign.
    Example: 67890

  - `attribution.source_id` (number)
    CRM lead source ID to assign.
    Example: 42

  - `attribution.rsl_user_id` (number)
    CRM user ID of the reseller to assign.
    Example: 11111

  - `attribution.referral_partner_user_id` (number)
    CRM user ID of the referral partner to assign.
    Example: 22222

## Response 201:

  - `201` (unknown)
    The new onboarding link.

## Response 201 fields (application/json):

  - `url` (string, required)
    Onboarding link to send to the merchant. It carries a token, so treat it as a secret.
    Example: https://apply.example.com/link?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

  - `id` (string, required)
    Onboarding link ID.
    Example: onl_2x4y6z8a0b1c2d3e4f5g6h7j8k

  - `expires_at` (string, required)
    When the link stops working.
    Example: 2026-01-15T10:30:00.000Z

  - `merchant_id` (string, required)
    Merchant the link onboards.
    Example: merchant_2x4y6z8a0b1c2d3e4f5g6h7j8k

## Response 400:

  - `400` (unknown)
    The request is invalid.

## Response 400 fields (application/json):

  - `status_code` (number, required)
    HTTP status code of the response.
    Example: 400

  - `message` (any, required)
    What went wrong. A request that fails validation lists one message per invalid field.
    Example: Device IMEI '357111112222333' is not available to be used.

  - `error` (string, required)
    Error code. A broken business rule returns a stable SCREAMING_SNAKE_CASE code to branch on; other failures return a generic name such as `NotFoundException`.
    Example: DEVICE_IMEI_ALREADY_BOUND

  - `details` (object)
    Extra context some business-rule errors carry.

  - `debug_id` (string)
    Reference for this request, also sent in the `X-Debug-Id` header. Quote it when contacting support.
    Example: dbg_01k8x2v9j3m4n5p6q7r8s9t0vw

  - `timestamp` (string, required)
    When the error occurred.
    Example: 2026-01-15T10:30:00.000Z

## Response 401:

  - `401` (unknown)
    Missing or invalid API key credentials.

## Response 401 fields (application/json):

  - `status_code` (number, required)
    HTTP status code of the response.
    Example: 400

  - `message` (any, required)
    What went wrong. A request that fails validation lists one message per invalid field.
    Example: Device IMEI '357111112222333' is not available to be used.

  - `error` (string, required)
    Error code. A broken business rule returns a stable SCREAMING_SNAKE_CASE code to branch on; other failures return a generic name such as `NotFoundException`.
    Example: DEVICE_IMEI_ALREADY_BOUND

  - `details` (object)
    Extra context some business-rule errors carry.

  - `debug_id` (string)
    Reference for this request, also sent in the `X-Debug-Id` header. Quote it when contacting support.
    Example: dbg_01k8x2v9j3m4n5p6q7r8s9t0vw

  - `timestamp` (string, required)
    When the error occurred.
    Example: 2026-01-15T10:30:00.000Z

## Response 404:

  - `404` (unknown)
    Merchant not found for this account.

## Response 404 fields (application/json):

  - `status_code` (number, required)
    HTTP status code of the response.
    Example: 400

  - `message` (any, required)
    What went wrong. A request that fails validation lists one message per invalid field.
    Example: Device IMEI '357111112222333' is not available to be used.

  - `error` (string, required)
    Error code. A broken business rule returns a stable SCREAMING_SNAKE_CASE code to branch on; other failures return a generic name such as `NotFoundException`.
    Example: DEVICE_IMEI_ALREADY_BOUND

  - `details` (object)
    Extra context some business-rule errors carry.

  - `debug_id` (string)
    Reference for this request, also sent in the `X-Debug-Id` header. Quote it when contacting support.
    Example: dbg_01k8x2v9j3m4n5p6q7r8s9t0vw

  - `timestamp` (string, required)
    When the error occurred.
    Example: 2026-01-15T10:30:00.000Z

