Response Code Handling

Response codes, error bodies and payout failure codes of the Global Payout API.

The Global Payout API describes a problem in one of two ways:

What you getWhat it describesWhere
responseCode with additionalInfo.codeA call that the API refused.Response Code List, below
Payout failure codeThe outcome of a payout that exists and failed.Payout Failure Codes, below

Response Definition

Format

Every response has a responseCode of 7 digits: the HTTP status (3 digits), the service code (2 digits) and the case code (2 digits). The service code is always 00.

For example, when you create a payout and your balance is too low, the API refuses the request with 4030014:

  • 403 is the HTTP status (Forbidden),
  • 00 is the service code, and
  • 14 is the case code.

A successful call returns HTTP 200 with 2000000 (Successful).

Error body

The response body of an error has responseCode, responseMessage and additionalInfo. additionalInfo gives the Global Payout detail.

🚧

Do not build your error handling on responseCode alone

Each error with additionalInfo.code has its own responseCode. But 4000002 can be a missing field or a missing SNAP header. Some errors with additionalInfo.code also return HTTP 404 or HTTP 405:

  • HTTP 404, for example AMOUNT_BELOW_MINIMUM (4040013) and CANCEL_NOT_ALLOWED (4040020).
  • HTTP 405, for example ACTION_NOT_ALLOWED (4050001) and USE_CASE_NOT_SUPPORTED (4050002).

When the response has additionalInfo.code, the API refused the request for the cause that code gives. It does not mean that the URL or the method is wrong. When additionalInfo has errors or code, make your error handling read additionalInfo, not responseCode or the HTTP status.

A 4040000 or a 4050000 response with no additionalInfo is different: the path or the HTTP method is wrong.

Read additionalInfo in this order:

  1. additionalInfo.errors is present: a validation error.
  2. additionalInfo.code is present: use code in your error handling.
  3. Neither is present: handle the error by its responseCode. The cause is an authentication error, a body that is not a valid JSON object (4000000), an unknown path (4040000), a wrong HTTP method (4050000), or an HTTP 5xx error. For a 5xx error when you create a payout, follow Recover a Lost Response.
Error responseWhat additionalInfo contains
Validation errorerrors lists every field that fails. Each item has code, field and action. An item can also have pattern: the regular expression that the value must match. responseCode is 4000002 when a field is missing, else 4000001.
Error with codecode is the Global Payout code, such as INSUFFICIENT_BALANCE. The other fields of that code are next to it.
Missing requirementsmissingFields lists each missing field as {resource, field}. field is a dotted path, as in a validation error. resource is beneficiary, payment_account or customer. missingDocuments lists each missing supporting document as {documentType}. When you create a payout, one REQUIREMENTS_UNMET error lists every missing field of the beneficiary, the payment account and the customer, and every missing document.
Retriable errorretriable: true. Other errors do not have this field.
Error without errors and without codeOnly trace_id, or the response has no additionalInfo. For example, the response for an unknown client key, an unknown path or a wrong HTTP method has no additionalInfo.

How to fix missing requirements:

A missing payout field is not a missing requirement. It is a validation error: the API returns FIELD_MISSING (4000002). Add the field to the request body of the payout.

{
  "responseCode": "4000002",
  "responseMessage": "Invalid Mandatory Field",
  "additionalInfo": {
    "errors": [
      {
        "code": "FIELD_MISSING",
        "field": "accountDetails.accountHolderName",
        "action": "Provide accountDetails.accountHolderName"
      },
      {
        "code": "FIELD_INVALID",
        "field": "accountDetails.accountNumber",
        "action": "Use 1 to 34 characters",
        "pattern": "^.{1,34}$"
      }
    ]
  }
}
{
  "responseCode": "4030014",
  "responseMessage": "Insufficient Funds",
  "additionalInfo": {
    "code": "INSUFFICIENT_BALANCE",
    "required": {
      "value": "160015000.00",
      "currency": "IDR"
    },
    "available": {
      "value": "100000000.00",
      "currency": "IDR"
    }
  }
}
{
  "responseCode": "4030015",
  "responseMessage": "Transaction Not Permitted",
  "additionalInfo": {
    "code": "REQUIREMENTS_UNMET",
    "missingFields": [
      {
        "resource": "beneficiary",
        "field": "address.country"
      },
      {
        "resource": "payment_account",
        "field": "accountDetails.bankCode"
      }
    ]
  }
}
{
  "responseCode": "4030006",
  "responseMessage": "Feature Not Allowed At This Time",
  "additionalInfo": {
    "code": "QUOTE_TEMPORARILY_UNAVAILABLE",
    "retriable": true
  }
}

The first example is the response when you create a payment account and two fields fail.

Retries, timeouts and 5xx errors

Errors on every endpoint

