# CIMB Direct Debit

## Integration Steps

Overview of integration process with CIMB Direct Debit.

1. [Account Binding](#account-binding)
2. [OTP Verification](#otp-verification)
3. [Payment](#payment)
4. [Payment Notification](#payment-notification)
5. [Additional Feature](#additional-feature)

***

### 1. Account Binding

Account Binding process should be done before payment can be made and processed. Merchant will send account binding request from customer to DOKU. The request includes customer's phone number that is registered to customer's CIMB account.&#x20;

Each CIMB account can only be bind to one customer on one merchant. Customer needs to do verification for account binding process by inputting OTP and PIN.

**Account Binding Flow**

<figure><img src="/files/SO3BLIq4ATdTkYPRN7WQ" alt=""><figcaption><p>Account Binding Flow - CIMB Direct Debit</p></figcaption></figure>

#### API Endpoint

<table><thead><tr><th width="164">Environment</th><th>Endpoint</th></tr></thead><tbody><tr><td>HTTP Method</td><td>POST</td></tr><tr><td>API Sandbox</td><td><a href="https://api-sandbox.doku.com">https://api-sandbox.doku.com</a></td></tr><tr><td>API Production</td><td><a href="https://api.doku.com">https://api.doku.com</a></td></tr><tr><td>Path</td><td><code>.../direct-debit/core/v1/registration-account-binding</code></td></tr></tbody></table>

**Sample of Request Header, Request Body and Response Body**

Notes:&#x20;

Parameter with (\*) is mandatory&#x20;

Paramater without (\*) is optional/conditional

{% openapi src="/files/rnxmMV6SJqb1nQ7U4ubV" path="/direct-debit/core/v1/registration-account-binding" method="post" %}
[swagger-dd-cimb.yaml](https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FoaZjG6E2dlA3zWziRLWu%2Fswagger-dd-cimb.yaml?alt=media\&token=bd3e1cb6-3aa3-44c9-a2a7-783ac2347aff)
{% endopenapi %}

### 2. Payment&#x20;

After customer's account is bind/linked and customer has enough balance for payment, merchant can send payment request from customer to DOKU by bringing customer's token.&#x20;

**Payment Flow**

<figure><img src="/files/xzEoVqnAnovtRlGjl9aQ" alt=""><figcaption><p>Payment Flow - CIMB Direct Debit</p></figcaption></figure>

#### API Endpoint

<table><thead><tr><th width="176">Environment</th><th>Endpoint</th></tr></thead><tbody><tr><td>HTTP Method</td><td>POST</td></tr><tr><td>API Sandbox</td><td><a href="https://api-sandbox.doku.com">https://api-sandbox.doku.com</a></td></tr><tr><td>API Production</td><td><a href="https://api.doku.com">https://api.doku.com</a></td></tr><tr><td>Path</td><td><code>.../direct-debit/core/v1/debit/payment-host-to-host</code></td></tr></tbody></table>

**Sample of Request Header, Request Body and Response Body**

Notes:&#x20;

Parameter with (\*) is mandatory&#x20;

Paramater without (\*) is optional/conditional

{% openapi src="/files/iG397Dhs1cKknEnB2sYC" path="/direct-debit/core/v1/debit/payment-host-to-host" method="post" %}
[swagger-dd-cimb.yaml](https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FYMVUtwk7I7eHMu7pZn6P%2Fswagger-dd-cimb.yaml?alt=media\&token=df89af0b-adc4-4794-8e21-227fbbf818d2)
{% endopenapi %}

### 3. OTP Verification

Once customer has submitted their payment request along with the OTP, merchant needs to verify the payment. Merchant can hit this API to verify the OTP.&#x20;

**OTP Verification Flow**

<figure><img src="/files/dWgHn2hE8mpe9sduoJx4" alt=""><figcaption><p>OTP Verification Flow - CIMB Direct Debit</p></figcaption></figure>

#### API Endpoint

<table><thead><tr><th width="181">Environment</th><th>Endpoint</th></tr></thead><tbody><tr><td>HTTP Method</td><td>POST</td></tr><tr><td>API Sandbox</td><td><a href="https://api-sandbox.doku.com">https://api-sandbox.doku.com</a></td></tr><tr><td>API Production</td><td><a href="https://api.doku.com">https://api.doku.com</a></td></tr><tr><td>Path</td><td><code>.../direct-debit/core/v1/otp-verification</code></td></tr></tbody></table>

**Sample of Request Header, Request Body and Response Body**

Notes:&#x20;

Parameter with (\*) is mandatory&#x20;

Paramater without (\*) is optional/conditional

{% openapi src="/files/1cHpbRZzyZpsGkkZkP02" path="/direct-debit/core/v1/otp-verification" method="post" %}
[swagger-dd-cimb.yaml](https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2Fa2lNAyKJtxpw5GljSCr5%2Fswagger-dd-cimb.yaml?alt=media\&token=59c23421-e5d3-45fc-ac3e-55eb32e3818c)
{% endopenapi %}

### 4. Payment Notification

After payment is completed, DOKU will send **HTTP Notification** to merchant's defined `Notification URL`.  Learn how to [handle the notification from DOKU](/get-started-with-doku-api/notification.md).

### 5. Additional Feature

### Online Refund

This endpoint is used to create refund request for previous successful payment. Merchant can request a transaction refund to DOKU. Full refund and partial refund are available to be requested.

**Online Refund Flow**

<figure><img src="/files/19LtMmU2HX8P149hythn" alt=""><figcaption><p>Online Refund Flow - CIMB Direct Debit</p></figcaption></figure>

#### API Endpoint

<table><thead><tr><th width="181">Environment</th><th>Endpoint</th></tr></thead><tbody><tr><td>HTTP Method</td><td>POST</td></tr><tr><td>API Sandbox</td><td><a href="https://api-sandbox.doku.com">https://api-sandbox.doku.com</a></td></tr><tr><td>API Production</td><td><a href="https://api.doku.com">https://api.doku.com</a></td></tr><tr><td>Path</td><td><code>.../direct-debit/core/v1/debit/refund</code></td></tr></tbody></table>

**Sample of Request Header, Request Body and Response Body**

Notes:&#x20;

Parameter with (\*) is mandatory&#x20;

Paramater without (\*) is optional/conditional

{% openapi src="/files/doE0ebC649DwswCHSJaV" path="/direct-debit/core/v1/debit/refund" method="post" %}
[swagger-dd-cimb.yaml](https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FxifX9PuFGLc7XdfhueHb%2Fswagger-dd-cimb.yaml?alt=media\&token=3cf1de7f-55c6-442e-bbfa-c5fc634154f0)
{% endopenapi %}

### Account Unbinding

If a registered customer no longer wants their account/card to be bind/linked and wish to remove themself from DOKU's and merchant’s system, merchant can send account unbinding request that is initiated by customer.

#### API Endpoint&#x20;

<table><thead><tr><th width="178">Environment</th><th>Endpoint</th></tr></thead><tbody><tr><td>HTTP Method</td><td>POST</td></tr><tr><td>API Sandbox</td><td><a href="https://api-sandbox.doku.com">https://api-sandbox.doku.com</a></td></tr><tr><td>API Production</td><td><a href="https://api.doku.com">https://api.doku.com</a></td></tr><tr><td>Path</td><td><code>.../direct-debit/v1/registration-account-unbinding</code></td></tr></tbody></table>

**Sample of Request Header, Request Body and Response Body**

Notes:&#x20;

Parameter with (\*) is mandatory&#x20;

Paramater without (\*) is optional/conditional&#x20;

{% openapi src="/files/oJ7TDZAO04VxuixyyUZo" path="/direct-debit/core/v1/registration-account-unbinding" method="post" %}
[swagger-dd-cimb.yaml](https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2Fk6E1l2ZgQKzmDRLsGA1v%2Fswagger-dd-cimb.yaml?alt=media\&token=d2053c91-a82c-422d-be16-546f4c36865c)
{% endopenapi %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.doku.com/accept-payments/direct-api/snap/integration-guide/direct-debit/cimb-direct-debit.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
