Integration Steps

Send a cross-border payout, from the access token to the final payout event. The steps are the same in the sandbox and in production.

This guide takes you through one payout, from the access token to the final payout event. The steps and the API calls are the same in the sandbox and in production. Only the host, the credentials and the webhook URLs are different. Test in the sandbox first.

The example sends IDR from your Durianpay balance to a US business. It uses the corridor US / USD: a destination country and currency. It uses the payout rail ACH (the US Automated Clearing House). A payout rail is the payment network that pays the account.

The example uses a setup without customers, so the payout has no customer. If your merchant account has a setup with customers, also do Step 4. For terms such as beneficiary type and payout rail, see Key terms.

How it works

  1. Get an access token and sign your calls.
  2. Read the corridor requirements for the corridor, the payout rail and the beneficiary type.
  3. Register the beneficiary and the payment account.
  4. Register the customer. Only in a setup with customers.
  5. Create a quote.
  6. Create the payout.
  7. Handle the payout events.

The diagram shows the example, with no customer. Its numbers count the messages. They are not the step numbers.

sequenceDiagram
    autonumber
    participant M as Merchant server
    participant API as Global Payout API
    participant WH as Merchant webhook endpoint
    M->>API: POST /v1.0/access-token/b2b signed with your RSA private key
    API-->>M: 200 accessToken
    Note over M,API: Every later call sends the access token and an HMAC signature
    Note over M,API: Fund your IDR balance
    M->>API: GET /v1.0/global/corridors/US/USD/requirements with payoutRail=ACH and beneficiaryType=business
    API-->>M: 200 beneficiary, payment account, customer and payout fields
    M->>API: POST /v1.0/global/beneficiaries
    API-->>M: 200 par_7pq3m
    M->>API: POST /v1.0/global/payment-accounts
    API-->>M: 200 ppy_4kd9wq
    API->>WH: global.beneficiary.updated, status active
    M->>API: POST /v1.0/global/quotes
    API-->>M: 200 orm_4wd7mb with totalDebit and expiresAt
    M->>API: POST /v1.0/global/payouts before expiresAt
    API-->>M: 200 orm_4wd7mb, status processing
    API->>WH: global.payout.updated, status completed
    Note over M,API: No event? Read GET /v1.0/global/payouts/orm_4wd7mb

Preparation

Do the steps in Preparation for the environment that you use. That page gives the host of each environment, the SNAP credentials, the webhook URLs and the funds that you need.

Step 1: Get an access token and sign your calls

Request an access token with POST /v1.0/access-token/b2b. For X-SIGNATURE, sign <client key>|<X-TIMESTAMP> with your RSA private key. Use SHA256withRSA (RSASSA-PKCS1-v1_5 with SHA-256). Encode the result in standard base64.

POST /v1.0/access-token/b2b
X-CLIENT-KEY: <client key>
X-TIMESTAMP: 2026-06-10T10:15:00+07:00
X-SIGNATURE: <base64 SHA256withRSA signature>
Content-Type: application/json
{
  "grantType": "client_credentials"
}

The response gives you the accessToken. expiresIn is the time when the token expires, as text. It is not a number of seconds. Get a new token before that time.

{
  "responseCode": "2007300",
  "responseMessage": "Successful",
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "tokenType": "BearerToken",
  "expiresIn": "2026-06-10 03:30:00.123456789 +0000 UTC"
}

Send the access token and an HMAC (hash-based message authentication code) signature on every later call. The only exception is the file upload to an uploadUrl (see Send supporting documents). When the call has a JSON request body, also send Content-Type: application/json.

Authorization: Bearer <accessToken>
X-PARTNER-ID: <client key>
X-TIMESTAMP: 2026-06-10T10:16:00+07:00
X-SIGNATURE: <base64 HMAC-SHA512 signature>
CHANNEL-ID: 95221
X-EXTERNAL-ID: <unique ID of this request>

Send a new, unique X-EXTERNAL-ID on each request. Authentication shows how to make each signature.

Step 2: Read the corridor requirements