The common errors in the Response Code List below can apply to every endpoint. If a parameter or a field of the request body breaks its documented rule, the API can also return FIELD_MISSING (4000002) or FIELD_INVALID (4000001).

If you send a corridor that is not in the corridor list, the API returns CORRIDOR_UNAVAILABLE (4030024). These APIs check the corridor:

Response Code List

Common errors

These rows can apply to any endpoint. A row for the token request applies only to the token request. The FEATURE_NOT_ENABLED row applies only to Global Payout endpoints. The rows without additionalInfo.code have one of these causes: a SNAP authentication error, a body that is not a valid JSON object, an unknown path, a wrong HTTP method, or an HTTP 5xx error.

responseCodeadditionalInfo.codeMeaning and extra fieldsYour next step
4000002FIELD_MISSING, in each additionalInfo.errors itemA required field is missing. Includes field and action.Add the field, then send the call again.
4000001FIELD_INVALID, in each additionalInfo.errors itemA field has a wrong format, a wrong JSON type or an unsupported value, or it breaks a field rule. Includes field, action and an optional pattern. If the same request also has a missing field, responseCode is 4000002.Correct the field, then send the call again.
4000002—A required SNAP header is missing.Add the header. See Authentication.
4000000—The request body is not valid JSON, or it is not a JSON object. The response can have no additionalInfo.Send a JSON object as the request body.
4040000—The path is unknown. The response has no additionalInfo.Check the URL against the API Reference.
4050000—The path does not support the HTTP method. The response has no additionalInfo.Check the HTTP method against the API Reference.
4010000—The X-SIGNATURE is wrong, or the client key in X-PARTNER-ID is unknown. For the token request, also: a header is missing, or X-TIMESTAMP is not RFC 3339.Use the client key from the Durianpay dashboard for this environment, and check the string that you signed. For the token request, also check the headers and the X-TIMESTAMP format. See Authentication.
4010001—The access token is wrong or expired, or it does not match the client key.Get a new access token with the client key that you send in X-PARTNER-ID, then send the call again. See Authentication.
4030018—The merchant account is inactive. This response has no additionalInfo.code.Contact Durianpay support.
4030005—The merchant account is suspended.Contact Durianpay support.
4007300—Token request: the request body is not valid JSON, or grantType is empty.Correct the request body of the token request. See Authentication.
5000000, 5000001—An unexpected error.When you create a payout, follow Recover a Lost Response. For other calls, see Handling Errors.
5040000—A timeout.When you create a payout, follow Recover a Lost Response. For other calls, see Handling Errors.
4030001FEATURE_NOT_ENABLEDThe Global Payout API is disabled for the merchant account.Contact Durianpay support to enable the Global Payout API for your merchant account.
4040001RESOURCE_NOT_FOUNDAn unknown resource, or a resource of another merchant account. Also an unknown enum type, or an unknown upload token in an uploadUrl.Check the referenceNo, the partnerReferenceNo or the enum type that you sent. When you follow Recover a Lost Response, this result means that you must send the original create request again.

Errors for a wrong status or a repeated request

responseCodeadditionalInfo.codeMeaning and extra fieldsYour next step
4090001PARTNER_REFERENCE_NO_CONFLICTYou sent a partnerReferenceNo again with a different request body, or the partnerReferenceNo belongs to a rejected or inactive beneficiary or customer. For a payout, includes the original payoutReferenceNo. For a customer, includes the customerReferenceNo. For a beneficiary, includes the beneficiaryReferenceNo. For a document, includes the documentReferenceNo.Call the Fetch API of the resource with the returned reference: Fetch Payout by ID API with payoutReferenceNo, Fetch Customer by ID API with customerReferenceNo, or Fetch Beneficiary by ID API with beneficiaryReferenceNo. To create another resource, use a new partnerReferenceNo.
4090000PAYMENT_ACCOUNT_EXISTSThe account is already registered with other details. Includes paymentAccountReferenceNo.Call the Fetch Payment Account by ID API with the returned paymentAccountReferenceNo. To change its details, update it with Update Payment Account API.
4090002DOCUMENT_ALREADY_USEDAnother payout uses a document that you sent in documents. Includes documentReferenceNo. Durianpay did not create the payout and did not attach the document.Upload a new document for this payout with Upload Document API, then send its referenceNo in documents.
4040020CANCEL_NOT_ALLOWEDDurianpay already sent the payout, or the status of the payout is completed, refunded, or failed for another cause. A repeated cancel of a payout that you cancelled returns the payout instead. The cancel action is coming soon.Follow the current status of the payout.
4040021RECEIPT_NOT_AVAILABLEThe payout is not completed.Call the Fetch Payout by ID API. Only a completed payout has a receipt.
4050001ACTION_NOT_ALLOWEDThe action is not expected or not allowed in the current status of the resource. See the examples below.Call the Fetch API of the resource (for example Fetch Payout by ID API) and follow its current status. For a refused deactivation (DELETE), see below.

