Alfa Group Guide

Jokul has partnered with various partners and one of them is Alfa Group (Alfamart, Alfamidi, Dan+Dan) to provide O2O Payment. Learn more about how Jokul can help you integrate with Alfa Group here.


Integration steps

Here is the overview how you integrate O2O:

  1. Generate payment code
  2. Display payment code
  3. Acknowledge payment result
Jokul Direct - O2O Sequence DiagramJokul Direct O2O Aggregator Merchant Flow

1. Generate payment code

To generate payment code, you will need to hit this API through your Backend:

API Request

TypeValue
HTTP MethodPOST
API endpoint (Sandbox)https://api-sandbox.doku.com/alfa-online-to-offline/v2/payment-code
API endpoint (Production)https://api.doku.com/alfa-online-to-offline/v2/payment-code

Here is the sample of request header to generate payment code:

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
ParameterDescription
Client-IdClient ID retrieved from Jokul Back Office
Request-IdUnique random string (max 128 characters) generated from merchant side to protect duplicate request
Request-TimestampTimestamp 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
SignatureSecurity 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 generate payment code:

{
"order": {
"invoice_number": "INV-20210125-0001",
"amount": 150000
},
"online_to_offline_info": {
"expired_time": 60,
"reusable_status": false,
"info": "Thank you for shopping"
},
"customer": {
"name": "Taufik Ismail",
"email": "taufik@example.com"
},
"alfa_info": {
"receipt": {
"footer_message": "Call Center 021 555-0525"
}
}
}
Request Body Explanation
ParameterTypeMandatoryDescription
order.invoice_numberstringMandatoryGenerated by merchant to identify the order and must unique per request
Allowed chars: alphabetic, numeric, special chars
Max length: 64
order.amountnumberMandatoryIn IDR currency and without decimal
Allowed chars: numeric
Max length: 12
online_to_offline_info.
expired_time
numberOptionalVirtual account expiration time in minutes format
Allowed chars: numeric
Maximum length: 5
Default value: 60
online_to_offline_info.
reusable_status
numberMandatoryFor VA that can be paid more than once, set this to true
Possible value: true false
online_to_offline_info.infostringOptionalAdditional info that will be display on the acquirer channel when customer do inquiry
Allowed chars: alphabetic, numeric, special chars
Max length: 32
customer.namestringMandatoryCustomer name that will be displayed on acquirer channel when do inquiry
Allowed chars: alphabetic, numeric, special chars
Max length: 64
customer.emailstringOptionalCustomer email
Allowed chars: alphabetic, numeric, special chars
Max length: 128
alfa_info.receipt.
footer_message
stringOptionalMessage 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

API Response

After hitting the above API request, Jokul will give the response.

TypeValue
HTTP Status200
ResultSUCCESS
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
ParameterDescription
Client-IdSame as the request
Request-IdSame as the request
Response-TimestampTimestamp Response on UTC with format ISO8601 UTC+0 from Jokul
SignatureSignature generated by Jokul based on the response body

Here is the sample of response body:

{
"order": {
"invoice_number": "INV-20210125-0001"
},
"online_to_offline_info": {
"payment_code": "73",
"created_date": "20210303230532",
"expired_date": "20210304054432",
"created_date_utc": "2021-03-03T16:05:32Z",
"expired_date_utc": "2021-03-03T22:44:32Z",
"how_to_pay_page": "https://app-uat.doku.com/how-to-pay/v2/alfa-online-to-offline/73",
"how_to_pay_api": "https://api-uat.doku.com/alfa-online-to-offline/v2/how-to-pay-api/73"
}
}
Response Body Explanation
ParameterTypeMandatoryDescription
order.invoice_numberstringMandatorySame as the request
online_to_offline_info.
payment_code
stringMandatoryGenerated by Jokul that will be used by customer for doing a payment through the Alfa Group Store
online_to_offline_info.created_datestringConditionalDate time of VA generated with the format of yyyyMMddHHmmss. The created date uses UTC+7 time
online_to_offline_info.expired_datestringConditionalDate time of VA will be expired with the format of yyyyMMddHHmmss. The expired date uses UTC+7 time. Use this to set the expiry order on your side
online_to_offline_info.created_date_utcstringConditionalDate time of VA generated in UTC format
online_to_offline_info.expired_date_utcstringConditionalDate time of VA will be expired in UTC. Use this to set the expiry order on your side
online_to_offline_info.how_to_pay_pagestringOptionalPage URL that merchant can use to display how customer can complete the payment process through the Alfa Group Store
online_to_offline_info.how_to_pay_apistringOptionalURL that merchant can parse to display customized how customer can complete the payment process through the Alfa Group Store
Pro Tips

You can also show payment instruction link to your customer by using online_to_offline_info.how_to_pay_page. If you wish to customize the UI for the payment instruction, you can use the online_to_offline_info.how_to_pay_api.


2. Display payment code

You can display the payment code to your customer by using online_to_offline_info.payment_code that you retrieved from the API response.


3. Acknowledge payment result

After the payment is being made by your customer, Jokul will send HTTP Notification to your defined Notification URL. Learn how to handle the notification from Jokul:


Advanced features

We provide various advanced features to suited your needs. Learn more here.

Jokul Hub - Split Settlement

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.


What's next?

You can test your payment through our Payment Simulator. Learn more here.