Before you collect any data, call the Fetch Corridor Requirements API. The requirements are the fields that the corridor, the payout rail and the beneficiary type need. This example reads them for US/USD, ACH and a business beneficiary. In a setup with customers, also send customerType (see Step 4).

GET /v1.0/global/corridors/US/USD/requirements?payoutRail=ACH&beneficiaryType=business
{
  "responseCode": "2000000",
  "responseMessage": "Successful",
  "country": "US",
  "currency": "USD",
  "payoutRail": "ACH",
  "settlementTime": "t_plus_1",
  "beneficiaryType": "business",
  "beneficiary": {
    "fields": [
      {
        "key": "businessName",
        "type": "string",
        "required": true,
        "pattern": "^[a-zA-Z0-9]([a-zA-Z0-9 &.,'@()$]{0,173}[a-zA-Z0-9])?$"
      },
      {
        "key": "address",
        "type": "object",
        "required": true,
        "fields": [
          {
            "key": "country",
            "type": "string",
            "required": true,
            "pattern": "^[A-Z]{2}$"
          }
        ]
      }
    ]
  },
  "paymentAccount": {
    "fields": [
      {
        "key": "accountNumber",
        "type": "string",
        "required": true,
        "pattern": "^.{1,34}$",
        "maxLength": 34
      },
      {
        "key": "bankCode",
        "type": "string",
        "required": true
      },
      {
        "key": "accountHolderName",
        "type": "string",
        "required": true
      }
    ]
  },
  "payout": {
    "fields": [
      {
        "key": "purposeOfTransaction",
        "type": "enum",
        "required": true,
        "enumType": "purpose_of_transaction"
      },
      {
        "key": "relationship",
        "type": "enum",
        "required": false,
        "enumType": "relationship"
      }
    ],
    "documents": [
      {
        "documentType": "COMMERCIAL_INVOICE",
        "required": false
      },
      {
        "documentType": "PURPOSE_EVIDENCE",
        "required": false
      }
    ]
  },
  "version": "2026-06-01"
}

Each group of the response tells you where its values go:

Response groupWhere you send the values
beneficiary.fieldsAt the top level of the request body when you create the beneficiary (Step 3).
paymentAccount.fieldsIn accountDetails when you add the payment account (Step 3).
customer.fieldsAt the top level of the request body when you create the customer (Step 4).
payout.fieldsAt the top level of the request body when you create the payout (Step 6).
payout.documentsUpload these documents. Then send their referenceNo in documents when you create the payout. See Send supporting documents.

About this response:

  • relationship and the two documents are optional (required: false). The example does not send them. So the payout in Step 6 shows "documents": [].
  • If your response has more required fields, add them in the same places.
  • The API checks a pattern, minLength or maxLength together with the base field rules of the endpoint. For example, businessName must also have 2–140 characters.
  • Step 6 sends the sample purpose code OTHERS. In your integration, send the code of the real purpose.
  • This response has the enum types purpose_of_transaction and relationship. The value of documentType is a code of the enum type document_type. Get the codes with the Fetch Enum Codes API, for example GET /v1.0/global/enum/purpose_of_transaction.

Other corridors can have more fields, nested fields and more enum types. To read and map them, see Step 5: Read the corridor requirements and Map the fields and enums.

Step 3: Register the beneficiary and the payment account

A beneficiary is the individual or business that receives the payout. A payment account is a bank account of a beneficiary. A beneficiary can have more than one payment account. Each payout uses one payment account.

🚧

A success response to a create request does not mean that the requirements are met

The base fields are the request body fields on the API Reference page of the endpoint. When you create the beneficiary, the API checks the base fields and the value of each requirement field that you send. It does not refuse a missing requirement field. When you create the customer, the API checks only the base fields. When you create the payment account, the API checks only the account fields. The API checks that all the current requirements are met only when you create the payout (Step 6). If a field is missing then, the API returns REQUIREMENTS_UNMET (4030015). See Fix a REQUIREMENTS_UNMET error.

Create the beneficiary

Call the Create Beneficiary API (POST /v1.0/global/beneficiaries). Send the base fields and the values of beneficiary.fields from Step 2. Use the same nesting as the requirements, for example address.country. The API ignores a field that the requirements do not list, and does not store it. Use the same beneficiaryType as in Step 2. partnerReferenceNo is your own reference. Always send the same value for the same beneficiary.

