Skip to main content

akulaku-refund-section

You can request refund using this API.

To request a refund, you will need to hit this API through your backend:

API Request

TypeValue
HTTP MethodPOST
API endpoint (Sandbox)https://api-sandbox.doku.com/akulaku-peer-to-peer/v2/refund
API endpoint (Production)https://api.doku.com/akulaku-peer-to-peer/v2/refund

Here is the sample of request header to generate payment URL:

Client-Id: MCH-0001-10791114622547
Request-Id: 6cc9f8b1-d83d-4c24-b853-a3223f43a744
Request-Timestamp: 2020-08-12T09:45:42Z
Signature: HMACSHA256=9UPUFzOqJc47aJzD9ESOTcWg6TMsg3mqSP+DnUO8ENE=
Request Header Explanation
ParameterDescription
Client-IdClient ID retrieved from DOKU Back Office
Request-IdUnique random string (max 128 characters) generated from merchant side to protect duplicate request
Request-TimestampTimestamp request on UTC time in ISO8601 UTC+0 format. It means to proceed transaction on UTC+7 (WIB), merchant need to subtract time with 7. Ex: to proceed transaction on September 22th 2020 at 08:51:00 WIB, the timestamp should be 2020-09-22T01:51:00Z
SignatureSecurity parameter that needs to be generated on merchant Backend and placed to the header request to ensure that the request is coming from valid merchant. Please refer to this section to generate the signature

Here is the sample request body to request a refund:

{
"order":{
"invoice_number":"invoice-00000101123"
},
"payment":{
"merchant_unique_reference":"REFUND-ABC-0001045",
"identifier":[
{
"name": "ORDER_ID",
"value": "1000043205"
},
{
"name": "AKULAKU_UNIQUE_REFERENCE",
"value": "MCH-0001-10791114622547REFUND-ABC-0001045"
}
]
},
"refund":{
"merchant_unique_reference":"XYZ-006456"
}
}
Request Body Explanation
ParameterTypeMandatoryDescription
order.invoice_numberstringMandatoryInvoice number of the transaction that being refunded, same as the invoice when payment
payment.merchant_unique_referencestringMandatorySame as the request
payment.identifierarrayMandatoryKey Value pairing data
refund.merchant_unique_referencestringMandatoryunique reference no of merchant’s order refund, generated by merchant (new)

API Response

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

TypeValue
HTTP Status200
ResultSUCCESS

Here is the sample response header:

Client-Id: MCH-0001-10791114622547
Request-Id: 6cc9f8b1-d83d-4c24-b853-a3223f43a744
Response-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=1jap2tpgvWt83tG4J7IhEwUrwmMt71OaIk0oL0e6sPM=
Response Header Explanation
ParameterDescription
Client-IdSame as the request
Request-IdSame as the request
Response-TimestampTimestamp Response on UTC with format ISO8601 UTC+0 from DOKU
SignatureSignature generated by DOKU based on the response body

Here is the sample of response body:

{
"order": {
"invoice_number": "invoice-00000101123",
"amount": 110000
},
"payment": {
"date": "2021-12-27T05:47:39Z",
"status": "REFUNDED",
"merchant_unique_reference": "REFUND-ABC-0001045",
"identifier": [
{
"name": "AKULAKU_UNIQUE_REFERENCE",
"value": "MCH-0001-10791114622547REFUND-ABC-0001045"
},
{
"name": "ORDER_ID",
"value": "1000043205"
}
]
},
"refund": {
"date": "2021-12-27T05:57:06Z",
"status": "SUCCESS",
"merchant_unique_reference": "XYZ-006456",
"identifier": [
{
"name": "AKULAKU_UNIQUE_REFERENCE",
"value": "REF-MCH-0001-10791114622547XYZ-006456"
}
]
}
}
Response Body Explanation
ParameterTypeMandatoryDescription
order.invoice_numberstringMandatorySame as the request
order.amountnumberMandatorySame as the request
payment.datestringMandatoryTime Stamp response on UTC time in ISO8601 format
payment.statusstringMandatoryStatus of the payment

a. REFUNDED = Refund request success / already request
b. FAILED = Transaction already failed
c. CANCELED = Transaction already canceled
d. PENDING = Transaction still pending
payment.merchant_unique_referencestringMandatorySame as the request payment
payment.identifierarrayOptionalKey Value pairing data
refund.datestringMandatoryTime Stamp response on UTC time in ISO8601 format
refund.statusstringMandatoryRefund status
Possible value: SUCCESS, FAILED
refund.merchant_unique_referencestringOptionalSame as the request refund
refund.identifierarrayOptionalKey Value Pairing Data
Refund Type

Currently, Akulaku only accepts refund requests with Full Amount type.