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

# Create Payout

> Creates a payout in the remittance flow. It works like Create Payout but requires a remitter_id.

<Prompt description="Create Payout" actions={["cursor"]}>
  Add the Zapyd "Create Payout" call (`POST /pos/api/v1/remittance-payout/initiate`) to my backend. Creates a payout in the remittance flow. It works like Create Payout but requires a remitter\_id.

  * Sandbox: `POST https://sandbox.zapyd.com/pos/api/v1/remittance-payout/initiate`
  * Production: `POST https://api.zapyd.com/pos/api/v1/remittance-payout/initiate`

  JSON body:

  * `quotation_id` (string, uuid, required): The unique identifier of the quotation, obtained from POST /remittance-payout/quotation.
  * `customer_id` (string, uuid, required): The unique identifier of the customer.
  * `remitter_id` (string, uuid, required): The unique identifier of the remitter, obtained from POST /kyc/remitter/create. Stored on the payout and echoed back in the response.
  * `client_reference_id` (string, optional): Optional client reference ID for tracking. Example: `testUser123`.
  * `transaction_hash` (string, optional): Required on the per-order model: hash of your transfer of sending\_amount to the quotation's wallet\_address. Leave it out on the prefunded model. Example: \`\`.

  Success: HTTP 201, `{status: true, message, data}`. `data`: `id`, `quotation_id`, `customer_id`, `bank_id`, `remitter_id` (Remitter ID (remittance payouts only)), `asset`, `network`, `fiat`, `rate`, `sending_amount`, `receiving_amount` (Fiat amount the beneficiary receives), `client_reference_id`, `fees`, `status`, `wallet_address` (Deposit address from the quotation), `transaction_hash`, `created_at`.
  Errors (`{status: false, message, err_code, errors}`):

  * 400 `Bad Request`: `remitter_id` (or another required field) is missing
  * 400 `Client Reference ID already exists`
  * 400 `Quotation is not found`: Quotation does not exist or does not belong to this organization
  * 400 `Quotation has expired`
  * 400 `Quotation is already linked to another payout`
  * 400 `Unable to process payout. Please try again`: Order creation failed; the payout is rolled back and not created
  * 500 `Internal Server Error`
    Every endpoint can also return 401 `AUTH_*` (signature, timestamp or key: fix, don't retry), and 429 or 5xx (retry with backoff).

  Rules:

  * Send the `quotation_id` from the remittance quotation, the beneficiary's `customer_id` and the same `remitter_id`.
  * Per-order model: include `transaction_hash` of your transfer to the quotation's `wallet_address`. Prefunded model: leave it out; Zapyd reserves the amount from your balance.
  * The payout stays `PROCESSING` while Zapyd checks the beneficiary, the remitter and the bank account. A rejected beneficiary KYC or bank account fails the payout with `Payout failed`.
  * Track it with the `PAYOUT` webhook (no webhook for `PROCESSING`): `SUCCESS` with `metadata.utr` (show it as proof of payment), `IN_REVIEW` (send the user to `metadata.rfi_link` when present, otherwise wait), `FAILED` (always the generic `Payout failed`), `REFUNDED`. Every event carries your `client_reference_id`. Most payouts finish in 30 to 60 minutes; bank delays can take up to 24 hours.
  * Poll with `GET /pos/api/v1/payout/{payout_id}`. On a timeout or 5xx, check `GET /pos/api/v1/payout/history` before retrying.

  Signing (every request):

  * Headers: `X-API-KEY`, `X-TIMESTAMP` (Unix seconds, within 300 s of server time; generate per request) and `X-SIGNATURE`.
  * `X-SIGNATURE` = Base64(HMAC-SHA256(key = API secret, message = apiKey + "|" + timestamp + "|" + canonicalBody)). Base64 of the raw digest, not hex.
  * canonicalBody: the JSON body with keys sorted at every nesting level, no whitespace (separators `,` and `:`), and every non-ASCII character escaped as lowercase `\uXXXX` (Python `json.dumps(body, sort_keys=True, separators=(",", ":"))`). Requests with no body (GET, DELETE) sign `{}`. Query parameters are not signed.
  * Send the exact canonicalBody string you signed as the request body, with `Content-Type: application/json`.
  * Test vector: key `3f1b2c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d`, secret `test-secret-do-not-use`, timestamp `1735689600`. Signing `{}` gives `6sCtVSRQjU9+2/af8gdwUAvY1l6Ii6ENcbRfanPkhY0=`. Body `{"customer_id":"78c99d71-f28f-47a9-8302-93b286efbe0e","amount":100.5,"currency":"INR","meta":{"note":"Café","b":2,"a":1}}` gives `l+DvQrzlKbsOSxSYOdWoWHEehcFRZfDJPKlLDkm2cSI=`.

  Deliver:

  1. A typed `createRemittancePayout` function in this codebase's language and HTTP client. Reuse an existing Zapyd client and signer, or write one small shared client.
  2. Config from `ZAPYD_API_KEY`, `ZAPYD_API_SECRET` and `ZAPYD_BASE_URL`. The secret stays on the server, never in a browser or app.
  3. Return `data`. When `status` is false, throw an error with the HTTP status, `err_code`, `message` and `errors`. Don't show raw errors to end users.
  4. Retry only 429 and 5xx: exponential backoff from 1 s, capped at 30 s, at most 5 attempts.
  5. Amounts as strings. Types for every field above.
  6. Tests: the signer against the test vector, and this call against sandbox.

  Reference: `https://docs.zapyd.com/api-reference-exchange/endpoint/remittance-payout/initiate.md`
</Prompt>

## Error Codes and Messages

| API Status Code | Response | Reason |
| - | - | - |
| 400 | Bad Request | `remitter_id` (or another required field) is missing |
| 400 | Client Reference ID already exists | Client Reference ID already exists |
| 400 | Quotation is not found | Quotation does not exist or does not belong to this organization |
| 400 | Quotation has expired | Quotation has expired |
| 400 | Quotation is already linked to another payout | Quotation is already linked to another payout |
| 400 | Unable to process payout. Please try again. | Order creation failed; the payout is rolled back and not created |
| 500 | Internal Server Error | Internal Server Error |


## OpenAPI

````yaml POST /remittance-payout/initiate
openapi: 3.1.0
info:
  title: Zapyd API
  description: API for Zapyd - Customer, Payout, and Webhook services
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://sandbox.zapyd.com/pos/api/v1
    description: Payout API Base URL
    variables:
      base_url:
        default: https://sandbox.zapyd.com
  - url: https://sandbox.zapyd.com/cms/api/v1
    description: Customer API Base URL
    variables:
      base_url:
        default: https://sandbox.zapyd.com
security:
  - ApiKeyAuth: []
    TimestampAuth: []
    SignatureAuth: []
tags:
  - name: Customer
    description: Customer related operations
    x-displayName: Customer
    x-traitTag: true
  - name: Payout
    description: Payout related operations
  - name: Webhooks
    description: Webhook related operations
  - name: Widget
    description: Hosted buy/sell widget session initialization
paths:
  /remittance-payout/initiate:
    post:
      tags:
        - Payout
      description: >-
        Creates a payout for a remittance-user flow. Identical to Create Payout
        (same quotation validation, flow handling, and response shape) with one
        addition: a required remitter_id, referencing a remitter created via
        POST /kyc/remitter/create. Link it to a quotation created via POST
        /remittance-payout/quotation.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - quotation_id
                - customer_id
                - remitter_id
              properties:
                quotation_id:
                  type: string
                  format: uuid
                  description: >-
                    The unique identifier of the quotation, obtained from POST
                    /remittance-payout/quotation
                  example: 2e104290-07c8-49f1-a5ca-0d27f0078f8a
                customer_id:
                  type: string
                  format: uuid
                  description: The unique identifier of the customer
                  example: def8b740-99f9-4cba-bc9e-99de57e927b4
                remitter_id:
                  type: string
                  format: uuid
                  description: >-
                    The unique identifier of the remitter, obtained from POST
                    /kyc/remitter/create. Stored on the payout and echoed back
                    in the response.
                  example: e14fa86f-2a5e-437a-a031-949c68ade933
                client_reference_id:
                  type: string
                  description: Optional client reference ID for tracking.
                  example: testUser123
                transaction_hash:
                  type: string
                  description: >-
                    Required on the per-order model: hash of your transfer of
                    sending_amount to the quotation's wallet_address. Leave it
                    out on the prefunded model.
                  example: ''
      responses:
        '201':
          description: Remittance payout created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Success
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Payout ID
                        example: b3f1c2d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d
                        format: uuid
                      quotation_id:
                        type: string
                        description: Quotation ID
                        example: 59bf60c3-e9af-40a7-9d5c-2a1aa191e769
                        format: uuid
                      customer_id:
                        type: string
                        description: Customer ID
                        example: 84737c7d-7b62-4204-80d6-80f6ecb3ceb4
                        format: uuid
                      bank_id:
                        type: string
                        description: Bank account ID
                        example: cab47575-bbcb-4294-81a3-30774104f3b6
                        format: uuid
                      remitter_id:
                        type: string
                        description: Remitter ID (remittance payouts only)
                        example: e14fa86f-2a5e-437a-a031-949c68ade933
                        format: uuid
                      asset:
                        type: string
                        example: USDT
                      network:
                        type: string
                        description: Network
                        example: tron
                      fiat:
                        type: string
                        example: INR
                      rate:
                        type: string
                        description: Fee-inclusive rate
                        example: '85.00'
                      sending_amount:
                        type: string
                        description: Crypto amount
                        example: '60.00'
                      receiving_amount:
                        type: string
                        description: Fiat amount the beneficiary receives
                        example: '5100.00'
                      client_reference_id:
                        type:
                          - string
                          - 'null'
                        example: payout-ref-001
                      fees:
                        type: object
                        description: Fee breakdown
                        example:
                          zapyd_fee: '0.00'
                          client_fee: '0.00'
                          client_gst: '0.00'
                          tds: '0'
                      status:
                        type: string
                        description: Payout status
                        example: PROCESSING
                        enum:
                          - PROCESSING
                          - SUCCESS
                          - FAILED
                          - REFUNDED
                          - IN_REVIEW
                      wallet_address:
                        type: string
                        description: Deposit address from the quotation
                        example: TXqH4MnDw46f3yyrRwau3JF92Y1ie3pAXf
                      transaction_hash:
                        type:
                          - string
                          - 'null'
                        description: On-chain funding transaction
                        example: 0x9f2c…
                      created_at:
                        type: string
                        example: '2026-09-30T10:00:00Z'
                        format: date-time
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Bad Request
                  err_code:
                    type: string
                    example: REQ_FIELD_MISSING
                  errors:
                    type: object
                    properties:
                      remitter_id:
                        type: array
                        items:
                          type: string
                        example:
                          - This field is required.
                  data:
                    type: 'null'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Internal Server Error
                  data:
                    type: 'null'
                  err_code:
                    type: string
                    example: SYS_INTERNAL_ERROR
                  errors:
                    type: string
                    example: Unexpected error occurred. Please try again later.
      servers:
        - url: https://sandbox.zapyd.com/pos/api/v1
          description: Remittance Payout API Base URL
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: API Key for authentication
    TimestampAuth:
      type: apiKey
      in: header
      name: X-TIMESTAMP
      description: Current timestamp in seconds since epoch
    SignatureAuth:
      type: apiKey
      in: header
      name: X-SIGNATURE
      description: HMAC SHA256 signature of the request encoded in Base64

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.