{
  "partnerReferenceNo": "bnf-acme-001",
  "beneficiaryType": "business",
  "businessName": "Acme Trading LLC",
  "address": {
    "country": "US"
  }
}
{
  "responseCode": "2000000",
  "responseMessage": "Successful",
  "referenceNo": "par_7pq3m",
  "partnerReferenceNo": "bnf-acme-001",
  "beneficiaryType": "business",
  "businessName": "Acme Trading LLC",
  "address": {
    "country": "US"
  },
  "status": "active",
  "createdAt": "2026-06-10T03:15:02Z"
}

Save the referenceNo. The next calls use par_7pq3m.

  • Durianpay screens (checks) every beneficiary. During screening, the status is processing. Screening can end before the response, so the response can already show active.
  • You can add the payment account now. You do not have to wait until the beneficiary is active.
  • Before you create the quote, wait until the beneficiary is active. Durianpay sends global.beneficiary.updated with the status active. It sends this event even when the create response already shows active.
  • If no event comes, call the Fetch Beneficiary by ID API: GET /v1.0/global/beneficiaries/par_7pq3m.
  • Do not use a rejected beneficiary. For all the statuses, see Beneficiary status.
  • If the API refuses the create request, it stores nothing. Correct the fields that the error lists. Then send the request again with the same partnerReferenceNo.

Add the payment account

Add the account that receives the money with the Create Payment Account API (POST /v1.0/global/payment-accounts).

{
  "beneficiaryReferenceNo": "par_7pq3m",
  "country": "US",
  "currency": "USD",
  "payoutRail": "ACH",
  "accountDetails": {
    "bankCode": "026009593",
    "accountNumber": "4830291847",
    "accountHolderName": "Acme Trading LLC"
  }
}
{
  "responseCode": "2000000",
  "responseMessage": "Successful",
  "referenceNo": "ppy_4kd9wq",
  "beneficiaryReferenceNo": "par_7pq3m",
  "country": "US",
  "currency": "USD",
  "payoutRail": "ACH",
  "accountHolderName": "Acme Trading LLC",
  "status": "active",
  "createdAt": "2026-06-10T03:16:10Z"
}
  • Send the same country, currency and payoutRail that you used in Step 2.
  • Build accountDetails from the paymentAccount.fields of Step 2. Its accountHolderName is the legal name of the beneficiary.
  • Keep a copy of the full accountDetails that you sent. You must send all of them again when you update the account.
  • The beneficiary must not be rejected or inactive. If it is, the API returns ACTION_NOT_ALLOWED (4050001).

Save the referenceNo. You send ppy_4kd9wq in the payout, as paymentAccountReferenceNo.

A payment account has no status of its own. A new payout can use it while all of these are true:

  • The account is active.
  • Its beneficiary is active.
  • Its corridor is in the corridor list.

The account must also match the quote. It must have the same country, currency and payout rail. Its beneficiary must have the same beneficiary type.

Optional: to check the account first, call the Validate Account API. The result is information for your own checks. The Create Payout API does not use it. See Account Validation Result.

Step 4: Register the customer

Do this step only in a setup with customers. In a setup without customers, go to Step 5.

A customer is your end customer who sends the payout: the sender, also called the originator. Durianpay sets your customer setup during onboarding. You never send this setting.

Setup with customersSetup without customers
customerReferenceNo in the payoutRequired. Send the referenceNo of an active customer.Do not send it. If you send it, the API returns CUSTOMER_NOT_ALLOWED (4030025).
Create customersRequired.Not allowed. The API returns CUSTOMER_NOT_ALLOWED (4030025).
customerType in the requirementsSend it. The response has customer.fields.Do not send it. The response has no customer.
Fetch Customers APILists your customers.The list is empty.

Your customer is an individual or a business. This is the customer type (customerType). The customer type and the beneficiary type give the use case: b2b, b2c, c2b or c2c. The first letter is the customer, the second letter is the beneficiary. b is a business and c is an individual. You do not send the use case.

