Skip to main content

Refund

Requirements

Before start integration, you must have retrieved credentials from Acquirer.

If you don't have the credentials yet, we can help to facilitate you to get one. Here is the flow to get credentials:

Direct API - Direct Debit CIMB SNAP Payment
 Direct API - CIMB Payment

Direct Debit Refund

TypeValueDescription
HTTP MethodPOST
API endpoint (Sandbox)https://api-sandbox.doku.com/direct-debit/[acquirer-name]/v1.0/debit/refundPossible Values for [acquirer-name] : ovo, cimb, allobank, bri
API endpoint (Production)https://api.doku.com/direct-debit/[acquirer-name]/v1.0/debit/refundPossible Values for [acquirer-name] : ovo, cimb, allobank, bri

Here is the sample of request header to perform Refund :

X-PARTNER-ID: MCH-0001-10791114622547
X-EXTERNAL-ID: 1684987418452706687
X-TIMESTAMP: 2023-01-27T15:58:59+07:00
X-IP-ADDRESS: 192.168.23.23
X-DEVICE-ID: 912f12e223624d2e94828b1681992be3
X-SIGNATURE: hMac123234nsjkdfhajnkssfhgjklsfsdfdfgdfgdfg124dfgfgh

Request Header Explanation
ParameterDescription
X-PARTNER-IDUnique ID for a partner (DOKU'S Client ID)
X-EXTERNAL-IDNumeric String. Reference number that should be unique in the same day (request-id)
X-TIMESTAMPClient's current local time in yyyy-MM- ddTHH:mm:ssTZD format
X-IP-ADDRESSIP address of the end user (customer) using IPv4 format. Notes: Mandatory for Allobank (Min:10, Max:15), Optional for rest of acquirer
X-SIGNATUREalgoritma symmetric signature HMAC_SHA512 (clientSecret, stringToSign) dengan formula stringToSign = HTTPMethod +โ€:โ€œ+ EndpointUrl +":"+ AccessToken +":โ€œ+ Lowercase(HexEncode(SHA-256(minify(RequestBody))))+ ":โ€œ + TimeStamp

Here is the sample of request body for Refund Process :

{
"originalPartnerReferenceNo": "REFUND-TESTING-STG-P2M-1224",
"originalExternalId": "10052019",
"partnerRefundNo": "239850918204981205970",
"refundAmount": {
"value": "10000.00",
"currency": "IDR"
},
"reason": "Customer complain",
"additionalInfo": {
"bankCardToken": "123412341234"
}
}
Refund API Explanation
ParameterTypeMandatoryDescription
originalPartnerReferenceNostring (64)MandatoryTransaction identifier on service consumer system, will be used as invoice number. For CIMB, Max length : 12
originalExternalIdstring OptionalOriginal customer reference number
partnerRefundNostring (64)MandatoryUnique refund identifier on service consumer system
refundAmountobjectMandatory
refundAmount.valueobjectMandatoryTotal amount ends in decimal .00 if currency is IDR
refundAmount.currencystring (3)MandatoryIDR
reasonstring (256)Optional
additionalInfoobjectOptional
additionalInfo.bankCardTokenstringMandatoryCustomer's token that are used to process original transaction

API Response

After hitting the above API request, DOKU will give the response.

TypeValue
HTTP Status201
ResultCREATED

Here is the sample response header:

X-PARTNER-ID: MCH-0001-10791114622547
X-EXTERNAL-ID: 1684987418452706687
X-TIMESTAMP: 2023-01-27T15:58:59+07:00
X-IP-ADDRESS: 192.168.23.23
X-DEVICE-ID: 912f12e223624d2e94828b1681992be3
X-SIGNATURE: hMac123234nsjkdfhajnkssfhgjklsfsdfdfgdfgdfg124dfgfgh

Response Header Explanation
ParameterDescription
X-PARTNER-IDUnique ID for a partner (DOKU'S Client ID)
X-EXTERNAL-IDNumeric String. Reference number that should be unique in the same day (request-id)
X-TIMESTAMPClient's current local time in yyyy-MM- ddTHH:mm:ssTZD format
X-IP-ADDRESSIP address of the end user (customer) using IPv4 format. Notes: Mandatory for Allobank (Min:10, Max:15), Optional for rest of acquirer
X-SIGNATUREalgoritma symmetric signature HMAC_SHA512 (clientSecret, stringToSign) dengan formula stringToSign = HTTPMethod +โ€:โ€œ+ EndpointUrl +":"+ AccessToken +":โ€œ+ Lowercase(HexEncode(SHA-256(minify(RequestBody))))+ ":โ€œ + TimeStamp

Here is the sample of response body:

1. OVO

{
"responseCode": "2005800",
"responseMessage": "Request has been processed successfully",
"originalPartnerReferenceNo": "REFUND-TESTING-STG-P2M-1224",
"originalReferenceNo": "TESTING-STG-P2M-1224",
"refundNo": "REF993883",
"partnerRefundNo": "239850918204981205970",
"refundAmount": {
"value": "10000.00",
"currency": "IDR"
},
"refundTime": "2020-12-21T17:21:41+07:00"
}
OVO Refund Explanation
ParameterTypeMandatoryDescription
responseCodestring (7)MandatoryResponse code as defined in SNAP Regulation
responseMessagestring (128)MandatoryResponse message as defined in SNAP Regulation
originalPartnerReferenceNostring (64)OptionalOriginal Transaction identifier on service consumer system
originalReferenceNostring (2048)OptionalOriginal Transaction identifier on service consumer system
refundNostring (64)Optional
refundAmountobjectOptional
refundAmount.valuenumeric (16,2)MandatoryURL to redirect user to Acquirer's webview to let customer finish OTP
refundAmount.currencystring (3)MandatoryIDR
refundTimestring (25)MandatoryRefund Time, ISO 8601

2. Allo Bank

{
"responseCode": "2005800",
"responseMessage": "Request has been processed successfully",
"originalPartnerReferenceNo": "REFUND-TESTING-STG-P2M-1224",
"originalReferenceNo": "TESTING-STG-P2M-1224",
"refundNo": "REF993883",
"partnerRefundNo": "239850918204981205970",
"refundAmount": {
"value": "10000.00",
"currency": "IDR"
},
"refundTime": "2020-12-21T17:21:41+07:00"
}
Allo Bank Refund Explanation
ParameterTypeMandatoryDescription
responseCodestring (7)MandatoryResponse code as defined in SNAP Regulation
responseMessagestring (128)MandatoryResponse message as defined in SNAP Regulation
originalPartnerReferenceNostring (64)OptionalOriginal Transaction identifier on service consumer system
originalReferenceNostring (2048)OptionalOriginal Transaction identifier on service consumer system
refundNostring (64)Optional
refundAmountobjectOptional
refundAmount.valuenumeric (16,2)MandatoryURL to redirect user to Acquirer's webview to let customer finish OTP
refundAmount.currencystring (3)MandatoryIDR
refundTimestring (25)MandatoryRefund Time, ISO 8601