API Reference (NEW)
ID - Indonesia
  • ID - Indonesia
  • GL - Global
DashboardProduct Docs
Resources
  • Github
  • Demo Site
  • Simulator
DashboardProduct Docs
Resources
  • Github
  • Demo Site
  • Simulator
ID - Indonesia
  • ID - Indonesia
  • GL - Global
  1. Build a Checkout Page
  • Introduction
  • Getting Started
    • Create Account
    • Authentication & API Keys
    • Make your first API call
    • Postman Collection
  • Checkout API
    • Build a Checkout Page
      • Checkout Page
      • Initiate Payment
        POST
  • Direct API
    • Cards
      • Payment Form
        • Step 1 - Generate Payment Page
      • Host-to-host Payment
    • Bank Transfer
      • BCA Virtual Account
        • DOKU Generate Payment Code
          • Step 1 - Get Token
          • Step 2 - Create VA (DGPC)
          • Additional - Payment Notification
          • Additional - Delete Payment Code
          • Additional - Update Payment Code
        • Merchant Generate Payment Code
          • Step 1 - Get Token
          • Step 2 - Create VA (MGPC)
          • Additional - Payment Notification
          • Additional - Delete Payment Code
          • Additional - Update Payment Code
        • Direct Inquiry
          • Inquiry Payment
          • Additional - Payment Notification
          • Additional - Delete Payment Code
          • Additional - Update Payment Code
      • BNC Virtual Account
        • Merchant Generated Payment Code
          • Step 2 - Create VA (DGPC)
        • DOKU Generated Payment Code
          • Step 1 - Get Token
          • Step 2 - Create VA (DGPC)
        • Direct Inquiry
          • Step 1 - Get Token
          • Step 2 - Create VA (DGPC)
      • BNI Virtual Account
        • Merchant Generated Payment Code
          • Step 1 - Get Token
          • Step 2 - Create VA (DGPC)
        • DOKU Generated Payment Code
          • Step 1 - Get Token
          • Step 2 - Create VA (DGPC)
        • Direct Inquiry
          • Step 1 - Get Token
          • Step 2 - Create VA (DGPC)
      • BRI Virtual Account
        • Step 1 - Init KJUR
        • Step 2 - Get Token
        • Step 3 - Create VA (DGPC)
      • BSI Virtual Account
        • Step 1 - Init KJUR
        • Step 2 - Get Token
        • Step 3 - Create VA (DGPC)
      • BTN Virtual Account
        • Step 1 - Init KJUR
        • Step 2 - Get Token
        • Step 3 - Create VA (DGPC)
      • DANAMON Virtual Account
        • Step 1 - Init KJUR
        • Step 2 - Get Token
        • Step 3 - Create VA (DGPC)
      • MANDIRI Virtual Account
        • Merchant Generated Payment Code
          • Step 1 - Get Token
          • Step 2 - Create VA (DGPC)
        • DOKU Generated Payment Code
        • Direct Inquiry
      • MAYBANK Virtual Account
        • Step 1 - Init KJUR
        • Step 2 - Get Token
        • Step 3 - Create VA (DGPC)
      • PERMATA Virtual Account
        • Step 1 - Init KJUR
        • Step 2 - Get Token
        • Step 3 - Create VA (DGPC)
      • SINARMAS Virtual Account
        • Step 1 - Init KJUR
        • Step 2 - Get Token
        • Step 3 - Create VA (DGPC)
      • CIMB SNAP Virtual Account
        • Step 1 - Init KJUR
        • Step 2 - Get Token
        • Step 3 - Create VA (DGPC)
    • Convenience Store
      • Alfa Group
        • Alfa - Generate Payment Code
      • Indomaret
        • Indomaret - Generate Payment Code
    • e-Wallet
      • OVO
        • One Time Payment
          • OVO - Payment
          • OVO - Void
        • Account Binding
          • Step 1 - Account Binding
          • Step 2 - Balance Inquiry
          • Step 3 - Payment
          • Additional - Refund
          • Additional - Account Unbinding
      • Shopee Pay
        • Shopee Pay - Create Order
    • Direct Debit
      • BRI Direct Debit
        • Register Card - Create Token
        • Register Card - Validate OTP
        • Register Card - Resend OTP
        • Get Card List
        • Payment - Create Payment
        • Payment - Validate OTP
        • Payment - Resend OTP
        • Payment - Create Recurring Payment
        • Delete Card
      • CIMB Snap Direct Debit
        • Get Token B2B
        • Account Binding
        • Get Token B2B2C
        • Payment
        • Verify OTP Payment
        • Refund
        • Account Unbinding
        • Verify OTP Unbinding
      • ALLO Snap Direct Debit
        • Step 1 - Account Binding
        • Step 2 - Balance Inquiry
        • Step 3 - Payment
        • Additional - Refund
        • Additional - Account Unbinding
      • BRI Snap Direct Debit
        • Get Token B2B
        • Card Binding
        • Verify OTP Binding
        • Get Token B2B2C
        • Payment
        • Verify OTP Payment
        • Refund
        • Card Unbinding
      • Mandiri Snap Direct Debit
        • Get Token B2B
        • Card Binding
        • Request OTP Binding
        • Verify OTP Binding
        • Get Token B2B2C
        • Payment
        • Request OTP Payment
        • Verify OTP Payment
        • Cancel
        • Card Unbinding
      • Dana Snap Direct Debit
        • Get Token B2B
        • Payment
        • Refund
      • ShopeePay Snap Direct Debit
        • Get Token B2B
        • Payment
        • Refund
    • PayLater
      • Generate Order
      • Cancellation
      • Refund
    • Kartu Kredit Indonesia
      • Get Token B2B
      • Binding Only
      • Payment AFP with Binding
      • Payment AFP
      • Payment with token
      • Payment without AFP
      • Refund
      • Unbinding
    • Online Refund
      POST
  • Payout API
  • Check Status API
    • Payment
      GET
  • Partner API
  • Biller API
  • Wallet Service API
  • Webhooks
    • Sub Account API
      • Money In
        • Accept Payment
      • Money Out
      • Balance
  • Use Case Guides
  • Error Handling
    • Error Codes Glossary
  • FAQ / Troubleshooting
  • Change Log
    • ID - Indonesia Version
  • Archive
    • Get Token B2B
    • Get Token B2B2C
    • Step 1 - Account Binding
    • Step 2 - Balance Inquiry
    • Step 3 - Payment
    • Additional - Refund
    • Additional - Account Unbinding
    • Get Token B2B
    • Get Token B2B2C
    • Account Binding
    • Balance Inquiry
    • Payment
    • Refund
    • Account Unbinding
  1. Build a Checkout Page