In a setup with customers, do these three things before you create the quote.

1. Read the requirements with your customer type. Add customerType to the request of Step 2:

GET /v1.0/global/corridors/US/USD/requirements?payoutRail=ACH&beneficiaryType=business&customerType=business

Without customerType, the response has no customer, so you do not see the customer fields. The Create Payout API still checks them. Another customer type can need other fields. So read the requirements again when you change the customer type.

2. Create the customer. Call the Create Customer API (POST /v1.0/global/customers). Use the same customerType as in the requirements. Send the base fields of that customer type:

  • Both customer types send partnerReferenceNo, customerType and address.
  • An individual customer also sends fullName. It sends dateOfBirth and nationality when customer.fields requires them.
  • A business customer also sends businessName, registrationNumber, incorporationCountry, incorporationDate and associates.

Also send every value that customer.fields describes, for every corridor that you use. You can send these values when you create or update the customer. If one is missing when you create the payout, missingFields lists it with resource: customer.

This example creates a business customer on US/USD. The beneficiary is also a business, so the use case is b2b:

{
  "partnerReferenceNo": "cust-90871",
  "customerType": "business",
  "businessName": "PT Sinar Logistik",
  "registrationDocument": {
    "type": "NIB",
    "number": "9120001234567",
    "issuingCountry": "ID",
    "issueDate": "2019-08-01"
  },
  "registrationNumber": "8120001234567",
  "incorporationCountry": "ID",
  "incorporationDate": "2015-03-02",
  "address": {
    "line1": "Jl. M.H. Thamrin No. 10",
    "city": "Jakarta",
    "country": "ID",
    "postalCode": "10350"
  },
  "typeOfBusiness": "COMPANY",
  "sourceOfIncome": "BUSINESS",
  "associates": [
    {
      "fullName": "Budi Adi Santoso",
      "idNumber": "3174xxxxxxxxxxxx",
      "titles": ["ubo", "director"],
      "ownershipPct": 60,
      "nationality": "ID",
      "dateOfBirth": "1978-05-14",
      "mobileNumber": "+6281234567890",
      "customerType": "individual"
    }
  ]
}

The response has the fields that you sent, the referenceNo, the status and createdAt. In this example, the referenceNo is cus_1abc9k. Save it. You send it in the payout, as customerReferenceNo.

If you send a different partnerReferenceNo, the API creates a new customer, even for the same person or business.

Associates. For a business customer, send every associate in one associates list. Include the ultimate beneficial owners (UBOs).

  • Each associate has fullName, idNumber and titles. titles has values from ubo, director, signatory and account_representative.
  • A ubo associate also has an ownershipPct of at least 25.
  • The corridor fields for associates in customer.fields apply only to the entries whose titles include ubo.
  • associates[].customerType is the type of that associate. It is not the customerType of the customer.

The Create Customer API has all the fields, the name rules of associates and an individual example. See also the Customer Object.

3. Wait until the customer is active. A new customer starts in processing while Durianpay screens it. Wait for global.customer.updated with the status active. If no event comes, call the Fetch Customer by ID API (GET /v1.0/global/customers/{referenceNo}). You can send only the referenceNo of an active customer in a payout. For all the statuses, see Customer status.

Step 5: Create a quote

Get the price of the payout with the Create Quote API (POST /v1.0/global/quotes).

  • Create the quote only when the beneficiary is active. In a setup with customers, the customer must also be active. A quote that you create earlier can expire while you wait.
  • Use the same corridor, payout rail and beneficiary type as the payment account and its beneficiary.
  • You do not send the payment account or the customer. The price comes from the beneficiary type.
🚧

Create the payout before expiresAt

The quote is valid until its expiresAt. The lifetime of a quote varies, so read expiresAt in each quote. Do not use a fixed time, such as five minutes. Screening or review of the payout can end after expiresAt. If Durianpay has not debited your balance then, the payout can become failed with the failure code QUOTE_EXPIRED. See FX window in Key terms.

