Create Payout

The following endpoint creates a payout from an active quote.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
🚧

2000000 does not mean that the beneficiary has the funds

2000000 means that the payout exists and its status is processing. This call does not send an event. To follow the payout, handle the Payout Notification events, or call the Fetch Payout by ID API.

Before you call this endpoint, prepare these items:

  1. An active quote that no payout has used.
  2. A payment account that is active. Its beneficiary must be active. The country, currency and payout rail of the account must match the quote. The beneficiary type must also match the quote.
  3. In a setup with customers, an active customer.
  4. A request body that you build from payout.fields and payout.documents of the Fetch Corridor Requirements API.

The API can refuse the request. Then the API stores nothing and does not use the quote. Read additionalInfo.code:

CauseadditionalInfo.code
The quote expired.QUOTE_EXPIRED (4030000)
Another payout used the quote.QUOTE_ALREADY_USED (4090003)
Another payout uses a document in documents.DOCUMENT_ALREADY_USED (4090002)
The payment account is inactive.PAYMENT_ACCOUNT_INACTIVE (4030030)
The beneficiary cannot receive a new payout.BENEFICIARY_NOT_ACTIVE (4030029)
The payout rail of the account differs from the quote.QUOTE_RAIL_MISMATCH (4040018)
The country or currency of the account differs from the destination of the quote.QUOTE_DESTINATION_MISMATCH (4040023)
The beneficiary type differs from the quote.QUOTE_BENEFICIARY_TYPE_MISMATCH (4040022)
A new payout cannot use the customer.CUSTOMER_NOT_ACTIVE (4030028)
You send a customer in a setup without customers.CUSTOMER_NOT_ALLOWED (4030025)
Your available balance does not cover totalDebit.INSUFFICIENT_BALANCE (4030014)
A field of the beneficiary, the payment account or the customer is missing, or a required document is missing.REQUIREMENTS_UNMET (4030015)
Durianpay cannot accept the payout now (retriable: true).PAYOUT_TEMPORARILY_UNAVAILABLE (4030027)

Response Code Handling gives the next step for each code.

Notes:

  • The payout gets the referenceNo of the quote.
  • This call checks the beneficiary, the payment account, the customer and the documents again, with the current requirements. One REQUIREMENTS_UNMET error lists every missing field and document. See Fix a REQUIREMENTS_UNMET error.
  • Send a document only when its status is uploaded. If a document in documents is not uploaded, the API returns a validation error. If another payout uses a document in documents, the API returns DOCUMENT_ALREADY_USED (4090002). Upload a new document for this payout. See Document Object.
  • A validation error lists each field in additionalInfo.errors. If a required payout field is missing, the code of that field is FIELD_MISSING (4000002). If a field that payout.fields lists has a bad value, the code is FIELD_INVALID (4000001).
  • The API also returns FIELD_INVALID when partnerReferenceNo, quoteReferenceNo, paymentAccountReferenceNo, customerReferenceNo or documents has the wrong JSON type.
  • If you send a payout field that payout.fields does not list, the API ignores it. The create succeeds, and the API does not store the field. purposeOfTransaction is required only when payout.fields says so.
  • This call checks your balance, but it does not reserve the funds. See Fund your balance and Balance cut-off.
  • If you send the same partnerReferenceNo and the same request body again, the API returns the existing payout with additionalInfo.replayed: true. With a different request body, the API returns PARTNER_REFERENCE_NO_CONFLICT (4090001). See Idempotency and repeated requests.
  • After a timeout or an HTTP 5xx response, keep the same partnerReferenceNo. Then follow Recover a Lost Response.
  • In the sandbox, you select a test outcome with the prefix of partnerReferenceNo. See Testing in the Sandbox.
  • For the fields, the statuses, the lifecycle and the deadlines of a payout, see Payout Object.

Other body fields

  • Other payout fields (As specified, Per requirements): Follow payout.fields.

Sequence diagram: payout create

sequenceDiagram
    autonumber
    participant M as Merchant server
    participant API as Global Payout API
    participant WH as Merchant webhook endpoint
    opt Check the account first
        M->>API: POST /v1.0/global/account-validation
        API-->>M: 200 valid, invalid or service_unavailable
    end
    M->>API: POST /v1.0/global/payouts with paymentAccountReferenceNo
    API-->>M: 200 payout, status processing
    alt Checks pass
        API->>WH: global.payout.updated, status completed
    else Checks fail
        API->>WH: global.payout.updated, status failed
        M->>API: GET the payout for its failure code
    end
    Note over M,API: Simplified. The payout can also fail later. See Payout lifecycle.
Body Params
string
required

Your unique reference for this payout, 1–64 characters.

string
required

Your active, unused quote. Its referenceNo becomes the payout referenceNo.

string
required

Your payment account. It must not be inactive, and its beneficiary must be active. Its country, currency and payout rail, and the beneficiary's type, must match the quote.

string

Your active customer: the sender of the payout. In a setup without customers, do not send it. See Customers on payouts. Required: In a setup with customers.

string

Required where payout.fields says so. A code from GET /v1.0/global/enum/purpose_of_transaction. See Purpose below. Required: Per requirements.

documents
array of strings

Up to five document referenceNo values from document upload. Durianpay reads the type of each document from the document. Required: Per requirements.

documents
string

A code of enum type relationship. Follow its required flag in payout.fields. The US/USD example lets you omit it. Required: Per requirements.

string

A code of enum type source_of_income. Send it only when payout.fields lists it. Required: Per requirements.

string

More detail about the purpose. Follow payout.fields. Required: Per requirements.

string

A note for the beneficiary. Some corridors require it. Follow payout.fields. Required: Per requirements.

Headers
string
required

The request time, RFC 3339 with an offset.

string
required

HMAC-SHA512 of the string to sign, with your client secret as the key, in standard base64.

string
required

Your SNAP client key. It must match the token.

string
required

Required. Use a unique ID for each request. It is not an idempotency key: see Idempotency.

string
required

Required. Any non-empty value is accepted, for example 95221.

Responses

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json