Skip to main content

Cancel Payment

POST/v1.0/emoney/otc-cancel.htm

This API used to cancel cashout if merchant didn’t receive final result from DANA

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

Content-type
string
1 - 127 charactersRequired
Content type, value always application/json
Authorization
string
1 - 2048 charactersConditional
Contains bearer JWT token, which has been obtained from Authorization Token Request API
Conditional Info
Y:= Signature option is symmetric approach
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 symmetricSignature or 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 charactersConditional
Original transaction identifier on DANA system
Conditional Info
Y:= Already received from previous API invocation
originalExternalId
string
1 - 36 characters
Original external identifier on header message
customerNumber
string
1 - 32 charactersRequired
Customer account number
reason
string
1 - 512 charactersRequired
Reason cancellation
additionalInfo
json object
Additional information
additionalInfo.amount
money
Required
Additional information of 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
POST .../v1.0/emoney/otc-cancel.htm HTTP/1.2
Content-type: application/json
Authorization: Bearer gp9HjjEj813Y9JGoqwOeOPWbnt4CUpvIJbU1mMU4a11MNDZ7Sg5u9a
X-TIMESTAMP: 2021-12-03T10:37:11+07:00
X-SIGNATURE: 85be817c55b2c135157c7e89f52499bf0c25ad6eeebe04a986e8c862561b19a5
ORIGIN: www.hostname.com
X-PARTNER-ID: 82150823919040624621823174737537
X-EXTERNAL-ID: 41807553358950093184162180797837
CHANNEL-ID: 95221
{
"originalPartnerReferenceNo": "14054Q0727520211128121824995",
"originalReferenceNo": "2021112810121482030100166514528830697",
"originalExternalId": "30443786930722726463280097920912",
"customerNumber": "081234567890",
"reason": "Abnormal system result",
"additionalInfo": {
"amount": {
"currency": "IDR",
"value": "50000.00"
}
}
}

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:= Cancellation 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: 2021-12-03T10:37:12+07:00
{
"responseCode": "2004600",
"responseMessage": "Successful",
"originalReferenceNo": "2021112810121482030100166514528830697",
"originalPartnerReferenceNo": "14054Q0727520211128121824995",
"originalExternalId": "30443786930722726463280097920912",
"cancelTime": "2021-12-03T10:37:12+07:00",
"transactionDate": "2021-12-03T10:20:12+07:00",
"additionalInfo": {
}
}

ResponseCauseSolution
2004600Successful
Success to be processed
Mark Cancel Payment process as Success (reversal successful) & hold the money
4004600Bad Request
General request failed error
Mark Cancel Payment process as Failed. Retry request with proper parameter
4004601Invalid Field Format
Invalid format for certain field
Mark Cancel Payment process as Failed. Retry request with proper parameter
4004602Invalid Mandatory Field
Missing or invalid format on mandatory field
Mark Cancel Payment process as Failed. Retry request with proper parameter
4014600Unauthorized. [reason]
General unauthorized error
Mark Cancel Payment process as Failed. Retry request with proper parameter
4014601Invalid Token (B2B)
Authorization token are invalid, perhaps due to token expiry for B2B
Mark Cancel Payment process as Failed. Retry request with proper parameter
4044600Invalid Transaction Status
Invalid transaction status
Mark Cancel Payment process as Failed and hold the money
4044601Transaction Not Found
Transaction is not found
Mark Cancel Payment process as Failed and hold the money
4044618Inconsistent Request
Inconsistent request parameter found for the same partner reference number/transaction identifier
Mark Cancel Payment process as Failed and hold the money
4294600Too Many Requests
Maximum transaction limit exceeded
Mark Cancel Payment process as Pending. Hold the money and retry request periodically
5004600General Error
General error non retry-able
Mark Cancel Payment process as Failed and hold the money
5004601Internal Server Error
Unknown internal server failure, please retry the process again
Mark Cancel Payment process as Pending. Hold the money and retry request periodically
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 still fails mark Cancel Payment process as Pending and hold the money
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 Payment process as Pending and hold the money
  • If empty field/field does not exist, mark Cancel Payment process as Pending and hold the money
    ask AIAI Assistant
    Need help with our documentation?
    Start from our frequently asked questions or feel free to ask anything else.

    AI generated responses may contain mistakes.