{
  "amountMode": "source_amount",
  "amount": {
    "value": "160000000.00",
    "currency": "IDR"
  },
  "destinationCountry": "US",
  "destinationCurrency": "USD",
  "payoutRail": "ACH",
  "beneficiaryType": "business"
}
{
  "responseCode": "2000000",
  "responseMessage": "Successful",
  "referenceNo": "orm_4wd7mb",
  "status": "active",
  "amountMode": "source_amount",
  "payoutRail": "ACH",
  "beneficiaryType": "business",
  "source": {
    "value": "160000000.00",
    "currency": "IDR"
  },
  "destinationCountry": "US",
  "destination": {
    "value": "9876.54",
    "currency": "USD"
  },
  "rate": "16200.00",
  "fees": [
    {
      "type": "fixed_fee",
      "amount": {
        "value": "15000.00",
        "currency": "IDR"
      }
    }
  ],
  "totalDebit": {
    "value": "160015000.00",
    "currency": "IDR"
  },
  "settlementTime": "t_plus_1",
  "createdAt": "2026-06-10T03:16:30Z",
  "expiresAt": "2026-06-10T03:21:00Z"
}

amountMode selects the amount that you set:

amountModeYou setamount.currency
source_amountThe IDR amount that you pay, before the fee. Send whole rupiah: the fractional part must be zero, as in 160000000.00.IDR
destination_amountThe amount that the beneficiary receives.The destination currency, for example USD

A quote does not debit your balance. Your available balance must cover the totalDebit. Save the referenceNo. The payout that uses this quote gets the same referenceNo.

Preview the rate (optional)

Before you create a quote, you can see the rates of the destination currencies. Call the Fetch Indicative Rates API (GET /v1.0/global/rates). This call does not create a quote and does not lock a price.

GET /v1.0/global/rates
{
  "responseCode": "2000000",
  "responseMessage": "Successful",
  "data": [
    {
      "sourceCurrency": "IDR",
      "destinationCurrency": "USD",
      "rate": "16200.00"
    },
    {
      "sourceCurrency": "IDR",
      "destinationCurrency": "SGD",
      "rate": "12450.00"
    }
  ]
}
  • rate is the IDR amount for one unit of the destination currency. It includes the FX margin, but not the fee.
  • To get one currency only, add destinationCurrency, for example destinationCurrency=USD.
  • Without destinationCurrency, a currency with no current rate is not in data.
  • A rate has no expiresAt. It does not use a country, a payout rail or a beneficiary type. A quote uses them, so the price of a quote can be different from the preview.

Step 6: Create the payout

Send the payout with the Create Payout API (POST /v1.0/global/payouts). Use your own unique partnerReferenceNo. Send the referenceNo of the quote, the referenceNo of the payment account and the values of payout.fields. The API ignores a payout field that payout.fields does not list, and does not store it.

{
  "partnerReferenceNo": "merchant-tx-44824",
  "quoteReferenceNo": "orm_4wd7mb",
  "paymentAccountReferenceNo": "ppy_4kd9wq",
  "purposeOfTransaction": "OTHERS"
}
{
  "responseCode": "2000000",
  "responseMessage": "Successful",
  "referenceNo": "orm_4wd7mb",
  "partnerReferenceNo": "merchant-tx-44824",
  "status": "processing",
  "beneficiaryReferenceNo": "par_7pq3m",
  "paymentAccountReferenceNo": "ppy_4kd9wq",
  "purposeOfTransaction": "OTHERS",
  "quote": {
    "referenceNo": "orm_4wd7mb",
    "payoutRail": "ACH",
    "rate": "16200.00",
    "fees": [
      {
        "type": "fixed_fee",
        "amount": {
          "value": "15000.00",
          "currency": "IDR"
        }
      }
    ],
    "totalDebit": {
      "value": "160015000.00",
      "currency": "IDR"
    }
  },
  "destinationCountry": "US",
  "destination": {
    "value": "9876.54",
    "currency": "USD"
  },
  "documents": [],
  "createdAt": "2026-06-10T03:17:10Z"
}