For example, the API returns ACTION_NOT_ALLOWED in these cases:

  • You create a payment account for a beneficiary that is rejected or inactive.
  • You update a resource that is rejected or inactive.
  • You force a sandbox status change that is not allowed.
  • You upload a file with an uploadUrl that expired or that you already used. See Upload Document API.
  • You deactivate a resource (DELETE), and Durianpay refuses the deactivation.

ACTION_NOT_ALLOWED on a deactivation (DELETE):

ResourceWhen Durianpay refuses the deactivationYour next step
Payment accountA payout that uses the account is not yet completed, failed or refunded.Wait until the status of each of these payouts is completed, failed or refunded. Then call Deactivate Payment Account API again.
CustomerOne of its payouts is not yet completed, failed or refunded.Wait until the status of each of these payouts is completed, failed or refunded. Then call Deactivate Customer API again.
CustomerThe customer is rejected or inactive.Do not send it again.
BeneficiaryOnly when the beneficiary is rejected or inactive.Do not send it again.

When the status of a payout is completed, failed or refunded, the payout needs nothing more from you. Durianpay takes no more money for it.

Errors for other rules

responseCodeadditionalInfo.codeMeaning and extra fieldsYour next step
4030028CUSTOMER_NOT_ACTIVEThe customer cannot be used for a new payout.Call the Fetch Customer by ID API. A payout can use only an active customer.
4030025CUSTOMER_NOT_ALLOWEDIn a setup without customers, the call registers or updates a customer, or sends a customer in a payout.Do not register or update a customer, and do not send a customer in a payout.
4030029BENEFICIARY_NOT_ACTIVEThe beneficiary of the payment account cannot receive a new payout.Call the Fetch Beneficiary by ID API. Only an active beneficiary can receive a payout.
4030030PAYMENT_ACCOUNT_INACTIVEThe payment account is inactive.Use another payment account.
4030015REQUIREMENTS_UNMETWhen you create a payout, fields of the beneficiary, the payment account or the customer, or supporting documents, that the corridor requires are missing. Includes missingFields and missingDocuments.Update each resource that missingFields lists with its Update API. Upload each document, and send its referenceNo in documents. Then send the create request again.
4030000QUOTE_EXPIREDThe quote that you sent to create the payout passed its expiresAt.Create a new quote.
4090003QUOTE_ALREADY_USEDAnother payout used the quote.Create a new quote.
4030014INSUFFICIENT_BALANCEThe balance cannot cover the new payout. Includes required and available.Add funds until available covers required. Then send the call again.
4040013AMOUNT_BELOW_MINIMUMThe destination amount is below the minimum of the payout rail for the beneficiary type. See List Corridors API.Send an amount within the limits.
4030002AMOUNT_ABOVE_MAXIMUMThe destination amount is above the maximum of the payout rail for the beneficiary type. See List Corridors API.Send an amount within the limits.
4030024CORRIDOR_UNAVAILABLEThe corridor is not in the corridor list.Use a corridor from the corridor list.
4040018QUOTE_RAIL_MISMATCHThe payout rail of the payment account differs from the quote.Use a payment account that matches the quote, or create a new quote. The refused request did not use the quote.
4040022QUOTE_BENEFICIARY_TYPE_MISMATCHThe beneficiary type differs from the quote.Use a payment account whose beneficiary matches the quote, or create a new quote. The refused request did not use the quote.
4040023QUOTE_DESTINATION_MISMATCHThe country or currency of the account differs from the destination of the quote.Use a payment account that matches the quote, or create a new quote. The refused request did not use the quote.
4050002USE_CASE_NOT_SUPPORTEDThe payout rail does not support the selected use case. The use case is b2b, b2c, c2b or c2c. The first letter is the sender: b for your business or a business customer, c for an individual customer. The second letter is the beneficiary type: b for business, c for individual. In the Fetch Corridor Requirements API, the use case comes from the beneficiary type and the customer type.Use a beneficiary type that the payout rail lists in beneficiaryTypes.
4030006QUOTE_TEMPORARILY_UNAVAILABLEDurianpay cannot price the quote now, for example because no rate is available. Includes retriable: true.Send the call again later.
4030026RATE_UNAVAILABLEIn the Fetch Indicative Rates API, you sent destinationCurrency, and Durianpay cannot give a rate for it now. The error has no retriable field.Call the API without destinationCurrency to see the currencies that have a rate now. Then use one of these currencies. You can also call again later.
4030027PAYOUT_TEMPORARILY_UNAVAILABLEWhen you create a payout, Durianpay cannot accept the payout now. Includes retriable: true. Durianpay did not create the payout and did not use the quote.Send the create request again later. Use the same quote before its expiresAt, or create a new quote.

