Skip to main content

Akulaku Guide

DOKU has partenered with various Paylater Providers and one of them is Akulaku to provide Buy Now Pay Later. Learn more about how DOKU can help you integrate with Akulaku here.


Integration steps

Here is the overview of how to integrate with Akulaku:

  1. Obtain payment.url by generating order
  2. Display Akulaku payment page to customer
  3. Acknowledge payment result
Direct API - Akulaku Sequence Diagram
 Direct API - Akulaku Merchant Flow

1. Obtain payment.url by generating order

To generate order, 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/generate-order
API endpoint (Production)https://api.doku.com/akulaku-peer-to-peer/v2/generate-order

Here is the sample of request header to generate order:

Client-Id: MCH-0001-10791114622547
Request-Id: baec7d95-f30a-4b78-b711-6ebe0ccdf50b
Request-Timestamp: 2021-07-07T08:45:42Z
Signature: HMACSHA256=vl9DBTX5KhEiXmnpOD0TSm8PYQknuHPdyHSTSc3W6Ps=
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 generate order:

{
"order": {
"invoice_number": "INV-20210707-0001",
"amount": 90000,
"line_items": [
{
"name": "T-Shirt Red",
"price": 30000,
"quantity": 2,
"sku": "1002",
"category": "Shirt"
},
{
"name": "Polo Navy",
"price": 30000,
"quantity": 1,
"sku": "1001",
"category": "Shirt"
}
],
"callback_url": "https://merchant.com/return-url"
},
"payment": {
"merchant_unique_reference": "MUR-20210707-0001"
},
"customer": {
"id": "CUST-0001",
"name": "Anton Budiman",
"phone": "6285694566147",
"address": "Menara Mulia Lantai 8",
"city": "Jakarta Selatan",
"state": "DKI Jakarta",
"postcode": "120129"
}
}
Request Body Explanation
ParameterTypeMandatoryDescription
order.invoice_numberstringMandatoryGenerated by merchant to identify the order and must unique per request
Allowed chars: alphabetic, numeric, special chars
Max length: 64
order.amountnumberMandatoryIn IDR currency and without decimal
Allowed chars: numeric
Max length: 12
order.line_items.namestringMandatoryName of the product item
Allowed chars: alphabetic, numeric, special chars
Max Length: 255
order.line_items.pricenumberMandatoryPrice of the product item. Total price and quantity must match with the order.amount
Allowed chars: numeric
Max Length: 12
order.line_items.quantitynumberMandatoryQuantity of the product item
Allowed chars: numeric
Max Length: 4
order.line_items.skustringMandatorySKU of the item in this transaction
order.line_items.categorystringMandatoryCategory of the item in this transaction
order.callback_urlstringMandatoryMerchant URL that will redirected to after the order completed
Allowed chars: alphabetic, numeric, special chars
payment.merchant_unique_referencestringMandatoryUnique reference number generated by merchant, can be same value as order.invoice_number
Allowed chars: alphabetic, numeric, special chars
Max length: 64
customer.idstringMandatoryUnique customer identifier generated by merchant
Allowed chars: alphabetic, numeric, special chars
Max Length: 50
customer.namestringMandatoryCustomer name that will be displayed on acquirer channel when do inquiry
Allowed chars: alphabetic, numeric, special chars
Max length: 64
customer.phonestringMandatoryCustomer phone number. Format: {calling_code}{phone_number}. Example: 6281122334455
Allowed chars: numeric
Max Length: 16
customer.addressstringOptionalCustomer address
Allowed chars: alphabetic, numeric, special chars
Max Length: 400
customer.citystringOptionalCustomer city, (Please send the following object, even if the value is empty.)
Allowed chars: alphabetic, numeric, special chars
Max Length: 64
customer.statestringOptionalCustomer province, (Please send the following object, even if the value is empty.)
Allowed chars: alphabetic, numeric, special chars
Max Length: 64
customer.postcodenumberOptionalCustomer postcode, (Please send the following object, even if the value is empty.)
Allowed chars: numeric
Max Length: 64

API Response

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

