Skip to main content

Indodana Guide

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


Integration steps

Here is the overview of how to integrate with Indodana:

  1. Obtain payment.url by generating order
  2. Display Indodana payment page to customer
  3. Acknowledge payment result
DOKU Direct - Indodana Sequence Diagram
DOKU Direct Indodana 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/indodana-peer-to-peer/v2/generate-order
API endpoint (Production)https://api.doku.com/indodana-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": "MINV20201231468",
"line_items": [
{
"name":"Ayam",
"price":50000,
"quantity":2,
"id":"1002",
"category":"ELECTRONIC",
"url":"https://merchant.com/product_1002",
"image_url":"https://merchant.com/product_1002/image",
"type":"handphone"
}
],
"amount": 100000,
"callback_url":"https://merchant.com/return-url",
"callback_url_cancel":"https://merchant.com/cancel-url"
},
"peer_to_peer_info": {
"expired_time":60,
"merchant_unique_reference": "60123"
},
"customer": {
"first_name":"andreas",
"last_name":"dharmawan",
"phone":"081939815480",
"email":"andreas@email.com"
},
"billing_address": {
"first_name":"andreas",
"last_name":"dharmawan",
"address":"Jalan Teknologi Indonesia No. 25",
"city":"Jakarta",
"postal_code":"12960",
"phone":"081513114262",
"country_code":"IDN"
},
"shipping_address": {
"first_name":"andreas",
"last_name":"dharmawan",
"address":"Jalan Teknologi Indonesia No. 25",
"city":"Jakarta",
"postal_code":"12960",
"phone":"081513114262",
"country_code":"IDN"
}
}
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: 16
order.line_items.namestringMandatoryName of the product item
Allowed chars: alphabetic, numeric, special chars
Max Length: 128
order.line_items.pricedecimalMandatoryPrice of the product item. Total price and quantity must match with the order.amount
Allowed chars: numeric
Max Length: 16.2
order.line_items.quantitynumberMandatoryQuantity of the product item
Allowed chars: numeric
Max Length: 8
order.line_items.idstringMandatorySKU/item ID of the item in this transaction.
Allowed chars: alphabetic, numeric, special chars
Max Length: 64
order.line_items.categoryenumMandatoryCategory of the item in this transaction. Reference for list of enum : airlines arts-crafts-and-collectibles automotive baby beauty-and-fragrances biller books-and-magazines business-to-business-including-mlm charity-and-non-profit clothing community digital-content electronics-and-telecom entertainment-and-media financial-services-and-products financial-services-and-technology food-and-beverage food-retail-and-service games-voucher gifts-and-flowers government health-and-personal-care home-and-garden hotel-and-travel insurance marketplace nonprofit offline-store others over-the-air overseas overseas pets-and-animals property public-services religion-and-spirituality retail services sports-and-outdoors telco ticketing toys-and-hobbies transportation travel vehicle-sales vehicles-service-and-accessories
If cannot find, you can use others
order.line_items.urlstringOptionalURL of the product in the merchant site / platform.
Max Length: 256
order.line_items.image_urlstringOptionalURL of the image of the product in the merchant site / platform.
Max Length: 256
order.line_items.typestringOptionalType of the item in this transaction
order.callback_urlstringOptionalMerchant URL that will redirected to after the order completed
Allowed chars: alphabetic, numeric, special chars
Only support: ^[a-zA-Z0-9()\\-=\\\\.\\?;,+\\/:&_ %]$#
order.callback_url_cancelstringMandatoryMerchant URL that will redirected if order cancelled
Allowed chars: alphabetic, numeric, special chars
Only support: ^[a-zA-Z0-9()\\-=\\\\.\\?;,+\\/:&_ %]$#
peer_to_peer_info.expired_timenumberOptionalOrder expired time
Format in minute
Max length: 5
peer_to_peer_info.merchant_unique_referencestringMandatoryUnique reference number generated by merchant
Allowed chars: alphabetic, numeric, special chars
customer.first_namestringMandatoryCustomer name
Allowed chars: alphabetic, numeric, special chars
Max Length: 16
customer.last_namestringOptionalCustomer name
Allowed chars: alphabetic, numeric, special chars
Max Length: 16
customer.emailstringMandatoryCustomer email address.
Max Length: 16
customer.phonestringMandatoryCustomer phone number. Format: {calling_code}{phone_number}. Example: 6281122334455
Allowed chars: numeric
Max Length: 16
billing_addressjsonMandatoryBilling address of the customer for the transaction.
Allowed chars: object
billing_address.first_namestringMandatoryBilling Address first name
billing_address.last_namestringOptionalBilling Address last name
billing_address.addressnumberMandatoryBilling address of the customer/shopper
billing_address.citynumberMandatoryBilling city of the customer/shopper
billing_address.postal_codenumberMandatoryBilling postal code of the customer/shopper
billing_address.phonenumberMandatoryBilling phone of the customer/shopper
billing_address.country_codenumberMandatoryBilling country code of the customer/shopper
shipping_addressjsonOptionalShipping address of the customer for the transaction.
Allowed chars: object
shipping_address.first_namestringMandatoryShipping address first name
shipping_address.last_namestringOptionalShipping address last name
shipping_address.addressstringMandatoryShipping address of the customer/shopper. shipping is required for goods (excluding ticket/voucher)
shipping_address.citystringMandatoryShipping address city
shipping_address.postal_codestringMandatoryShipping address postal code
shipping_address.phonestringMandatoryShipping address phone
shipping_address.country_codestringMandatoryShipping address country code

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": {
"amount": 200000,
"invoice_number": "INVQ01W"
},
"payment": {
"status": "PENDING",
"url": "https://sandbox01.indodana.com/product-installment/payment?purchaseTransactionId=<generated-purchase-transaction-id>&tenure=3"
},
"peer_to_peer_info": {
"identifier": [
{
"name": "INDODANA_ORDER_ID",
"value": "<MERCHANT-ORDER-ID>"
}
],
"created_date": "20220217222048",
"expired_date": "20220217232048",
"created_date_utc": "2022-02-17T15:20:48Z",
"expired_date_utc": "2022-02-17T16:20:48Z",
"merchant_unique_reference": "MURQ01W"
}
}
Response Body Explanation
ParameterTypeMandatoryDescription
order.invoice_numberstringMandatorySame as the request
order.amountnumberMandatorySame as the request
payment.urlstringMandatoryIndodana payment page URL to display for the customer
payment.statusstringMandatoryThe current payment status
Possible value:
PENDING, FAILED
peer_to_peer_info.identifierarrayOptionalList of transaction identifier that coming from the acquiring. Merchant can save these data for reference
peer_to_peer_info.merchant_unique_referencestringConditionalSame as the request
peer_to_peer_info.created_datestringConditionalDate time of Indodana generated with the format of yyyyMMddHHmmss.
peer_to_peer_info.expired_datestringConditionalDate time of Indodana will be expired with the format of yyyyMMddHHmmss.
peer_to_peer_info.created_date_utcstringConditionalDate time of Indodana generated in UTC Format.
peer_to_peer_info.expired_date_utcstringConditionalDate time of Indodana will be expired in UTC Format.

2. Display Indodana payment page to customer

Once you have the payment.url, you can now display the payment page by redirecting your customer to the Indodana 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.

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.