HTTP 200 means that Durianpay accepted the payout. Its status is processing. The beneficiary is not paid yet.

  • In a setup without customers, do not send customerReferenceNo.
  • In a setup with customers, also send customerReferenceNo. The example in Send supporting documents shows it. If it is missing, the API returns FIELD_MISSING (4000002).
  • If the API refuses the request, it stores nothing and does not use the quote. Use additionalInfo.code to select your error handling.

No response? If the create call times out or returns HTTP 5xx, do not create a new payout. Follow Recover a lost response.

Step 7: Handle the payout events

Wait for global.payout.updated events until the status of the payout is completed, failed or refunded. In the example, the payout ends in completed.

If an event does not come, call the Fetch Payout by ID API (GET /v1.0/global/payouts/{referenceNo}):

GET /v1.0/global/payouts/orm_4wd7mb

Also handle the other statuses. See Status Definition and Webhooks.

In the sandbox, this payout completes within 30 seconds, because its partnerReferenceNo has no scenario prefix. To test other outcomes, see Testing in the Sandbox.

Send supporting documents

payout.documents in the requirements (Step 2) lists the document types that a payout on the corridor accepts. required: true means that the payout needs the document. Upload each document before you create the payout.

  1. Send the document details. Call the Upload Document API (POST /v1.0/global/documents) with a documentType from payout.documents. The response gives the referenceNo of the document, the status pending_upload and an uploadUrl.
  2. Send the file. Send the file to the exact uploadUrl with PUT. Do not build the URL yourself. Send the file as the raw request body: not in JSON and not in base64. Use the contentType of step 1 as Content-Type. Do not send SNAP headers. The file must be at most 10 MiB.
  3. Check the status. The response of step 2 shows "status": "uploaded". The Create Payout API refuses a document that is not uploaded.
  4. Send each referenceNo in documents when you create the payout. You can send up to five documents.
{
  "partnerReferenceNo": "inv-2026-0612",
  "documentType": "COMMERCIAL_INVOICE",
  "fileName": "inv-2026-0612.pdf",
  "contentType": "application/pdf"
}
PUT /v1.0/global/documents/doc_4fj2k9/content?token=upt_7Kq2mX9vR4tL8wZ3
Host: api.durianpay.id
Content-Type: application/pdf

<file bytes>

The uploadUrl works for one successful upload, until uploadUrlExpiresAt. Its host is the host of the environment that you call, for example api-sandbox.durianpay.id in the sandbox. If the link expired, send step 1 again with the same partnerReferenceNo and request body. The response has a new uploadUrl.

This payout request sends the document doc_4fj2k9. It is for a setup with customers, so it has a customerReferenceNo:

{
  "partnerReferenceNo": "merchant-tx-44825",
  "quoteReferenceNo": "orm_6tr4wa",
  "paymentAccountReferenceNo": "ppy_4kd9wq",
  "customerReferenceNo": "cus_1abc9k",
  "purposeOfTransaction": "OTHERS",
  "documents": ["doc_4fj2k9"]
}
  • You can use a document in one payout only. This is also true when that payout becomes failed. For a new payout, upload the file again as a new document, with a new partnerReferenceNo.
  • If a required document is missing, the API returns REQUIREMENTS_UNMET (4030015). It lists the document in missingDocuments.

For all the upload rules and errors, see the Upload Document API.

Update, deactivate and find resources

  • Reuse: you can use a beneficiary or a customer again when it is active and meets the current requirements. If details are missing, update it before you create the quote.
  • Full request body: an update replaces the full resource. Send the full create request body again, with your changes. If you omit an optional field, the API removes it.
  • New screening: if you change a field that Durianpay screens, the beneficiary or the customer goes back to processing. If screening then rejects it, Durianpay stops its payouts that it can still stop. Their status becomes failed. Do not create a new payout to that beneficiary or for that customer.
  • Statuses: see Beneficiary status, Customer status and When a payout can use the account.

Next steps

If you want toDo this
Get status changes as eventsVerify and answer each event. See Webhooks.
Handle errors and repeated requestsSee Errors and Idempotency and repeated requests.
Store the fields of each corridorSee Step 5: Read the corridor requirements.
Move from the sandbox to productionUse the production host, credentials and webhook URLs. Add IDR to your production balance by virtual account. See Environments.

Did this page help you?