Payment Page Integration Guide
Last updated
Last updated
DOKU API
Legacy DocumentationIf you are non-PCI DSS compliance, you can use this type of integration to ensure that the Cards data of the customer is securely processed by DOKU.
Here is the overview of how to integrate with Cards channel:
Generate payment URL (Cards payment page)
Display payment URL (Cards payment page)
Create test payment
Acknowledge payment result
To generate a payment URL, you will need to hit this API through your backend:
API Request
Here is the sample of request header to generate the payment URL:
Here is the sample request body to generate payment URL:
Payment Type
Sale: A transaction where funds are immediately transferred from the customer's account to the merchant's account.
Authorize-Capture: A two-step transaction where funds are first reserved (authorized) and later transferred (captured) from the customer's account to the merchant's account.
Installment: A transaction where the total amount is split into multiple smaller payments over a specified period.
MOTO (Mail Order/Telephone Order): A transaction where payment does not require CVV or OTP, suitable for subscription payment type.
Recurring: A transaction where payment does not require CVV or OTP, suitable for subscription payment type, with the latest specification more secure compared to MOTO.
API Response
After hitting the above API request, DOKU will give the response.
Here is the sample response header:
Here is the sample of response body:
INFO
DOKU provides risk assessment for card transactions, your customer data sent to us will help manage your risk of every transaction.
You can display the payment URL as an iFrame or as a dedicated page to your customer by using credit_card_payment_page.url
the retrieved from API Response. Here is the sample of Cards on the iFrame:
You can try the payment with various Cards listed here:
After the payment is made by your customer, DOKU will send HTTP Notification to your defined Notification URL
. Learn how to handle the notification from DOKU:
INFO
You can check the list of possible response code and how to handle them here
We provide various additional features to suit your needs. Learn more here.
If you bring payment.type ='AUTHORIZATION'
you need to capture the transaction within 7 days to have the amount actually transferred to your settlement balance.
After you get the payment.authorize_id
in notification HTTP, then your backend must trigger the API Charge to DOKU:
API Request
Here is the sample of request header to capture the transaction:
Here is the sample request body to capture the transaction:
Request Body Explanation
API Response
After hitting the above API request, DOKU will give the response.
Here is the sample response header:
Here is the sample of response body:
Response Body Explanation
You can request void or refund using this API, or via the Dashboard .
Requirement
If you are using Cards Aggregator service, you can process Void or Refund.
If you are using Cards Direct service, please consult with your acquiring bank to learn more about whether your credential (MID) supports online refund or not, otherwise refund will be processed manually.
To request a refund, you will need to hit this API through your backend:
API Request
Here is the sample of request header to generate payment URL:
Request Header Explanation
Here is the sample request body to request a refund:
Request Body Explanation
API Response
After hitting the above API request, DOKU will give the response.
Here is the sample response header:
Response Header Explanation
Here is the sample of response body:
Response Body Explanation
Refund Type
Online Refund
Amount will be returned automatically by system to customer's balance
VOID: If the funds has not settled to your bank account. The refund.amount
must equal to order.amount
, otherwise will fail
PARTIAL_REFUND: If the funds has settled to your bank account, and the refund.amount
is less than order.amount
FULL_REFUND: If the funds has settled to your bank account, and the refund.amount
is equal to order.amount
Manual Refund
Amount will be processed manually by DOKU's Refund Ops, may take longer than Online Refund to process
MANUAL_PARTIAL_REFUND: If the funds has settled to your bank account, and the refund.amount
is less than order.amount
MANUAL_FULL_REFUND: If the funds has settled to your bank account, and the refund.amount
is equal to order.amount
Installment ON US
BCA, Bank Mandiri, BNI only allow for ON US Installment. You must request an Installment MID from each respective acquirer.
Installment OFF US
Bukopin, Danamon, Permata, HSBC, OCBC allows OFF US Installment. you must have at least one SALE MID.
You can activate installment features on Service Activation page to let your customers pay in terms, you will receive full payment ahead and issuer Bank will charge the customer each month depending on tenor and amount of the transaction.
There are minimal transaction amounts for each installment (depending on the issuer) and you can see the details in the installment configuration page.
Testing Installment Payment
If you wish to try installment, make sure that you specific bank dummy credit card presented here and make sure that your transaction amount is equal to more than the minimum transaction required
Want to make your checkout experience faster? You can combine this integration with the Tokenization, so the next time your customers purchase, they don't need to input the credit card anymore.
Tokenization
Unbind Token
If you want to unbind the token, you can use the delete tokenization API below :
API Request
Here is the sample of request header to capture the transaction:
Request Header Explanation
Here is the sample request body to unbind the token:
Request Body Explanation
API Response
After hitting the above API request, DOKU will give the response.
Here is the sample response header:
Response Header Explanation
Here is the sample of response body:
Response Body Explanation
Info
To make sure the token has been unbinded, you can hit API Get token List.
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.
Make a test payment in the Sandbox environment using the dummy credit card that we have prepared to ensure that your application has been successfully integrated.
Type | Value |
---|---|
Parameter | Description |
---|---|
Body Parameter | Type` | Mandatory | Description |
---|---|---|---|
Type | Value |
---|---|
Parameter | Description |
---|---|
Body Parameter | Type | Mandatory | Description |
---|---|---|---|
Type | Value |
---|---|
Parameter | Description |
---|---|
Parameter | Type | Mandatory | Description |
---|---|---|---|
Type | Value |
---|---|
Parameter | Description |
---|---|
Parameter | Type | Mandatory | Description |
---|---|---|---|
Type | Value |
---|---|
Parameter | Description |
---|---|
Parameter | Type | Mandatory | Description |
---|---|---|---|
Type | Value |
---|---|
Parameter | Description |
---|---|
Parameter | Type | Mandatory | Description |
---|---|---|---|
Type | Value |
---|---|
Parameter | Description |
---|---|
Parameter | Type | Mandatory | Description |
---|---|---|---|
Type | Value |
---|---|
Parameter | Description |
---|---|
Parameter | Type | Mandatory | Description |
---|---|---|---|