bri-direct-debit-recurring
To create the recurring payment, you will need to hit this API through your Backend:
API Request
Type | Value |
---|---|
HTTP Method | POST |
API endpoint (Sandbox) | https://api-sandbox.doku.com/direct-debit/v1/payment-recurring |
API endpoint (Production) | https://api.doku.com/direct-debit/v1/payment-recurring |
Here is the sample of request header to create the recurring payment:
Client-Id: MCH-0001-10791114622547
Request-Id: b6a465ea-bb65-48b2-a22b-3e8fb51cf22e
Request-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=vl9DBTX5KhEiXmnpOD0TSm8PYQknuHPdyHSTSc3W6Ps=
Request Header Explanation
Parameter | Description |
---|---|
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 create the recurring payment:
{
"customer": {
"id":"1232131321",
"name":"Jessica Tessalonika",
"email":"jessica@gmail.com",
"phone":"081287458232",
"id_card":"",
"country":"ID",
"address":"Jakarta, Menara Mulia Lt 8",
"date_of_birth":"08-09-1998",
"additional_info":""
},
"additional_info":{},
"order": {
"invoice_number":"MINV20201231468",
"line_items": [
{
"name": "bola",
"price": 10000,
"quantity": 1
},
{
"name": "ubi",
"price": 5000,
"quantity": 1
}
],
"amount": 15000,
"session_id":"session"
},
"payment": {
"token_id":"bcdbcdbcdbcbdbcdb-bcdbcd-bcdbcdb"
}
}
Request Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
customer.id | string | Mandatory | The customer ID that has been registered to DOKU Allowed chars: alphabetic, numeric, special chars Max Length: 50 |
customer.name | string | Optional | The customer name that has been registered to DOKU Allowed chars: alphabetic Max Length: 70 |
customer.email | string | Optional | Customer email Allowed chars: alphabetic, numeric, special chars Max Length: 64 |
customer.phone | string | Optional | Customer phone number. Format: {calling_code}{phone_number} . Example: 6281122334455Allowed chars: numeric Max Length: 20 |
customer.address | string | Optional | Customer address Allowed chars: alphabetic, numeric, special chars Max Length: 255 |
customer.country | string | Optional | 2 alphabetic country code ISO 3166-1 Allowed chars: alphabetic Min-max Length: 60 |
customer.id_card | string | Optional | Customer Identity Card number (KTP) for our risk engine assessment Allowed chars: alphabetic, numeric, special chars Max length: 20 |
customer.date_of_birth | string | Optional | Customer date of birth for our risk engine assesment Format: dd-MM-yyyy |
customer.additional_info | string | Optional | Customer additional info |
additional_info | string | Optional | additional info |
order.amount | number | Mandatory | In IDR Currency and without decimal Allowed chars: numeric Max length: 12 |
order.invoice_number | string | Mandatory | Generated by merchant to identify the order Allowed chars: alphabetic, numeric, special chars Max length: 64 |
order.line_items.name | string | Optional | Name of the product item Allowed chars: alphabetic, numeric, special chars |
order.line_items.price | number | Optional | Price of the product item. Total price and quantity must match with the order.amount Allowed chars: numeric |
order.line_items.quantity | number | Optional | Quantity of the product item Allowed chars: numeric |
order.session_id | string | Optional | Transaction session id |
payment.card_token | string | Mandatory | Token created from debit card data that linked to customer id (token id) |
API Response
After hitting the above API request, DOKU will give the response.
Type | Value |
---|---|
HTTP Status | 201 |
Result | CREATED |
Here is the sample response header:
Client-Id: MCH-0001-10791114622547
Request-Id: b6a465ea-bb65-48b2-a22b-3e8fb51cf22e
Response-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=1jap2tpgvWt83tG4J7IhEwUrwmMt71OaIk0oL0e6sPM=
Response Header Explanation
Parameter | Description |
---|---|
Client-Id | Same as the request |
Request-Id | Same as the request |
Response-Timestamp | Timestamp Response on UTC with format ISO8601 UTC+0 from DOKU |
Signature | Signature generated by DOKU based on the response body |
Here is the sample of response body:
{
"acquirer": {
"id":"BRI"
},
"customer": {
"id":"1232131321",
"name":"Jessica Tessalonika",
"email":"jessica@gmail.com",
"phone":"081287458232",
"id_card":"",
"country":"ID",
"address":"Jakarta, Menara Mulia Lt 8",
"date_of_birth":"",
"additional_info":""
},
"additional_info":{},
"order": {
"invoice_number":"MINV20201231468",
"line_items": [
{
"name": "bola",
"price": 10000,
"quantity": 1
},
{
"name": "ubi",
"price": 5000,
"quantity": 1
}
],
"amount": 15000,
"session_id":"session"
},
"payment": {
"payment_id":"123212313",
"token":"qweqweqwewqeqwdasdassad",
"status":"SUCCESS"
}
}
Response Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
acquirer.id | string | Mandatory | Bank Acquirer |
customer.id | string | Mandatory | Same as the request |
customer.name | string | Optional | Same as the request |
customer.email | string | Optional | Same as the request |
customer.phone | string | Optional | Same as the request |
customer.address | string | Optional | Same as the request |
customer.country | string | Optional | Same as the request |
customer.id_card | string | Optional | Same as the request |
customer.date_of_birth | string | Optional | Same as the request |
customer.additional_info | string | Optional | Same as the request |
additional_info | string | Optional | Same as the request |
order.amount | number | Mandatory | Same as the request |
order.invoice_number | string | Mandatory | Same as the request |
order.line_items.name | string | Optional | Same as the request |
order.line_items.price | number | Optional | Same as the request |
order.line_items.quantity | number | Optional | Same as the request |
order.session_id | string | Optional | Transaction session id |
payment.payment_id | string | Mandatory | Payment ID generated by Acquirer |
payment.token | string | Mandatory | Payment token generated by DOKU specific for the transaction |
payment.status | string | Mandatory | Payment status. In this state, it should be PENDING |