Cancel Order
POST/payment-gateway/v1.0/debit/cancel.htm
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.
API Type
SNAP API
Expected Timeout
8 second
SNAP Service Code
57
Accept
application/json
Content Type
application/json
Content-Type
string
1 - 127 charactersRequiredContent type, value always
application/jsonX-TIMESTAMP
string
25 charactersRequiredTransaction date time, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
X-SIGNATURE
string
RequiredSignature need to be generated with
asymmetricSignature methodORIGIN
string
Origin domain
X-PARTNER-ID
string
1 - 36 charactersRequiredUnique identifier for partner was generated by DANA, or known as clientId
X-EXTERNAL-ID
string
1 - 36 charactersRequiredUnique messaging reference identifier generated by merchant and should be unique within the same day
CHANNEL-ID
string
1 - 5 charactersRequiredDevice identification on which the API services is currently being accessed by the end user (customer)
originalPartnerReferenceNo
string
1 - 64 charactersRequiredOriginal transaction identifier on partner system
originalReferenceNo
string
1 - 64 charactersOriginal transaction identifier on DANA system
originalExternalId
string
1 - 36 charactersOriginal external identifier on header message
merchantId
string
1 - 64 charactersRequiredMerchant identifier that is unique per each merchant
subMerchantId
string
1 - 32 charactersSub merchant identifier, known as externalDivisionId must be registered in the DANA system before use. To register a new externalDivisionId, use the Create Division API
reason
string
1 - 256 charactersCancellation reason
externalStoreId
string
1 - 64 charactersStore identifier to indicate to which store this payment belongs to, known as externalShopId must be registered in the DANA system before use. To register a new externalShopId, use the Create Shop API
amount
money
Amount. Contains two sub-fields:
1. Value: Transaction amount, including the cents
2. Currency: Currency code based on ISO
1. Value: Transaction amount, including the cents
2. Currency: Currency code based on ISO
value
string
1 - 19 charactersRequiredValue of amount. Following ISO-4217, for IDR the value includes 2 decimal digits separated with point e.g. ,IDR 10.000,- will be placed with 10000.00
currency
string
1 - 3 charactersRequiredCurrency
additionalInfo
json object
Additional information
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: 85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5
ORIGIN: www.hostname.com
X-PARTNER-ID: 82150823919040624621823174737537
X-EXTERNAL-ID: 41807553358950093184162180797837
CHANNEL-ID: 95221
{
"originalPartnerReferenceNo": "2020102900000000000001",
"originalReferenceNo": "2020102977770000000009",
"originalExternalId": "30443786930722726463280097920912",
"merchantId": "23489182303312",
"subMerchantId": "23489182303312",
"reason": "Network timeout",
"externalStoreId": "124928924949487",
"amount": {
"value": "10000.00",
"currency": "IDR"
},
"additionalInfo": {}
}
Content-Type
string
1 - 127 charactersRequiredContent type, value always `application/json`
X-TIMESTAMP
string
25 charactersRequiredTransaction date time, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
responseCode
string
7 charactersRequiredRefer to response code list
responseMessage
string
1 - 150 charactersRequiredRefer to response code list
originalReferenceNo
string
1 - 64 charactersConditionalOriginal transaction identifier on DANA system
Conditional Info
Y:= Successfully processed
originalPartnerReferenceNo
string
1 - 64 charactersRequiredOriginal transaction identifier on partner system
originalExternalId
string
1 - 36 charactersOriginal external identifier on header message
cancelTime
string
25 charactersConditionalCancellation date time, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
Conditional Info
Y:= Successfully processed
transactionDate
string
25 charactersTransaction date, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
additionalInfo
json object
Additional information
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) |
|