Backend Integration
Backend Integration to initiate payment
To obtain the payment.url
, you will need to hit this API through your Backend :
Endpoint
HTTP Method
POST
API endpoint (sandbox)
API endpoint (production)
Request
Here is the sample of request header to obtain payment.url
:
Request Header Explanation
client-id
Client ID retrieved from DOKU Back Office
request-id
Unique random string (max 128 characters) generated from merchant side to protect duplicate request
request-timestamp
Timestamp 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
signature
Security 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 obtain payment.url
, you can send a simple request for a basic payment page and you can send the parameter according to your needs :
order.amount
number
Mandatory
In IDR Currency and without decimal
Max length: 12
order.invoice_number
string
Mandatory
Generated by merchant to identify the order. Max length: 64
Notes: If you have Credit Card channel activated, the maximum length is 30
chars due to the acquirer's requirements
If you are using KKI, all the symbols are not allowed. Ensure you do not put any symbol on Invoice number value.
payment.payment_due_date
number
Optional
The payment due date of the checkout page in minutes. Default : 60 minutes. Max Length: 6
This basic request only could be implement for selected payment method, such as :
Virtual Account
Credit Card
QRIS
Convenience Store
E-money (OVO and Linkaja)
Order object
order.amount
number
Mandatory
Order amount in IDR currency and without decimal.
Max length: 12
order.invoice_number
string
Mandatory
Unique identifier generated by merchant to identify the order.
Max length: 64
, except credit card which 30 chars only
If you are using KKI, all the symbols are not allowed. Ensure you do not put any symbol on Invoice number value.
order.currency
string
Optional
3 alphabetic currency code ISO 4217
Min-max Length: 3
Default value: IDR
order.callback_url
string
Conditional, Mandatory for Payment Methods : Jenius.
The "Back to Merchant" button is configured using the URL provided in callback_url
. If only callback_url
is set, it will apply to the "Back to Merchant" button on both the main page and the result page. However, if the merchant also sets callback_url_result
, then callback_url
will only affect the "Back to Merchant" button on the main page, while callback_url_result
will specifically affect the button on the result page.
order.callback_url_cancel
string
Conditional, Currently only available for payment methods : Indodana
The URL specified for merchant redirection in the event of order cancellation.
order.callback_url_result
string
Optional
The URL designated for button "Back to merchant" in result page.
order.language
string
Optional
Default language shown when redirect to checkout page
Max length: 2
order.auto_redirect
boolean
Mandatory
When set to true, the transaction result page redirects to the callback URL; otherwise, it redirects to the payment result page.
order.disable_retry_payment
boolean
Conditional,
Only applied for payment methods : Credit Card
, DOKU Wallet
, Akulaku
, OVO
, ShopeePay
This condition is applicable only when the merchant sends this parameter with a "true" value. If the merchant does not include this parameter, sends a "false" value, or if the customer fails to complete the payment, the result page will be displayed in the Checkout. From there, the customer can retry payment or modify their payment options if multiple channels are available.
order.line_items.id
string
Conditional Mandatory for Payment Methods : Akulaku, Kredivo, Indodana
Item ID of the item in this transaction.
Max Length: 64
Note :
If you are using KKI, all the symbols are not allowed. Ensure you do not put any symbol on Invoice number value.
order.line_items.name
string
Conditional, Mandatory for Payment Methods : Jenius, Kredivo, Indodana, KKI.
Name of the product item.
Max Length: 255
Note
If you are using KKI, all the symbols are not allowed. Ensure you do not put any symbol.
order.line_items.price
number
Conditional, Mandatory for Payment Methods : Jenius, Kredivo, Akulaku, Indodana, KKI.
Price of the product item. Total price and quantity must match with the order.amount
.
Note
If you are using KKI, all the symbols are not allowed. Ensure you do not put any symbol.
order.line_items.quantity
number
Conditional, Mandatory for Payment Methods : Jenius, Kredivo, Akulaku, Indodana, KKI.
Quantity of the product item.
Note
If you are using KKI, all the symbols are not allowed. Ensure you do not put any symbol.
order.line_items.sku
string
Conditional. Mandatory for Payment Methods : Akulaku, Kredivo, Indodana.
SKU of the product item.
order.line_items.category
string
Conditional, Mandatory for Payment Methods : Akulaku, Kredivo, Indodana.
Category of the product item. For Indodana, the category should be based on these list.
order.line_items.url
string
Conditional, Mandatory for Payment Methods : Kredivo and Indodana.
URL to the product item on merchant site.
order.line_items.image_url
string
Conditional, Mandatory for Payment Methods : Indodana.
URL the image of the product item on merchant site.
order.line_items.type
string
Conditional, Mandatory for Payment Methods : Indodana.
Type of the item in this transaction.
Payment Object
payment.payment_method_types
array
optional
Payment method that will shown to users in Checkout Page. If you wish to showcase all available payment methods, simply omit sending this parameter, and all options will be visible. Alternatively, if you prefer to direct users to a specific payment method, include this parameter and specify the desired payment method by filling in its corresponding value. The value are listed here.
payment.type
string
Optional
Possible Value :
"SALE", "INSTALLMENT", "AUTHORIZE"
If you set the type as Authorize, the status will be stated as On Hold.
The status will change, if the customer do payment.
Only applicable in Credit Card.
payment.payment_due_date
number
optional
The payment due date of the checkout page in minutes. Default : 60 minutes. Max Length: 6
Customer Object
customer.id
string
Conditional, mandatory to enable tokenized payments (BRI Direct Debit, Allobank, Credit Card tokenization) and Akulaku Paylater.
Unique customer identifier generated by merchant.
Allowed chars: alphabetic, numeric, special chars
Max Length: 50
customer.name
string
Conditional, mandatory for payment methods Jenius, Akulaku, Indodana
Customer name.
Allowed chars: alphabetic
Max Length: 255
customer.last_name
string
Optional
Customer last name.
Max Length: 16
customer.email
string
Conditional, mandatory for payment method Indodana
Customer email.
Allowed chars: alphabetic, numeric, special chars
Max Length: 128
customer.phone
string
Conditional
Customer phone number. Format: {calling_code}{phone_number}
.
Example: 6281122334455
Max Length: 16
customer.address
string
Conditional, mandatory for payment method Akulaku
Customer address.
Allowed chars: alphabetic, numeric, special chars
Max Length: 400
customer.postcode
string
Conditional, mandatory for payment method Akulaku
Customer address' post code
customer.state
string
Conditional, mandatory for payment method Akulaku
Customer state or province.
customer.city
string
Conditional, mandatory for payment method Akulaku
Customer address' city
customer.country
string
Optional
2 alphabetic country code ISO 3166-1
Allowed chars: alphabetic
Min-max Length: 2
Shipping Address Object
shipping_address.first_name
string
Conditional, mandatory for payment method Kredivo and Indodana
Customer's first name used as shipping address
shipping_address.last_name
string
Optional
Customer's last name used as shipping address.
shipping_address.address
string
Conditional, mandatory for payment method Kredivo and Indodana
Customer's address used as shipping address.
shipping_address.city
string
Conditional, mandatory for payment method Kredivo and Indodana
City of customer's shipping address.
shipping_address.postal_code
string
Conditional, mandatory for payment method Kredivo and Indodana
Postal code of customer's shipping address.
shipping_address.phone
string
Conditional, mandatory for payment method Kredivo and Indodana
Customer's phone used as shipping address.
shipping_address.country_code
string
Conditional, mandatory for payment method Kredivo and Indodana
Country of customer's shipping address.
Billing Address Object
billing_address.first_name
string
Conditional, mandatory for payment method Indodana
Customer's first name used as billing address
billing_address.last_name
string
Conditional, mandatory for payment method Indodana
Customer's last name used as billing address.
billing_address.address
string
Conditional, mandatory for payment method Indodana
Customer's address used as billing address.
billing_address.city
string
Conditional, mandatory for payment method Indodana
City of customer's billing address.
billing_address.postal_code
string
Conditional, mandatory for payment method Indodana
Postal code of customer's billing address.
billing_address.phone
string
Conditional, mandatory for payment method Indodana
Customer's phone used as billing address.
billing_address.country_code
string
Conditional, mandatory for payment method Indodana
Country of customer's billing address.
Additional Info Object
additional_info.allow_tenor
number
Optional
The transaction exclusively supports installment tenors as per its current configuration. The allowed values are 0,3,6,12. To hide the "no installment" option, refrain from inputting 0 (zero) in the parameter.
additional_info.doku_wallet_notify_url
string
Conditional, only for payment method DOKU Wallet
Notification url set in this parameter
additional_info.override_notification_url
string
Optional
This parameter is intended to override the configured Notification URL
with another URL. Click here for more information.
Response
Success Response
HTTP Status
200
Response Body Explanation
message
array
Mandatory
Message will display the result of the request. If there are some errors on your request, they will be diplayed in this parameter.
response.order.amount
number
Mandatory
Same as the request
response.order.invoice_number
string
Mandatory
Same as the request
response.order.currency
string
Optional
Same as the request
response.order.session_id
string
Optional
Unique session ID generated by DOKU
response.order.callback_url
string
Optional
Same as the request
response.order.callback_url_cancel
string
Optional
Same as the request
response.order.line_items.name
string
Optional
Same as the request
response.order.line_items.quantity
number
Optional
Same as the request
response.order.line_items.price
number
Optional
Same as the request
response.order.line_items.sku
string
Optional
Same as the request
response.order.line_items.category
string
Optional
Same as the request
response.order.line_items.url
string
Optional
Same as the request
response.order.line_items.image_url
string
Optional
Same as the request
response.order.line_items.type
string
Optional
Same as the request
response.order.language
string
Optional
Same as the request
response.order.disable_retry_payment
boolean
Optional
Same as the request
response.order.auto_redirect
boolean
Optional
Same as the request
response.payment.payment_method_types
array
Optional
Payment method that will be displayed on the Checkout Page
response.payment.payment_due_date
number
Mandatory
Same as the request
response.payment.token_id
string
Mandatory
Token generated by DOKU for the Checkout Page
response.payment.url
string
Mandatory
Checkout page URL to display for the customer
response.payment.expired_date
string
Mandatory
Date time of payment page 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
response.customer.id
string
Optional
Same as the request
response.customer.state
string
Optional
Same as the request
response.customer.city
string
Optional
Same as the request
response.customer.postcode
string
Optional
Same as the request
response.customer.email
string
Optional
Same as the request
response.customer.phone
string
Optional
Same as the request
response.customer.name
string
Optional
Same as the request
response.customer.last_name
string
Optional
Same as the request
response.customer.address
string
Optional
Same as the request
response.customer.country
string
Optional
Same as the request
response.additional_info.allow_tenor
string
Optional
Same as the request
response.additional_info.close_redirect
string
Optional
Same as the request
response.additional_info.doku_wallet_notify_url
string
Optional
Same as the request
response.additional_info.override_notification_url
string
Optional
Same as the request
response.uuid
string
Optional
Unique number generated by DOKU
response.headers.requestId
string
Optional
Same as the request
response.headers.signature
string
Optional
Same as the request
response.headers.date
string
Optional
Same as the request
response.headers.clientId
string
Optional
Same as the request
response.shipping_address.address
string
Optional
Same as the request
response.shipping_address.city
string
Optional
Same as the request
response.shipping_address.phone
string
Optional
Same as the request
response.shipping_address.first_name
string
Optional
Same as the request
response.shipping_address.last_name
string
Optional
Same as the request
response.shipping_address.postal_code
string
Optional
Same as the request
response.shipping_address.country_code
string
Optional
Same as the request
response.billing_address.address
string
Optional
Same as the request
response.billing_address.city
string
Optional
Same as the request
response.billing_address.phone
string
Optional
Same as the request
response.billing_address.first_name
string
Optional
Same as the request
response.billing_address.first_name
string
Optional
Same as the request
response.billing_address.postal_code
string
Optional
Same as the request
response.billing_address.country_code
string
Optional
Same as the request
Failed Response
HTTP Status
400
List Category
List category can be used as reference. But this is part of payment channel Indodana with mandatory value need to set in order.line_items.category.
1
airlines
2
arts-crafts-and-collectibles
3
automotive
4
baby
5
beauty-and-fragrances
6
biller
7
books-and-magazines
8
business-to-business-including-mlm
9
charity-and-non-profit
10
clothing
11
community
12
digital-content
13
electronics-and-telecom
14
entertainment-and-media
15
fee
16
financial-services-and-products
17
financial-services-and-technology
18
food-and-beverage
19
food-retail-and-service
20
games-voucher
21
gifts-and-flowers
22
government
23
health-and-personal-care
24
home-and-garden
25
hotel-and-travel
26
insurance
27
marketplace
28
nonprofit
29
offline-store
30
others
31
over-the-air
32
overseas
33
pets-and-animals
34
property
35
public-services
36
religion-and-spirituality
37
retail
38
services
39
sports-and-outdoors
40
telco
41
ticketing
42
toys-and-hobbies
43
transportation
45
travel
46
vehicle-sales
47
vehicles-service-and-accessories
Last updated