Cancel Order
This is the API used to cancel the order from merchant's platform to DANA. For the easiest integration, use DANA's Libraries to implement Custom Checkout or Hosted Checkout.
application/jsonasymmetricSignature methodIn the sandbox, you can find this value in the External Division ID section at https://dashboard.dana.id/sandbox/submerchants
In the sandbox, you can find this value in the External Shop ID section at https://dashboard.dana.id/sandbox/submerchants
1. Value: Transaction amount, including the cents
2. Currency: Currency code based on ISO
Check yours here: https://dashboard.dana.id/sandbox/submerchants
If you're an aggregator: subMerchantId is mandatory subMerchantId is equal to externalDivisionId, obtained from the Create Division API or DANA Sandbox Dashboard.
If you use QRIS or have outlets/stores under you: externalStoreId is mandatory
externalStoreId can be obtained from the Create Shop API or DANA Sandbox Dashboard.
POST .../payment-gateway/v1.0/debit/cancel.htm HTTP/1.2
Content-type: application/json
X-TIMESTAMP: 2020-12-23T07:44:11+07:00
X-SIGNATURE: to fill...
X-PARTNER-ID: 82150823919040624621823174737537
X-EXTERNAL-ID: 41807553358950093184162180797837
CHANNEL-ID: 95221
{
"originalPartnerReferenceNo": "2020102900000000000001",
"merchantId": "23489182303312"
}
Content-type: application/json
X-TIMESTAMP: 2020-12-23T07:44:16+07:00
{
"responseCode": "2005700",
"responseMessage": "Successful",
"originalPartnerReferenceNo": "2020102900000000000001",
"originalReferenceNo": "2020102977770000000009",
"originalExternalId": "30443786930722726463280097920912",
"cancelTime": "2020-12-21T17:07:25+07:00",
"transactionDate": "2020-12-21T17:55:11+07:00",
"additionalInfo": {}
}
| Response | Cause | Solution |
|---|---|---|
2005700Successful | Success to be processed | Mark Cancel Order process as Success |
2025700Request In Progress | Cancel is on process | Mark Cancel Order process as Pending. Retry request periodically by sending same request payload |
4005700Bad Request | General request failed error | Mark Cancel Order process as Failed. Retry request with proper parameter |
4005701Invalid Field Format | Invalid format for certain field | Mark Cancel Order process as Failed. Retry request with proper parameter |
4005702Invalid Mandatory Field | Missing or invalid format on mandatory field | Mark Cancel Order process as Failed. Retry request with proper parameter |
4015700Unauthorized. [reason] | General unauthorized error | Mark Cancel Order process as Failed. Retry request with proper parameter |
4035700Transaction Expired | Transaction cannot be cancelled because cancel time is already expired | Mark Cancel Order process as Failed. Inform to user that order cancel cannot be processed |
4035705Do Not Honor | Account or user status is abnormal | Mark Cancel Order process as Failed. Retry request with proper parameter or can contact to DANA check the user/account status |
4035714Insufficient Funds | Insufficient funds of merchant’s account to cancel the order | Mark Cancel Order process as Failed. Retry request periodically |
4035715Transaction Not Permitted.[reason] | Transaction not permitted | Mark Cancel Order process as Failed. Retry request periodically or contact DANA to consult |
4045700Invalid Transaction Status | Invalid transaction status | Mark Cancel Order process as Failed. Retry request periodically or contact DANA to consult |
4045701Transaction Not Found | Transaction not found | Mark Cancel Order process as Failed. Retry request with proper parameter |
4045708Invalid Merchant | Merchant does not exist or status abnormal | Mark Cancel Order process as Failed. Retry request with proper parameter |
4295700Too Many Requests | Maximum transaction limit exceeded | Mark Cancel Order process as Pending. Retry request periodically by sending same request payload |
5005700General Error | General error non retry-able | Mark Cancel Order process as Failed. Retry request periodically |
5005701Internal Server Error | Unknown internal server failure, please retry the process again | Mark Cancel Order process as Pending. Retry request periodically by sending same request payload |
Total Timeout | Total timeout, the client side does not get any responses from the server side (can be due to network issue, server slowing down, and so on) | Do a retry maximum 3 attempts, if the result is still the same then action is aborted. Show appropriate error message to users |
Unexpected response (Empty field/field does not exist/undefined response code) | The server does not produce expected responses (can be due to hardware failure, bugs, and so on) |
|