Alfa Group

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


Integration methods

There are two methods to integrate with Alfa Group:

  1. Register: The payment code will be registered to DOKU and Alfa will inquiry to our side when the customer make payment at the Alfa Store

    1. DOKU Generated Payment Code (DGPC): The payment code is generated by DOKU. Suitable for e-commerce business model.

    2. Merchant Generated Payment Code (MGPC): The payment code is generated by Merchant. Suitable for top up business model.

  2. Direct Inquiry (DIPC): The payment code is registered on merchant side and DOKU will forward Alfa inquiry request to merchant side when the customer make payment at the Alfa store

Integration steps

Here is the overview of how to integrate with Online to Offline:

  1. Generate payment code

  2. Display payment code

  3. Acknowledge payment result

1. Generate payment code

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

API Request

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

Client-Id: MCH-0001-10791114622547
Request-Id: d24a5644-6078-4249-8740-4a6dcd92df5a
Request-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=vl9DBTX5KhEiXmnpOD0TSm8PYQknuHPdyHSTSc3W6Ps=

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

{
    "order": {
        "invoice_number": "INV-20210124-0001",
        "amount": 150000
    },
    "online_to_offline_info": {
        "expired_time": 60,
        "reusable_status": false,
        "info": "Merchant Demo Store"
    },
    "customer": {
        "name": "Anton Budiman",
        "email": "anton@example.com"
    }
}

Request Body Explanation

API Response

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

Client-Id: MCH-0001-10791114622547
Request-Id: d24a5644-6078-4249-8740-4a6dcd92df5a
Response-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=9UPUFzOqJc47aJzD9ESOTcWg6TMsg3mqSP+DnUO8ENE=

Here is the sample of response body:

{
    "order": {
        "invoice_number": "INV-20210124-0001"
    },
    "online_to_offline_info": {
        "payment_code": "6059000000000205",
        "how_to_pay_page": "https://sandbox.doku.com/how-to-pay/v2/alfa-online-to-offline/6059000000000205",
        "how_to_pay_api": "https://api-sandbox.doku.com/alfa-online-to-offline/v2/how-to-pay-api/6059000000000205",
        "created_date": "20210331115005",
        "expired_date": "20210331125005",
        "created_date_utc": "2021-03-31T04:50:05Z",
        "expired_date_utc": "2021-03-31T05:50:05Z"
    }
}

Response Body Explanation

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, DOKU will send HTTP Notification to your defined Notification URL. Learn how to handle the notification from DOKU:


Additional features

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

Insurance Data

For insurance merchant, DOKU can show insurance data to Alfa POS and Alfa receipt by give object additional_info.insurance_info and also DOKU can show footer message on Alfa receipt by give alfa_info.receipt.footer_message to DOKU. Here is the sample:

{
    ...
    "alfa_info": {
        "receipt": {
            "footer_message":"Call Center 021 555-0525"
        }
    },
    "additional_info": {
        "insurance_info": {
            "policy_type": "Dana Pendidikan",
            "policy_number": "9090901234",
            "policy_account_name": "Taufik Ismail",
            "policy_status": "aktif",
            "bill_due_date": "21 May 2021"
        }
    },
    ...
}

Update and Cancel Payment Code Data

If you wish to update your payment code data such as, update the amount, update the expiry time, customer details, and etc. You can do that by hitting the API with PATCH method:

API Request

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

Client-Id: MCH-0001-10791114622547
Request-Id: 2dc5985e-adaa-4f82-b126-b09e9006da14
Request-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=vl9DBTX5KhEiXmnpOD0TSm8PYQknuHPdyHSTSc3W6Ps=

Request Header Explanation

Here is the sample of request body to update payment code data:

Cancel payment code data

To cancel a payment code, simply set online_to_offline_info.status to DELETE

{
    "order": {
        "invoice_number": "INV-20210124-0001",
        "amount": 150000
    },
    "online_to_offline_info": {
        "payment_code": "6059000000000205",
        "status": "ACTIVE",
        "expired_time": 60,
        "reusable_status": false,
        "info": "Thank you for shopping"
    },
    "customer": {
        "name": "Anton Budiman",
        "email": "anton@example.com"
    }
}

Request Body Explanation

API Response

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

Client-Id: MCH-0001-10791114622547
Request-Id: 09e0defe-a071-45b3-9feb-ac134374628c
Response-Timestamp: 2020-08-11T08:45:42Z
Signature: HMACSHA256=9UPUFzOqJc47aJzD9ESOTcWg6TMsg3mqSP+DnUO8ENE=

Response Header Explanation

Here is the sample of response body:

{
    "order": {
        "invoice_number": "INV-20210124-0001"
    },
    "online_to_offline_info": {
        "payment_code": "6059000000000205",
        "created_date": "20210331115005",
        "expired_date": "20210331125005",
        "created_date_utc": "2021-03-31T04:50:05Z",
        "expired_date_utc": "2021-03-31T05:50:05Z"
    }
}

Response Body Explanation

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.

Last updated