Alfa Group for Insurance Guide
DOKU has partnered with various partners and one of them is Alfa Group (Alfamart, Alfaexpress, Alfamidi, Lawson, Dan+Dan) to provide O2O Payment for Insurance. Learn more about how DOKU can help you integrate with Alfa Group here.
Integration steps
Here is the overview of how to integrate with O2O:
- Setup
Inquiry URL
- Generate payment code
- Receive inquiry request from DOKU
- Acknowledge payment result
Direct API - Alfa for Insurance Sequence Diagram

1. Setup Inquiry URL
To receive the inquiry request from DOKU. You must set your Inquiry URL
to DOKU. Please contact our team for the setup.
Please inform the Inquiry URL
for Sandbox environment and Production environment.
2. Generate Payment code
Generate payment is done in your system. The payment code length maximum is 20
digits.
3. Receive inquiry request from DOKU
API Request
DOKU will hits your Inquiry URL
with the following API request:
Type | Value |
---|---|
HTTP Method | POST |
Here is the sample of request header that DOKU generated for inquiry:
Client-Id: MCH-0001-10791114622547
Request-Id: 5b8e438f-fac1-4103-9e0e-ebfdc38b5acb
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 DOKU 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 verified on merchant Backend to ensure that the request is coming from DOKU. Please refer to this section to generate the signature |
Here is the sample of request body that DOKU will send to defined Inquiry URL
:
{
"service": {
"id": "ONLINE_TO_OFFLINE"
},
"acquirer": {
"id": "ALFA"
},
"channel": {
"id": "ONLINE_TO_OFFLINE_ALFA"
},
"online_to_offline_info": {
"payment_code": "8896512345678123"
},
"online_to_offline_inquiry": {
"date": "2020-08-11T08:45:42Z",
"identifier": [
{
"name": "AGENT_ID",
"value": "100001"
},
{
"name": "AGENT_STORE_ID",
"value": "10000232"
},
{
"name": "AGENT_TRX_ID",
"value": "c1aa04bf421e5b38c3d18933e9994d3f289def65"
}
]
}
}
Request Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
service.id | string | Mandatory | Value: ONLINE_TO_OFFLINE |
acquirer.id | string | Mandatory | Value: ALFA |
channel.id | string | Mandatory | Value: ONLINE_TO_OFFLINE_ALFA |
online_to_offline_info. payment_code | number | Mandatory | Payment code that is inquired by the customer |
online_to_offline_inquiry.date | string | Mandatory | Timestamp request on UTC time in ISO8601 format |
online_to_offline_inquiry.identifier | array | Optional | List of transaction identifier that coming from the acquiring. Merchant can save these data for reference |
API Response
After DOKU hits your Inquiry URL
with the above API request, you must give the following response:
Type | Value |
---|---|
HTTP Status for online_to_offline_inquiry.status = success | 200 |
HTTP Status for online_to_offline_inquiry.status = decline | 400 |
HTTP Status for online_to_offline_inquiry.status = billing_already_paid | 400 |
HTTP Status for online_to_offline_inquiry.status = billing_was_expired | 400 |
HTTP Status for online_to_offline_inquiry.status = billing_not_found | 404 |
Client-Id: MCH-0001-10791114622547
Request-Id: 5b8e438f-fac1-4103-9e0e-ebfdc38b5acb
Response-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=9UPUFzOqJc47aJzD9ESOTcWg6TMsg3mqSP+DnUO8ENE=
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 Merchant |
Signature | Signature generated by Merchant based on the response body. Please refer to this section to generate the signature |
Here is the sample of response body:
{
"order": {
"invoice_number": "INV-20210125-0001",
"amount": 150000
},
"online_to_offline_info": {
"payment_code": "8896512345678123",
"info": "Thank for shopping in our store"
},
"online_to_offline_inquiry": {
"status": "success"
},
"customer": {
"name": "Anton Budiman",
"email": "anton@example.com"
},
"alfa_info": {
"receipt": {
"footer_message":"Call Center 021 555-0525"
}
},
"additional_info": {
"insurance_info": {
"policy_type": "Dana Pendidikan",
"policy_number": "9090901234",
"policy_account_name": "Andreas",
"policy_status": "aktif",
"bill_due_date": "21 May 2021"
}
}
}
Response Body Explanation
Parameter | Type | Mandatory | Description |
---|---|---|---|
order.invoice_number | string | Mandatory | Generated by merchant to identify the order and must unique per request Allowed chars: alphabetic, numeric, special chars Max length: 64 |
order.amount | number | Mandatory | In IDR currency and without decimal Allowed chars: numeric Max length: 12 |
online_to_offline_info. payment_code | string | Mandatory | Same as the request |
online_to_offline_info.info | string | Optional | Additional info that will be display on the acquirer channel when customer do inquiry Allowed chars: alphabetic, numeric, special chars Max length: 32 |
online_to_offline_inquiry.status | string | Mandatory | Possible value: success , decline , billing_already_paid , billing_was_expired , billing_not_found |
customer.name | string | Mandatory | Customer name that will be displayed on acquirer channel when do inquiry Allowed chars: alphabetic, numeric, special chars Max length: 64 |
customer.email | string | Optional | Customer email Allowed chars: alphabetic, numeric, special chars Max length: 128 |
alfa_info.receipt. footer_message | string | Optional | Message that will be printed on the receipt as footer message that given to the customer 1 line contain 40 character (fix length)Max length: 120 |
additional_info | object | Optional | Merchant can send additional data through this parameter and will be get the data in the HTTP Notification |
4. Acknowledge payment result
After the payment is being made by your customer, DOKU will send HTTP Notification to your defined Notification URL
. Learn how to handle the notification from DOKU:
What's next?
You can test your payment through our Payment Simulator. Learn more here.