Initiate Payment

POST
/checkout/v1/payment

Checkout Page#

Test Checkout#

Checkout Payment#

Request

Header Params
Client-Id
string 
required
Client ID retrieved from DOKU Back Office
Example:
MCH-0001-10791114622547
Request-Id
string 
required
Unique random string (max 128 characters) generated from merchant side to protect duplicate request
Example:
fdb69f47-96da-499d-acec-7cdc318ab2fe
Request-Timestamp
string 
required
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
Example:
2020-08-11T08:45:42Z
Signature
string 
required
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.
Example:
HMACSHA256=1jap2tpgvWt83tG4J7IhEwUrwmMt71OaIk0oL0e6sPM=
Body Params application/json
order
object 
required
amount
integer 
required
Order amount in IDR currency and without decimal.
Max length: 12
invoice_number
string 
required
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.
currency
string 
required
3 alphabetic currency code ISO 4217
Min-max Length: 3
Default value: IDR
language
string 
optional
Default language shown when redirect to checkout page
Max length: 2
line_items
array [object {9}] 
optional
disable_retry_payment
boolean 
optional
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.
auto_redirect
boolean 
optional
When set to true, the transaction result page redirects to the callback URL; otherwise, it redirects to the payment result page.
callback_url
string 
optional
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.
callback_url_cancel
string 
optional
The URL specified for merchant redirection in the event of order cancellation.
callback_url_result
string 
optional
The URL designated for button "Back to merchant" in result page.
recover_abandoned_cart
boolean 
optional
If you bring this parameter and set as true, your customer can recover their order than has been expired as long as the expired_recover_cart is not due yet.
expired_recovered_cart
number 
optional
This is the expired time of the order that is already recovered. The expired time's max length is 44640 minutes.
session_id
string 
optional
payment
object 
optional
payment_method_types
string 
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.
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_due_date
integer 
optional
The payment due date of the checkout page in minutes. Default : 60 minutes. Max Length: 6
customer
object 
optional
id
string 
optional
Unique customer identifier generated by merchant.
Allowed chars: alphabetic, numeric, special chars
Max Length: 50
name
string 
optional
Customer name.
Allowed chars: alphabetic
Max Length: 255
last_name
string 
optional
Customer last name.
Max Length: 16
email
string 
optional
Customer email.
Allowed chars: alphabetic, numeric, special chars
Max Length: 128
phone
string 
optional
Customer phone number. Format: {calling_code}{phone_number}.
Example: 6281122334455
Max Length: 16
address
string 
optional
Customer address.
Allowed chars: alphabetic, numeric, special chars
Max Length: 400
postcode
string 
optional
Customer address' post code
state
string 
optional
Customer state or province.
city
string 
optional
Customer address' city.
country
string 
optional
2 alphabetic country code ISO 3166-1
Allowed chars: alphabetic
Min-max Length: 2
shipping_address
object 
optional
first_name
string 
optional
Customer's first name used as shipping address.
last_name
string 
optional
Customer's last name used as shipping address.
phone
string 
optional
Customer's phone used as shipping address.
address
string 
optional
Customer's address used as shipping address.
city
string 
optional
City of customer's shipping address.
postal_code
string 
optional
Postal code of customer's shipping address.
country_code
string 
optional
Country of customer's shipping address.
billing_address
object 
optional
first_name
string 
optional
Customer's first name used as billing address
last_name
string 
optional
Customer's last name used as billing address
phone
string 
optional
Customer's phone used as billing address
address
string 
optional
Customer's address used as billing address
city
string 
optional
City of customer's billing address
postal_code
string 
optional
Postal code of customer's billing address
country_code
string 
optional
Country of customer's billing address
additional_info
object 
optional
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.
doku_wallet_notify_url
string 
optional
Notification url set in this parameter
override_notification_url
string 
optional
This parameter is intended to override the configured Notification URL with another URL
Example
{
    "order": {
        "amount": 10500,
        "invoice_number": "INV-{{$timestamp}}",
        "currency": "IDR",
        "session_id": "SU5WFDferd561dfasfasdfae123c",
        "callback_url": "https://doku.com/",
        "line_items": [
            {
                "name": "DOKU T-Shirt",
                "price": 10500,
                "quantity" : 1
            }
        ]
    },
    "payment": {
        "payment_due_date": 60
    },
    "customer": {
        "name": "Anton Budiman",
        "email": "anton@doku.com",
        "phone": "+6285694566147",
        "address": "Plaza Asia Office Park Unit 3",
        "country": "ID"
    }
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/checkout/v1/payment' \
--header 'Client-Id: MCH-0001-10791114622547' \
--header 'Request-Id: fdb69f47-96da-499d-acec-7cdc318ab2fe' \
--header 'Request-Timestamp: 2020-08-11T08:45:42Z' \
--header 'Signature: HMACSHA256=1jap2tpgvWt83tG4J7IhEwUrwmMt71OaIk0oL0e6sPM=' \
--header 'Content-Type: application/json' \
--data-raw '{
    "order": {
        "amount": 10500,
        "invoice_number": "INV-{{$timestamp}}",
        "currency": "IDR",
        "session_id": "SU5WFDferd561dfasfasdfae123c",
        "callback_url": "https://doku.com/",
        "line_items": [
            {
                "name": "DOKU T-Shirt",
                "price": 10500,
                "quantity" : 1
            }
        ]
    },
    "payment": {
        "payment_due_date": 60
    },
    "customer": {
        "name": "Anton Budiman",
        "email": "anton@doku.com",
        "phone": "+6285694566147",
        "address": "Plaza Asia Office Park Unit 3",
        "country": "ID"
    }
}'

Responses

🟢200Success
application/json
Body
order
object 
required
amount
integer 
required
invoice_number
string 
required
currency
string 
required
session_id
string 
required
callback_url
string 
required
line_items
array [object {3}] 
required
payment
object 
required
payment_due_date
integer 
required
customer
object 
required
name
string 
required
email
string 
required
phone
string 
required
address
string 
required
country
string 
required
Example
{
    "order": {
        "amount": 10500,
        "invoice_number": "INV-{{$timestamp}}",
        "currency": "IDR",
        "session_id": "SU5WFDferd561dfasfasdfae123c",
        "callback_url": "https://doku.com/",
        "line_items": [
            {
                "name": "DOKU T-Shirt",
                "price": 10500,
                "quantity" : 1
            }
        ]
    },
    "payment": {
        "payment_due_date": 60
    },
    "customer": {
        "name": "Anton Budiman",
        "email": "anton@doku.com",
        "phone": "+6285694566147",
        "address": "Plaza Asia Office Park Unit 3",
        "country": "ID"
    }
}
🟠400Invalid Invoice Number
🔴500Server Error
Modified at 2025-07-21 11:08:33
Previous
Checkout Page
Next
Direct API
Built with