Payout Failure Codes

A failed payout has a failure object:

{
  "code": "INVALID_BENEFICIARY_DETAILS"
}

failed is final. If Durianpay debited your balance, Durianpay returns the debit to your available balance when the status changes. To check that the debit came back, read your IDR balance. See Preparation. For the steps to create a new payout, see To create a new payout below the table.

sequenceDiagram
    autonumber
    participant M as Merchant server
    participant API as Global Payout API
    participant WH as Merchant webhook endpoint
    alt The payout fails after the debit
        API->>WH: global.payout.updated, status failed
        Note over API: Durianpay returns the debit to your available balance at the status change
    else The funds come back after payment
        API->>WH: global.payout.updated, status refunded, with refundAmount
    end
    Note over M: Check your balance. Correct the cause, then create a new quote and a new payout with a new partnerReferenceNo.

The failure codes are in three groups. Each group has one type of next step.

The receiving bank rejected the payout. Correct the cause.

CodeMeaningYour next step
INVALID_BENEFICIARY_DETAILSThe receiving bank rejected the account or identifier.Correct the payment account with Update Payment Account API, or use another payment account.
NAME_MISMATCHThe receiving bank rejected the holder name.Correct accountDetails.accountHolderName with Update Payment Account API.
ACCOUNT_CLOSEDThe account is closed.Use another payment account.
ACCOUNT_BLOCKEDThe account is frozen or restricted.Use another payment account, or ask the beneficiary to contact its bank.
ACCOUNT_NOT_ELIGIBLEThe account cannot receive cross-border payouts.Use an account that can receive cross-border payouts.
LIMIT_EXCEEDEDThe receiving bank rejected the payout because of a value or count limit on the beneficiary or the account.Create a new payout with a lower amount, or create it later.
BANK_REJECTED_OTHERAnother rejection by the receiving bank.Check the details with the beneficiary.

Contact Durianpay support.

CodeMeaningYour next step
COMPLIANCE_REJECTEDThe payout did not pass a compliance check after Durianpay sent it.Contact Durianpay support.
PURPOSE_NOT_ACCEPTEDThe receiving bank does not accept the purpose of the payout.Check that the purpose code is the real purpose. Contact Durianpay support.

Create a new payout.

CodeMeaningYour next step
REJECTEDThe payout was rejected after Durianpay sent it.Create a new payout with the steps in To create a new payout.
PROCESSING_ERRORDurianpay could not complete the payout because of a technical failure, or because the FX window ended after the debit. If Durianpay debited your balance, Durianpay returns the debit to your available balance. See the deadlines on Payout Object.Create a new payout with the steps in To create a new payout.
BALANCE_CUT_OFFThe balance cut-off (a daily window in which Durianpay refuses debits) refused the debit. No money moved.Create a new payout with the steps in To create a new payout. See the balance cut-off on Payout Object.
INSUFFICIENT_BALANCEYour balance did not cover the debit. No money moved.Add funds. Then create a new payout with the steps in To create a new payout.
QUOTE_EXPIREDThe FX window (the period until the expiresAt of the payout's quote) ended before the debit, and the payout became failed. No money moved.Create a new quote and a new payout. See the deadlines on Payout Object.
CANCELLEDComing soon. You cancelled the payout with the cancel action.Create a new quote and a new payout with a new partnerReferenceNo.
CORRIDOR_SUSPENDEDDurianpay removed the corridor from the corridor list while the payout was processing, before Durianpay sent the payout.When the corridor is in the corridor list again, create a new quote.

Durianpay can add failure codes. If your client does not know a failure.code, the payout is failed and final. Do not create a new payout automatically. Contact Durianpay support.

📘

Same name, different meaning

INSUFFICIENT_BALANCE and QUOTE_EXPIRED are also response error codes. When the code is an error code in a response, Durianpay refused the call, and no balance change occurred. When the code is a failure code in failure.code, the payout exists, and its status is failed.
REJECTED is a payout failure code. rejected is a status of a beneficiary or a customer. They are different fields.

To create a new payout

  1. If there is a cause that you can correct, correct it. The table above gives the next step for each failure code.
  2. Create a new quote.
  3. Create a new payout with a new partnerReferenceNo. Your available balance must cover the new payout.
  4. If the failed payout had supporting documents, upload each file again as a new document, with a new partnerReferenceNo. A document that a payout used cannot be used again.
🚧

Do not send the same create request again

With the same partnerReferenceNo and the same request body, the API returns the failed payout again, with additionalInfo.replayed: true. It does not create a new payout.

For a timeout, or when you do not know the result of a create request, see Recover a Lost Response.