TypeValue
HTTP Status200
ResultSUCCESS
Client-Id: MCH-0001-10791114622547
Request-Id: baec7d95-f30a-4b78-b711-6ebe0ccdf50b
Response-Timestamp: 2021-07-07T08:45:42Z
Signature: HMACSHA256=9UPUFzOqJc47aJzD9ESOTcWg6TMsg3mqSP+DnUO8ENE=
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": "INV-20210707-0001",
"amount": 90000
},
"payment": {
"merchant_unique_reference": "MUR-20210707-0001",
"url": "https://test-mall.akulaku.com/v2/openPay.html?appId=15006801&refNo=MCH%2D0022%2D2599139268305MUR%2D20210712%2D0010&sign=Gd4XpzDEaxse6aoMQzpFNIGCSednnBT5X2iF5P%2DkLswSJGFCndyCER8IfeWI7n3t4XrwNAEevO2x2wuwkN5sjw",
"status": "PENDING",
"identifier": [
{
"name": "ORDER_ID",
"value": "1000035148"
},
{
"name": "AKULAKU_UNIQUE_REFERENCE",
"value": "MCH-0001-10791114622547MUR-20210707-0001"
}
]
}
}
Response Body Explanation
ParameterTypeMandatoryDescription
order.invoice_numberstringMandatorySame as the request
order.amountnumberMandatorySame as the request
payment.merchant_unique_referencestringMandatorySame as the request
payment.urlstringMandatoryAkulaku payment page URL to display for the customer
payment.statusstringMandatoryThe current payment status
Possible value:
PENDING: continue redirect the customer to payment.url.
FAILED: Retry generate order with different order.invoice_number and payment.merchant_unique_reference
payment.identifierarrayOptionalList of transaction identifier that coming from the acquiring. Merchant can save these data for reference

2. Display Akulaku payment page to customer

Once you have the payment.url, you can now display the payment page by redirecting your customer to the Akulaku payment page.

After the customer completed the payment, they will be redirected to the defined order.callback_url that you set on the API request.


3. Acknowledge payment result

After the payment is being made by your customer, DOKU will send HTTP Notification to your defined Notification URL. Learn how to handle the notification from DOKU:


Additional features

We provide various additional features to suited your needs. Learn more here.

Cancel Order

If you wish to cancel your order request, you can do that by hitting the API with POST method:

API Request

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

Here is the sample of request header to Cancel Order:

Client-Id: MCH-0001-10791114622547
Request-Id: 2dc5985e-adaa-4f82-b126-b09e9006da14
Request-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=vl9DBTX5KhEiXmnpOD0TSm8PYQknuHPdyHSTSc3W6Ps=
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 of request body to Cancel Order:

{
"order": {
"invoice_number": "MINV20201231468"
},
"payment": {
"merchant_unique_reference": "ABC0001",
"identifier": [
{
"name": "AKULAKU_UNIQUE_REFERENCE",
"value": "MCH-12345678ABC0001"
},
{
"name": "ORDER_ID",
"value": "893102"
}
]
}
}
Request Body Explanation
ParameterTypeMandatoryDescription
order.invoice_numberstringSame as the generate VA request
payment.merchant_unique_referencestringMandatoryUnique reference number of merchant's order. generated by merchant. Please note, this reference is unique per request.
payment.identifierobjectOptionalKey Value pairing data
payment.identifier.AKULAKU_UNIQUE_REFERENCEstringOptionalGet from generate order response body
payment.identifier.ORDER_IDstringOptionalGet from generate order response body

API Response

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

TypeValue
HTTP Status200
ResultSUCCESS
Client-Id: MCH-0001-10791114622547
Request-Id: 09e0defe-a071-45b3-9feb-ac134374628c
Response-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=9UPUFzOqJc47aJzD9ESOTcWg6TMsg3mqSP+DnUO8ENE=
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": "MINV20201231468",
"amount": 100000
},
"payment": {
"status": "CANCELLED",
"date": "2020-08-11T08:50:02Z",
"merchant_unique_reference": "ABC0001",
"identifier": [
{
"name": "AKULAKU_UNIQUE_REFERENCE",
"value": "MCH-12345678ABC0001"
},
{
"name": "ORDER_ID",
"value": "893102"
}
]
},
"cancel": {
"status": "SUCCESS",
"date": "2020-08-11T08:50:02Z"
},
"error":{
"message": "Order Not Found"
}
}
Response Body Explanation
ParameterTypeMandatoryDescription
order.invoice_numberstringMandatorySame as the request
`order.amountnumberMandatorySame as the request
payment.statusstringMandatoryStatus of the payment.

Possible Value:
1. SUCCESS = If Akulaku approved payment request
2. FAILED = If Akulaku reject payment request.
payment.datestringMandatoryDate time of Akulaku will be expired with the format of yyyyMMddHHmmss. The expired date uses UTC+7 time. Use this to set the expiry order on merchant side
payment.merchant_unique_referenceobjectMandatoryUnique reference number of merchant's order. generated by merchant. Please note, this reference is unique per request.
cancel.statusstringMandatoryStatus of Cancel.

Possible Value:
1. SUCCESS = If Cancellation success
2. FAILED = If Cancellation failed.
cancel.datestringMandatoryDate time of Order Akulaku already cancel.

Refund Order

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.


Split Settlement

If you are a platform or a marketplace, you can use this feature to settle the funds to your sellers or partners programmatically, save many operational efforts.