Skip to main content

Cancel Order

POST/v1.0/debit/cancel.htm

This is the API used to cancel the order from merchant’s platform to DANA

API Type
SNAP API
Expected Timeout
8 second
SNAP Service Code
57
Accept
application/json
Content Type
application/json

Content-Type
string
1 - 127 charactersRequired
Content type, value always application/json
X-TIMESTAMP
string
25 charactersRequired
Transaction date time, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
X-SIGNATURE
string
Required
Signature need to be generated with asymmetricSignature method
ORIGIN
string
Origin domain
X-PARTNER-ID
string
1 - 36 charactersRequired
Unique identifier for partner was generated by DANA, or known as clientId
X-EXTERNAL-ID
string
1 - 36 charactersRequired
Unique messaging reference identifier generated by merchant and should be unique within the same day
CHANNEL-ID
string
1 - 5 charactersRequired
Device identification on which the API services is currently being accessed by the end user (customer)

originalPartnerReferenceNo
string
1 - 64 charactersRequired
Original transaction identifier on partner system
originalReferenceNo
string
1 - 64 characters
Original transaction identifier on DANA system
originalExternalId
string
1 - 36 characters
Original external identifier on header message
merchantId
string
1 - 64 charactersRequired
Merchant identifier that is unique per each merchant
subMerchantId
string
1 - 32 characters
Information of sub merchant identifier
reason
string
1 - 256 characters
Cancellation reason
externalStoreId
string
1 - 64 characters
Store identifier to indicate to which store this payment belongs to
amount
money
Amount. Contains two sub-fields:
1. Value: Transaction amount, including the cents
2. Currency: Currency code based on ISO
value
string
1 - 19 charactersRequired
Value 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 charactersRequired
Currency
additionalInfo
json object
Additional information
POST .../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 charactersRequired
Content type, value always `application/json`
X-TIMESTAMP
string
25 charactersRequired
Transaction date time, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)

responseCode
string
7 charactersRequired
Refer to response code list
responseMessage
string
1 - 150 charactersRequired
Refer to response code list
originalReferenceNo
string
1 - 64 charactersConditional
Original transaction identifier on DANA system
Conditional Info
Y:= Successfully processed
originalPartnerReferenceNo
string
1 - 64 charactersRequired
Original transaction identifier on partner system
originalExternalId
string
1 - 36 characters
Original external identifier on header message
cancelTime
string
25 charactersConditional
Cancellation 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 characters
Transaction 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": {}
}

ResponseCauseSolution
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
4015701Invalid Token (B2B)
Authorization token are invalid, perhaps due to token expiry for B2B
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)
  • If the response code prefix are 202 and 5XX, mark Cancel Order process as Pending.
  • If empty field/field does not exist, mark Cancel Order process as Pending.