Backend Integration
Last updated
Last updated
DOKU API
Legacy DocumentationTo obtain the payment.url
, you will need to hit this API through your Backend :
Type | Value |
---|---|
Here is the sample of request header to obtain payment.url
:
Client-Id: MCH-0001-10791114622547
Request-Id: fdb69f47-96da-499d-acec-7cdc318ab2fe
Request-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=1jap2tpgvWt83tG4J7IhEwUrwmMt71OaIk0oL0e6sPM=
Parameter | Description |
---|---|
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": 20000,
"invoice_number": "INV-20210231-0001"
},
"payment": {
"payment_due_date": 60
}
}
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": {
"amount": 80000,
"invoice_number": "INV-{{$timestamp}}",
"currency": "IDR",
"callback_url": "http://merchantcallbackurl.domain/",
"callback_url_cancel": "https://merchantcallbackurl-cancel.domain",
"callback_url_result": "https://merchantcallbackurl-cancel.domain",
"language":"EN",
"auto_redirect":true,
"disable_retry_payment" :true,
"line_items": [
{
"id":"001",
"name":"Fresh flowers",
"quantity":1,
"price":40000,
"sku": "FF01",
"category": "gift-and-flowers",
"url": "http://item-url.domain/",
"image_url":"http://image-url.domain/",
"type":"ABC"
},
{
"id":"002",
"name":"T-shirt",
"quantity":1,
"price":40000,
"sku": "T01",
"category": "clothing",
"url": "http://item-url.domain/",
"image_url":"http://image-url.domain/",
"type":"ABC"
}
]
},
"payment": {
"payment_due_date": 60,
"type" : "SALE",
"payment_method_types": [
"VIRTUAL_ACCOUNT_BCA",
"VIRTUAL_ACCOUNT_BANK_MANDIRI",
"VIRTUAL_ACCOUNT_BANK_SYARIAH_MANDIRI",
"VIRTUAL_ACCOUNT_DOKU",
"VIRTUAL_ACCOUNT_BRI",
"VIRTUAL_ACCOUNT_BNI",
"VIRTUAL_ACCOUNT_BANK_PERMATA",
"VIRTUAL_ACCOUNT_BANK_CIMB",
"VIRTUAL_ACCOUNT_BANK_DANAMON",
"ONLINE_TO_OFFLINE_ALFA",
"CREDIT_CARD",
"DIRECT_DEBIT_BRI",
"EMONEY_SHOPEEPAY",
"EMONEY_OVO",
"EMONEY_DANA",
"QRIS",
"PEER_TO_PEER_AKULAKU",
"PEER_TO_PEER_KREDIVO",
"PEER_TO_PEER_INDODANA"
]
},
"customer":{
"id":"JC-01",
"name":"Zolanda",
"last_name":"Anggraeni",
"phone":"628121212121",
"email": "zolanda@example.com",
"address":"taman setiabudi",
"postcode":"120129",
"state":"Jakarta",
"city":"Jakarta Selatan",
"country":"ID"
},
"shipping_address":{
"first_name":"Joe",
"last_name":"Doe",
"address":"Jalan DOKU no 15",
"city":"Jakarta",
"postal_code":"11923",
"phone":"081312345678",
"country_code":"IDN"
},
"billing_address":{
"first_name":"Joe",
"last_name":"Doe",
"address":"Jalan DOKU no 15",
"city":"Jakarta",
"postal_code":"11923",
"phone":"081312345678",
"country_code":"IDN"
},
"additional_info":{
"allow_tenor" : [0,3,6,12],
"doku_wallet_notify_url" : "https://dw-notification.merchantdomain",
"override_notification_url": "https://another.example.com/payments/notifications"
}
}
Request Body Explanation
{
"order": {
"amount": 80000,
"invoice_number": "INV-{{$timestamp}}",
"currency": "IDR",
"callback_url": "http://merchantcallbackurl.domain/",
"callback_url_cancel": "https://merchantcallbackurl-cancel.domain",
"callback_url_result": "https://merchantcallbackurl-cancel.domain",
"language":"EN",
"auto_redirect":true,
"disable_retry_payment" :true,
"line_items": [
{
"id":"001",
"name":"Fresh flowers",
"quantity":1,
"price":40000,
"sku": "FF01",
"category": "gift-and-flowers",
"url": "http://item-url.domain/",
"image_url":"http://image-url.domain/",
"type":"ABC"
},
{
"id":"002",
"name":"T-shirt",
"quantity":1,
"price":40000,
"sku": "T01",
"category": "clothing",
"url": "http://item-url.domain/",
"image_url":"http://image-url.domain/",
"type":"ABC"
}
]
}
"payment": {
"payment_due_date": 60,
"type" : "SALE/INSTALLMENT/AUTHORIZE",
"payment_method_types": [
"VIRTUAL_ACCOUNT_BCA",
"VIRTUAL_ACCOUNT_BANK_MANDIRI",
"VIRTUAL_ACCOUNT_BANK_SYARIAH_MANDIRI",
"VIRTUAL_ACCOUNT_DOKU",
"VIRTUAL_ACCOUNT_BRI",
"VIRTUAL_ACCOUNT_BNI",
"VIRTUAL_ACCOUNT_BANK_PERMATA",
"VIRTUAL_ACCOUNT_BANK_CIMB",
"VIRTUAL_ACCOUNT_BANK_DANAMON",
"ONLINE_TO_OFFLINE_ALFA",
"CREDIT_CARD",
"DIRECT_DEBIT_BRI",
"EMONEY_SHOPEEPAY",
"EMONEY_OVO",
"QRIS",
"PEER_TO_PEER_AKULAKU",
"PEER_TO_PEER_KREDIVO",
"PEER_TO_PEER_INDODANA"
]
}
"customer":{
"id":"JC-01",
"name":"Zolanda",
"last_name":"Anggraeni",
"phone":"628121212121",
"email": "zolanda@example.com",
"address":"taman setiabudi",
"postcode":"120129",
"state":"Jakarta",
"city":"Jakarta Selatan",
"country":"ID"
}
"shipping_address":{
"first_name":"Joe",
"last_name":"Doe",
"address":"Jalan DOKU no 15",
"city":"Jakarta",
"postal_code":"11923",
"phone":"081312345678",
"country_code":"IDN"
}
"billing_address":{
"first_name":"Joe",
"last_name":"Doe",
"address":"Jalan DOKU no 15",
"city":"Jakarta",
"postal_code":"11923",
"phone":"081312345678",
"country_code":"IDN"
}
"additional_info":{
"allow_tenor" : [0,3,6,12],
"doku_wallet_notify_url" : "https://dw-notification.merchantdomain",
"override_notification_url": "https://another.example.com/payments/notifications"
}
Success Response
{
"message": [
"SUCCESS"
],
"response": {
"order": {
"amount": "20000",
"invoice_number": "INV-20210231-0001",
"currency": "IDR",
"session_id": "2ebffd22d23e436895ce5c38f7ddcf86"
},
"payment": {
"payment_method_types": [
"JENIUS_PAY",
"ONLINE_TO_OFFLINE_ALFA",
"OCTO_CLICKS",
"PEER_TO_PEER_KREDIVO",
"VIRTUAL_ACCOUNT_BCA",
"CREDIT_CARD",
"EMONEY_OVO",
"ONLINE_TO_OFFLINE_INDOMARET",
"EMONEY_DOKU",
"VIRTUAL_ACCOUNT_BANK_MANDIRI",
"EPAY_BRI",
"PEER_TO_PEER_INDODANA",
"VIRTUAL_ACCOUNT_BRI",
"EMONEY_LINKAJA",
"EMONEY_SHOPEE_PAY",
"VIRTUAL_ACCOUNT_BNI",
"VIRTUAL_ACCOUNT_BANK_PERMATA",
"VIRTUAL_ACCOUNT_DOKU",
"VIRTUAL_ACCOUNT_BANK_CIMB",
"VIRTUAL_ACCOUNT_BANK_DANAMON",
"VIRTUAL_ACCOUNT_BANK_SYARIAH_MANDIRI",
"VIRTUAL_ACCOUNT_MAYBANK",
"DIRECT_DEBIT_CIMB",
"EMONEY_DANA",
"DIRECT_DEBIT_BRI",
"DIRECT_DEBIT_ALLO",
"PEER_TO_PEER_BRI_CERIA",
"VIRTUAL_ACCOUNT_BNC",
"PERMATA_NET",
"KLIKPAY_BCA",
"VIRTUAL_ACCOUNT_BTN",
"DANAMON_ONLINE_BANKING",
"VIRTUAL_ACCOUNT_SINARMAS"
],
"payment_due_date": 60,
"token_id": "2ebffd22d23e436895ce5c38f7ddcf8620244712094712362",
"url": "https://sandbox.doku.com/checkout-link-v2/2ebffd22d23e436895ce5c38f7ddcf8620244712094712362",
"expired_date": "20240712104711"
},
"additional_info": {
"origin": {
"product": "CHECKOUT",
"system": "mid-jokul-checkout-system",
"apiFormat": "JOKUL",
"source": "direct"
}
},
"uuid": 2225240712094712339107164227041411929328,
"headers": {
"request_id": "ed06da30-bbbc-4e90-a3c7-390c24476cb9",
"signature": "HMACSHA256=cyoua5cA6DR5mG/4vw3ice48KjCX+CGdLdSfMumJUuo=",
"date": "2024-07-12T02:47:11Z",
"client_id": "BRN-0214-1714016624673"
}
}
}
{
"message": [
"SUCCESS"
],
"response": {
"order": {
"amount": "80000",
"invoice_number": "INV-1720752332",
"currency": "IDR",
"session_id": "5f6304ca900144c7a4fcf802ad6c0898",
"callback_url": "http://merchantcallbackurl.domain/",
"callback_url_cancel": "https://merchantcallbackurl-cancel.domain",
"callback_url_result": "https://merchantcallbackurl-cancel.domain",
"line_items": [
{
"name": "Fresh flowers",
"quantity": 1,
"price": "40000",
"sku": "FF01",
"category": "gift-and-flowers",
"url": "http://item-url.domain/",
"image_url": "http://image-url.domain/",
"type": "ABC"
},
{
"name": "T-shirt",
"quantity": 1,
"price": "40000",
"sku": "T01",
"category": "clothing",
"url": "http://item-url.domain/",
"image_url": "http://image-url.domain/",
"type": "ABC"
}
],
"language": "EN",
"disable_retry_payment": true,
"auto_redirect": true
},
"payment": {
"payment_method_types": [
"EMONEY_OVO",
"ONLINE_TO_OFFLINE_ALFA",
"PEER_TO_PEER_KREDIVO",
"VIRTUAL_ACCOUNT_BCA",
"CREDIT_CARD",
"VIRTUAL_ACCOUNT_BANK_MANDIRI",
"VIRTUAL_ACCOUNT_BRI",
"PEER_TO_PEER_INDODANA",
"VIRTUAL_ACCOUNT_BNI",
"VIRTUAL_ACCOUNT_BANK_PERMATA",
"VIRTUAL_ACCOUNT_DOKU",
"VIRTUAL_ACCOUNT_BANK_CIMB",
"VIRTUAL_ACCOUNT_BANK_DANAMON",
"VIRTUAL_ACCOUNT_BANK_SYARIAH_MANDIRI",
"EMONEY_DANA",
"DIRECT_DEBIT_BRI"
],
"payment_due_date": 60,
"token_id": "5f6304ca900144c7a4fcf802ad6c089820244512094533497",
"url": "https://sandbox.doku.com/checkout-link-v2/5f6304ca900144c7a4fcf802ad6c089820244512094533497",
"expired_date": "20240712104531"
},
"customer": {
"id": "JC-01",
"state": "Jakarta",
"city": "Jakarta Selatan",
"postcode": "120129",
"email": "zolanda@example.com",
"phone": "628121212121",
"name": "Zolanda",
"last_name": "Anggraeni",
"address": "taman setiabudi",
"country": "ID"
},
"additional_info": {
"allow_tenor": [
0,
3,
6,
12
],
"doku_wallet_notify_url": "https://dw-notification.merchantdomain/",
"origin": {
"product": "CHECKOUT",
"system": "mid-jokul-checkout-system",
"source": "direct",
"apiFormat": "JOKUL"
},
"line_items": [
{
"quantity": 1,
"price": "40000",
"image_url": "http://image-url.domain/",
"name": "Fresh flowers",
"sku": "FF01",
"category": "gift-and-flowers",
"type": "ABC",
"url": "http://item-url.domain/"
},
{
"quantity": 1,
"price": "40000",
"image_url": "http://image-url.domain/",
"name": "T-shirt",
"sku": "T01",
"category": "clothing",
"type": "ABC",
"url": "http://item-url.domain/"
}
],
"override_notification_url": "https://another.example.com/payments/notifications"
},
"uuid": 2225240712094533483107164227326411817850,
"headers": {
"request_id": "0521fe4d-bd69-4626-9c5c-fc484b81b8bc",
"signature": "HMACSHA256=eT5aE//GhxqrRvx/XHdV/z2KezkyD6V3EJPHTEv4x8g=",
"date": "2024-07-12T02:45:31Z",
"client_id": "BRN-0214-1714016624673"
},
"shipping_address": {
"address": "Jalan DOKU no 15",
"city": "Jakarta",
"phone": "081312345678",
"first_name": "Joe",
"last_name": "Doe",
"postal_code": "11923",
"country_code": "IDN"
},
"billing_address": {
"address": "Jalan DOKU no 15",
"city": "Jakarta",
"phone": "081312345678",
"first_name": "Joe",
"last_name": "Doe",
"postal_code": "11923",
"country_code": "IDN"
}
}
}
Response Body Explanation
Failed Response
{
"error_messages": [
"order.invoice_number must be filled",
"order.amount must greater than 0"
]
}
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.
Body Parameter | Type | Mandatory | Description |
---|---|---|---|
Body Parameter | Description |
---|---|
Body Parameter | Type` | Mandatory | Description |
---|---|---|---|
Body parameter | Type | Mandatory | Description |
---|---|---|---|
Body parameter | Type | Mandatory | Description |
---|---|---|---|
Body Parameter | Type | Mandatory | Description |
---|---|---|---|
Body Parameter | Type | Mandatory | Description |
---|---|---|---|
Body parameter | Type | Mandatory | Description |
---|---|---|---|
Type | Value |
---|---|
Body Parameter | Type | Mandatory | Description |
---|---|---|---|
Type | Value |
---|---|
No | Category |
---|---|