API Reference

Response Code Handling

Response Definition

Format

SNAP API has its own standardized Response Code and Response Message for each of endpoint. In general, the response code will consist of 7 digits with HTTP code, Service Code, and Case Code scheme.

When doing request of balance query to https://api.durianpay.id/v1.0/balance-inquiry with the same X-External-ID twice, merchant will receive error with code 4091100 where:

  • 409 is HTTP code for Conflict
  • 11 is service code for balance inquiry, and
  • 00 together with 409 HTTP code indicates same X-External-ID or partnerReferenceNo is being used twice.
    Reference

HTTP code used is following the standard defined by RFC 9110

Service Code

Service Code is the code that indicates which service being requested depending of its relative path. For example, B2B Access Token generation has a service code of 73, Balance Inquiry has a service code of 11, etc. Please refer to the table below for list of services implemented by Durianpay.

Table of Service Code

Service NameService CodeRelative Path
Access Token (B2B)73/v1.0/access-token/b2b
Balance Inquiry11/v1.0/balance-inquiry
Bank Account Inquiry16/v1.0/account-inquiry-external
Bank Transfer18/v1.0/transfer-interbank
Bank Transfer Status Inquiry36/v1.0/transfer/status
E-Wallet Account Inquiry37/v1.0/emoney/account-inquiry
E-Wallet Transfer38/v1.0/emoney/topup
E-Wallet Transfer Inquiry Status39/v1.0/emoney/topup-status

Response Code List

In general, there are two types of response to a request in SNAP, Successful and Failed. Successful response is indicated with HTTP code of 2xx while 4xx and 5xx indicates error (from client side or server/Durianpay side).

Please refer to table below for list of Response Code, Response Message, and its meaning.

Successful Response

HTTP CodeService CodeCase CodeResponse MessageDescription
200any00SuccessfulSuccessfully received in Durianpay's side (does not mean sent to beneficiary successfully)
202any00Request In ProgressTransaction is still processing

Error Response

HTTP CodeService CodeCase CodeResponse MessageDescription
400any00Bad RequestGeneral request failed error, including message parsing failed.
400any01Invalid Field Format {field name}Invalid format
400any02Invalid Mandatory Field {field name}Missing or invalid format on mandatory field
401any00Unauthorized [reason]General unauthorized error (No Interface Def, API is Invalid, Oauth Failed, Verify Client Secret Fail, Client Forbidden Access API, Unknown Client, Key not Found, Invalid Signature)
401any01Invalid Token (B2B)Token found in request is invalid (Access Token Not Exist, Access Token Expiry)
401any03Token Not Found (B2B)Token not found in the system. This occurs on any API that requires token as input parameter
403any00Transaction ExpiredTransaction expired
403any18Inactive Card/Account/CustomerIndicates inactive account
404any01Transaction Not FoundTransaction not found
404any11Invalid Card/Account/Customer [info]/Virtual AccountCard information may be invalid, or the card account may be blacklisted, or Virtual Account number may be invalid.
409any00ConflictCannot use same X-EXTERNAL-ID in same day
409any01Duplicate partnerReferenceNoTransaction has previously been processed indicates the same partnerReferenceNo already created
500any00General ErrorGeneral Error
500any01Internal Server ErrorUnknown Internal Server Failure, Please inquiry the status or retry the process again
504any00TimeoutTimeout from the issue

Handling Guideline for Response Code

SNAP transfer APIs (Bank Transfer & E-Wallet Transfer) responses

HTTP CodeHandling
2XXKeep status as "processing" and update to success/failed based on callback/check status
4XXMark transaction as "failed"
5XXKeep status as "processing" and update to success/failed based on callback/check status
Unexpected response / TimeoutKeep status as "processing" and update to success/failed based on callback/check status

SNAP Inquiry Status API (Bank Transfer & E-Wallet Transfer) responses

HTTP CodeHandling
2XXUpdate the status according to the latestTransactionStatus/ transactionStatusDesc parameters in the response body
4XXRetry inquiry status / raise to Durianpay
5XXRetry inquiry status / raise to Durianpay
Unexpected response / TimeoutRetry inquiry status / raise to Durianpay

SNAP Inquiry Status API: 2XX status handling

latestTransactionStatustransactionStatusDescDescription
00doneThe transaction is successfully completed
06failedThe transaction is failed
03processingThe transaction is being processed