# Mandiri Direct Debit

## Integration Steps

Overview of integration process with Mandiri Direct Debit

1. [Card Registration](#id-1.-card-registration)
2. [OTP Verification & Request](#id-2.-otp-verification-and-request)
3. [Payment](#id-3.-payment)
4. [Payment Notification](#id-4.-payment-notification)
5. [Additional Feature](#id-5.-additional-feature)

***

### 1. Card Registration

Card Registration process should be done before payment can be made and processed. Merchant will send card registration request from customer to DOKU. The request includes customer's card number that is registered to customer's Mandiri account.&#x20;

Each card/account can only be registered/bind to one customer on one merchant. Customer needs to verify OTP and input PIN to register the card.

**CBC Encryption**

To request card registration process, merchant requires to bring object cardData which value should be encrypted using CBC Algorithm.

CBC Encryption - Steps:

1. **Prepare shared key from DOKU as Secret Key**

   * Substring shared key only 16 digits
   * Example code:

   ```json
   private String getSharedKey(String sharedKey) {
       if (sharedKey.length() != 16) {
   sharedKey = sharedKey.length() > 16 ? sharedKey.substring(0, 16) : String.format("%-16s", sharedKey).replace(' ', '-');
       }
       return sharedKey;
   }
   ```
2. **Generate Initial Value (IV)**

   * Generate initial value with 16 bytes and then encode using Base 64
   * Example code:

   ```json
   byte[] iv = new byte[16];
   new SecureRandom().nextBytes(iv);
   IvParameterSpec ivParameterSpec = new IvParameterSpec(iv);
   String ivString = Base64.getEncoder().encodeToString(ivParameterSpec.getIV());
   ```
3. **Using Cipher CBC**

   * Value that will be encrypted combine with secret key generated before
   * After that encode the value using Base 64
   * Example code:

   ```json
   Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); //NOSONAR
   cipher.init(Cipher.ENCRYPT_MODE, key, ivParameterSpec);
   byte[] cipherText = cipher.doFinal(input.getBytes());
   String cipherString = Base64.getEncoder().encodeToString(cipherText);
   ```
4. **Combine CBC and IV**

   * Combine value CBC Cipher with IV value with separator (|)
   * Example code:

   <pre class="language-json"><code class="lang-json"><strong>String value = cipherString + "|" + ivString;
   </strong></code></pre>

Tools Using Java - Steps:

* Install JDK 17
* Go to folder
* Run with command java -jar cbc-tools.jar
* Input Value that you wish to be encrypted
* Input Key to encrypt&#x20;

Example Value:

(It should be minified)

```
{"bankCardNo":"4097662150169210","expiryDate":"2909"}
```

{% file src="/files/hIIYe2U7QDX432zkl8xy" %}
CBC Tools for Card Encryption
{% endfile %}

**Card Registration Flow**

<figure><img src="/files/SO3BLIq4ATdTkYPRN7WQ" alt=""><figcaption><p>Card Registration Flow - Mandiri Direct Debit</p></figcaption></figure>

#### API Endpoint

<table><thead><tr><th width="184">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-card-bind</code></td></tr></tbody></table>

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

Notes:&#x20;

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

Parameter without (\*) is optional/conditional

## POST /direct-debit/core/v1/registration-card-bind

> Register Card for Direct Debit Mandiri SNAP

```json
{"openapi":"3.0.3","info":{"title":"Direct Debit Mandiri SNAP","version":"1.0.11"},"servers":[{"url":"https://{api-domain}"}],"paths":{"/direct-debit/core/v1/registration-card-bind":{"post":{"summary":"Register Card for Direct Debit Mandiri SNAP","parameters":[{"in":"header","name":"X-TIMESTAMP","schema":{"type":"string","format":"utc timestamp"},"required":true,"description":"Customer's current local time in yyyy-MM- ddTHH:mm:ssTZD format"},{"in":"header","name":"X-SIGNATURE","schema":{"type":"string"},"description":"Algorithm symmetric signature HMAC_SHA512 (clientSecret, stringToSign)","required":true},{"in":"header","name":"X-PARTNER-ID","schema":{"type":"string"},"required":true,"description":"Unique ID for a partner (DOKU'S Client ID)"},{"in":"header","name":"X-EXTERNAL-ID","schema":{"type":"string"},"required":true,"description":"Numeric String. Reference number that should be unique in the same day (request-id)"},{"in":"header","name":"CHANNEL-ID","schema":{"type":"string"},"required":false,"description":"Enum: DH/H2H (Default: DH) | Max: 3"},{"in":"header","name":"Authorization","schema":{"type":"string","description":"Access Token obtained from Get B2B Token API"},"required":true,"description":"Access Token obtained from Get B2B Token API | Go to [here](https://dokucom.gitbook.io/api-reference/direct-api/get-token-api/b2b) for detailed documentation"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindingRequest"}}}},"responses":{"200":{"description":"Successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindingResponse"}}}}}}}},"components":{"schemas":{"BindingRequest":{"type":"object","required":["cardData","custIdMerchant","additionalInfo"],"properties":{"cardData":{"type":"string","description":"Format Object: {\n  \"bankCardNo\": \"13763689649826892\",\n  \"expiryDate\": \"0129\"\n} Encrypt using CBC Algorithm Value: encryptedValue + ivString"},"custIdMerchant":{"type":"string","description":"Customer id from merchant | Alphanumeric | max length: 64 |"},"phoneNo":{"type":"string","description":"Customer's phone number, it is recommended to use the phone number that is linked to the card | Format: 628xxxxxxxxxx | min length: 9 max length: 16 | Mandatory"},"journeyId":{"type":"string","description":"Merchant ID, value must be unique | max length: 64"},"additionalInfo":{"$ref":"#/components/schemas/AdditionalInfo"}}},"AdditionalInfo":{"type":"object","required":["channel","custIdMerchant","successRegistrationUrl","failedRegistrationUrl"],"properties":{"channel":{"type":"string","description":"Value should be always DIRECT_DEBIT_MANDIRI_SNAP | Mandatory"},"customerName":{"type":"string","description":"Customer name from merchant | max length: 70"},"email":{"type":"string","description":"Customer email from merchant | max length: 64"},"idCard":{"type":"string","description":"Customer id card from merchant | max length: 20"},"country":{"type":"string","description":"Customer country | max length: 60"},"address":{"type":"string","description":"Customer Address | max length: 255"},"dateOfBirth":{"type":"string","description":"Customer Date of Birth | format: YYYYMMDD"},"successRegistrationUrl":{"type":"string","description":"Redirect URL when binding is success"},"failedRegistrationUrl":{"type":"string","description":"Redirect URL when binding is fail"}}},"BindingResponse":{"type":"object","required":["responseCode","responseMessage","additionalInfo"],"properties":{"responseCode":{"type":"string","description":"Response Code with format HTTP status code + service code + case code. service code and status code refer to: https://developers.doku.com/getting-started-with-doku-api/response-code/http-status-and-case-code#id-4.-direct-debit | Mandatory | min length: 1 | max length: 7."},"responseMessage":{"type":"string","description":"Response Description. | min length: 1 | max length: 150"},"referenceNo":{"type":"string","description":"Reference Number"},"redirectUrl":{"type":"string","description":"Redirect URL to Merchant's page/platform for customer to input OTP/PIN | Will show only if CHANNEL-ID is DH"},"additionalInfo":{"type":"object","required":["custIdMerchant","status","authCode"],"properties":{"custIdMerchant":{"type":"string","description":"Customer id from merchant | max length: 64"},"status":{"type":"string","description":"Current binding status | value always be PENDING"},"authCode":{"type":"string","description":"Authentication Code from Mandiri"}}}}}}}}
```

***

### 2. OTP Verification & Request

### OTP Verification

OTP verification is needed to verify the Card Registration request and Payment request. Merchant can hit this API to verify the OTP.&#x20;

**OTP Verification Flow**

<figure><img src="/files/dWgHn2hE8mpe9sduoJx4" alt=""><figcaption><p>OTP Verification Flow (Card Registration) - Mandiri Direct Debit</p></figcaption></figure>

#### API Endpoint

<table><thead><tr><th width="182">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;

Parameter without (\*) is optional/conditional

## POST /direct-debit/core/v1/otp-verification

> OTP Verification for Direct Debit Mandiri SNAP

```json
{"openapi":"3.0.3","info":{"title":"Direct Debit Mandiri SNAP","version":"1.0.11"},"servers":[{"url":"https://{api-domain}"}],"paths":{"/direct-debit/core/v1/otp-verification":{"post":{"summary":"OTP Verification for Direct Debit Mandiri SNAP","parameters":[{"in":"header","name":"X-TIMESTAMP","schema":{"type":"string","format":"utc timestamp"},"required":true,"description":"Customer's current local time in yyyy-MM- ddTHH:mm:ssTZD format"},{"in":"header","name":"X-SIGNATURE","schema":{"type":"string"},"description":"Algorithm symmetric signature HMAC_SHA512 (clientSecret, stringToSign)","required":true},{"in":"header","name":"X-PARTNER-ID","schema":{"type":"string"},"required":true,"description":"Unique ID for a partner (DOKU'S Client ID)"},{"in":"header","name":"X-EXTERNAL-ID","schema":{"type":"string"},"required":true,"description":"Numeric String. Reference number that should be unique in the same day (request-id)"},{"in":"header","name":"Authorization-customer","schema":{"type":"string","description":"Access Token obtained from Get B2B2C Token API"},"required":true,"description":"Access Token obtained from Get B2B2C Token API | Go to [here](https://dokucom.gitbook.io/api-reference/direct-api/get-token-api/b2c) for detailed documentation"},{"in":"header","name":"Authorization","schema":{"type":"string","description":"Access Token obtained from Get B2B Token API"},"required":true,"description":"Access Token obtained from Get B2B Token API | Go to [here](https://dokucom.gitbook.io/api-reference/direct-api/get-token-api/b2b) for detailed documentation"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtpVerificationRequest"}}}},"responses":{"200":{"description":"Successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtpVerificationResponse"}}}}}}}},"components":{"schemas":{"OtpVerificationRequest":{"type":"object","required":["originalPartnerReferenceNo","otp","action"],"properties":{"originalPartnerReferenceNo":{"type":"string","description":"Partner Reference Number Payment | max: 36 | Mandatory"},"otp":{"type":"string","description":"OTP sent to customer | min: 6 max: 6 | Mandatory"},"action":{"type":"string","description":"otpPayment is for verifying Payment, otpLinkage is for verifying Card Registration | Mandatory"},"additionalInfo":{"type":"object","required":["channel","bankCardToken"],"properties":{"channel":{"type":"string","description":"Value should be always DIRECT_DEBIT_MANDIRI_SNAP | Mandatory"},"bankCardToken":{"type":"string","description":"Account token from account binding process | Mandatory"}}}}},"OtpVerificationResponse":{"type":"object","required":["responseCode","responseMessage"],"properties":{"responseCode":{"type":"string","description":"Response Code with format HTTP status code + service code + case code. service code and status code refer to: https://developers.doku.com/getting-started-with-doku-api/response-code/http-status-and-case-code#id-4.-direct-debit . | Mandatory | min length: 1 | max length: 7."},"responseMessage":{"type":"string","description":"Response Description. | min length: 1 | max length: 150"},"originalReferenceNo":{"type":"string","description":"Reference No from"}}}}}}
```

### OTP Request

This API is used to trigger OTP generation as part of the authentication process for both Card Registration and Payment flows. Once the OTP is successfully generated and delivered to the customer, merchant can proceed by calling the OTP Verification API to validate the OTP input.

#### API Endpoint

<table><thead><tr><th width="182">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</code></td></tr></tbody></table>

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

Notes:&#x20;

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

Parameter without (\*) is optional/conditional

## POST /direct-debit/core/v1/otp

> Request OTP

```json
{"openapi":"3.0.3","info":{"title":"Direct Debit Core System - Request OTP API","version":"1.0.0"},"servers":[{"url":"https://api.doku.com","description":"Base URL","variables":{"host":{"default":"api.doku.com","description":"Host server"}}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token B2B"}},"schemas":{"OtpRequest":{"type":"object","description":"Request body\n","required":["otpTrxCode","journeyId"],"properties":{"otpTrxCode":{"type":"string","description":"Code indicating the OTP transaction type:\n- `01` — Card Binding/Registration process\n- `02` — Payment process\n","maxLength":2},"journeyId":{"type":"string","description":"Journey ID, value must be unique","maxLength":32},"bankCardToken":{"type":"string","description":"Registered bank card token. Mandatory equired for payment flow and Optional for binding/linkage flow."},"additionalInfo":{"type":"object","required":["channel"],"properties":{"channel":{"type":"string","description":"Value should always be DIRECT_DEBIT_MANDIRI_SNAP"}}}}},"OtpResponse":{"type":"object","description":"Response body","properties":{"responseCode":{"type":"string","description":"Response Code with format HTTP status code + service code + case code. service code and status code\n"},"responseMessage":{"type":"string","description":"Response Description."},"referenceNo":{"type":"string","description":"Reference No"},"additionalInfo":{"type":"object","description":"Additional Info","additionalProperties":true}}},"OtpResponseFailed":{"type":"object","description":"Response body","properties":{"responseCode":{"type":"string","description":"Response Code with format HTTP status code + service code + case code. service code and status code\n"},"responseMessage":{"type":"string","description":"Response Description."}}}}},"paths":{"/direct-debit/core/v1/otp":{"post":{"summary":"Request OTP","operationId":"requestOtp","tags":["OTP"],"parameters":[{"name":"X-PARTNER-ID","in":"header","required":true,"description":"Unique ID for a partner (DOKU'S Client ID)","schema":{"type":"string","maxLength":36}},{"name":"X-EXTERNAL-ID","in":"header","required":true,"description":"Numeric String. Reference number that should be unique in the same day (request-id)","schema":{"type":"string","maxLength":32}},{"name":"Authorization","in":"header","required":true,"description":"Access Token obtained from Get B2B Token API","schema":{"type":"string"}},{"name":"X-TIMESTAMP","in":"header","required":true,"description":"Customer's current local time in yyyy-MM- ddTHH:mm:ssTZD format","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}[+\\-]\\d{2}:\\d{2}$"}},{"name":"X-SIGNATURE","in":"header","required":true,"description":"Algorithm symmetric signature HMAC_SHA512 (clientSecret, stringToSign)","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtpRequest"}}}},"responses":{"200":{"description":"Request OTP successfully processed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtpResponse"}}}},"400":{"description":"Request not valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtpResponseFailed"}}}},"401":{"description":"Failed Authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtpResponseFailed"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtpResponseFailed"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtpResponseFailed"}}}}}}}}}
```

***

### 3. Payment&#x20;

After customer's card is registered, payment process can be requested by bringing the card token generated in card registration process. After merchant hit payment API, DOKU will deduct customer's balance.&#x20;

#### Payment - Tokenization

In tokenization scheme, every payment needs to be verified by customer with inputting OTP and/or PIN. In order to do that, merchant needs to bring parameter `paymentType : "SALE"`in payment request body.

And as the response, merchant will receive parameter `webRedirectUrl` to redirect the customer to merchant's page/platform to complete the payment by inputting OTP and/or PIN. After the payment is completed, merchant then will receive the notification.

#### Payment - Recurring

In recurring scheme, the payment process will be scheduled. Hence, verification using OTP and/or PIN is not required in every payment. Customers only need to do the verification during card registration process and it will give merchant the authorization to run scheduled payment. In order to do that, merchant needs to bring parameter `CHANNEL-ID : "H2H"` in request header and`paymentType : "RECURRING"`in payment request body.

And as the response, merchant will not receive parameter `webRedirectUrl` to redirect the customer to merchant's page/platform to complete the payment. Payment request will be directly processed by acquirer and merchant will receive the notification.

**Payment Flow**

This below payment flow is for tokenization scheme.

<figure><img src="/files/BeHbdbUNU635d0LVBTyO" alt=""><figcaption><p>Payment Flow - Mandiri Direct Debit - Tokenization Scheme</p></figcaption></figure>

#### API Endpoint

<table><thead><tr><th width="204">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;

Parameter without (\*) is optional/conditional

## POST /direct-debit/core/v1/debit/payment-host-to-host

> Request Payment from Merchant for Direct Debit Mandiri SNAP

```json
{"openapi":"3.0.3","info":{"title":"Direct Debit Mandiri SNAP","version":"1.0.11"},"servers":[{"url":"https://{api-domain}"}],"paths":{"/direct-debit/core/v1/debit/payment-host-to-host":{"post":{"summary":"Request Payment from Merchant for Direct Debit Mandiri SNAP","parameters":[{"in":"header","name":"X-TIMESTAMP","schema":{"type":"string","format":"utc timestamp"},"required":true,"description":"Customer's current local time in yyyy-MM- ddTHH:mm:ssTZD format"},{"in":"header","name":"X-SIGNATURE","schema":{"type":"string"},"description":"Algorithm symmetric signature HMAC_SHA512 (clientSecret, stringToSign)","required":true},{"in":"header","name":"X-PARTNER-ID","schema":{"type":"string"},"required":true,"description":"Unique ID for a partner (DOKU'S Client ID)"},{"in":"header","name":"X-EXTERNAL-ID","schema":{"type":"string"},"required":true,"description":"Numeric String. Reference number that should be unique in the same day (request-id)"},{"in":"header","name":"CHANNEL-ID","schema":{"type":"string"},"required":false,"description":"Default value: DH(DOKU Hosted) Value: DH/H2H"},{"in":"header","name":"Authorization-customer","schema":{"type":"string","description":"Access Token obtained from B2B2C Get Token API"},"required":true,"description":"Access Token obtained from Get B2B2C Token API | Go to [here](https://dokucom.gitbook.io/api-reference/direct-api/get-token-api/b2c) for detailed documentation"},{"in":"header","name":"Authorization","schema":{"type":"string","description":"Access Token obtained from Get B2B Token API"},"required":true,"description":"Access Token obtained from Get B2B Token API | Go to [here](https://dokucom.gitbook.io/api-reference/direct-api/get-token-api/b2b) for detailed documentation"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequest"}}}},"responses":{"200":{"description":"Successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentResponse"}}}}}}}},"components":{"schemas":{"PaymentRequest":{"type":"object","required":["partnerReferenceNo","amount","additionalInfo"],"properties":{"partnerReferenceNo":{"type":"string","description":"Reference No From Partner | max: 64 | Mandatory"},"amount":{"$ref":"#/components/schemas/AmountObject"},"journeyId":{"type":"string","description":"Merchant ID, value must be unique | max length: 64"},"additionalInfo":{"type":"object","required":["channel","successPaymentUrl","failedPaymentUrl"],"properties":{"channel":{"type":"string","description":"Value should be always DIRECT_DEBIT_MANDIRI_SNAP | Mandatory"},"successPaymentUrl":{"type":"string","description":"Redirect Url if payment success"},"failedPaymentUrl":{"type":"string","description":"Redirect Url if payment fail"},"paymentType":{"type":"string","description":"Enum: SALE, RECURRING (Default Value SALE)"}}}}},"AmountObject":{"type":"object","required":["value","currency"],"properties":{"value":{"type":"string","description":"Transaction Amount. Total Amount with 2 decimal, format ISO 4217 |  min length: 1 | max length: 16.2 | Mandatory"},"currency":{"type":"string","description":"Currency | min length: 1 | max length: 3 | Mandatory "}}},"PaymentResponse":{"type":"object","required":["responseCode","responseMessage"],"properties":{"responseCode":{"type":"string","description":"Response Code with format HTTP status code + service code + case code. service code and status code refer to: https://developers.doku.com/getting-started-with-doku-api/response-code/http-status-and-case-code#id-4.-direct-debit | Mandatory | min length: 1 | max length: 7."},"responseMessage":{"type":"string","description":"Response Description. | min length: 1 | max length: 150"},"webRedirectUrl":{"type":"string","description":"Redirect URL to Merchant's page/platform for customer to input OTP/PIN | Will show if CHANNEL-ID is DH or null"},"partnerReferenceNo":{"type":"string","description":"Reference No From Partner"}}}}}}
```

***

### 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

### a. Refund

Currently, refund for successful Direct Debit Mandiri transactions can only be done via Manual Refund Flow.

Supported refund types via Manual refund Flow:

* Full refund
* Partial refund
* Multiple partial refunds

**Manual Refund Flow**&#x20;

<figure><img src="/files/vE8jADuQlqy9PHn3dioH" alt=""><figcaption><p>Manual Refund Flow - Mandiri Direct Debit</p></figcaption></figure>

#### Steps to Request Manual Refund

Send email to DOKU

* To: <care@doku.com>
* Cc: <refund.chargeback@doku.com>
* Subject: `[Merchant Name] Refund Manual Request – DD Mandiri SNAP`

Include in your email

* Merchant Name
* Invoice Number
* Date of Transaction
* Transaction Amount
* Refund Amount

Processing Time

* Refunds are processed within 7 working days from the date Mandiri receives the request.
* If no update after 7 working days, escalate by replying to the same email.

#### Online Refund Flow

#### API Endpoint

Parameter without (\*) is optional/conditional

### b. Card Registration Unbinding

If a registered customer no longer wants their account/card to be bind/linked and wish to remove it 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="187">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-card-unbind</code></td></tr></tbody></table>

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

Notes:&#x20;

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

Parameter without (\*) is optional/conditional

## POST /direct-debit/core/v1/registration-card-unbind

> Card Registration Unbinding - Direct Debit Mandiri

```json
{"openapi":"3.0.3","info":{"title":"Direct Debit Mandiri SNAP","version":"1.0.11"},"servers":[{"url":"https://{api-domain}"}],"paths":{"/direct-debit/core/v1/registration-card-unbind":{"post":{"summary":"Card Registration Unbinding - Direct Debit Mandiri","parameters":[{"in":"header","name":"X-TIMESTAMP","schema":{"type":"string","format":"utc timestamp"},"required":true,"description":"Customer's current local time in yyyy-MM- ddTHH:mm:ssTZD format"},{"in":"header","name":"X-SIGNATURE","schema":{"type":"string"},"description":"Algorithm symmetric signature HMAC_SHA512 (clientSecret, stringToSign)","required":true},{"in":"header","name":"X-PARTNER-ID","schema":{"type":"string"},"required":true,"description":"Unique ID for a partner (DOKU'S Client ID)"},{"in":"header","name":"X-EXTERNAL-ID","schema":{"type":"string"},"required":true,"description":"Numeric String. Reference number that should be unique in the same day (request-id)"},{"in":"header","name":"Authorization","schema":{"type":"string","description":"Access Token obtained from Get B2B Token API"},"required":true,"description":"Access Token obtained from Get B2B Token API | Go to [here](https://dokucom.gitbook.io/api-reference/direct-api/get-token-api/b2b) for detailed documentation"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnbindingRequest"}}}},"responses":{"200":{"description":"Successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnbindingResponse"}}}}}}}},"components":{"schemas":{"UnbindingRequest":{"type":"object","properties":{"token":{"type":"string","description":"format: Value from getTokenB2B2C | max: 2048 | Mandatory"},"additionalInfo":{"type":"object","required":["channel"],"properties":{"channel":{"type":"string","description":"Value should be always DIRECT_DEBIT_MANDIRI_SNAP | Mandatory"}}}}},"UnbindingResponse":{"type":"object","required":["responseCode","responseMessage"],"properties":{"responseCode":{"type":"string","description":"Response Code with format HTTP status code + service code + case code. service code and status code refer to: https://developers.doku.com/getting-started-with-doku-api/response-code/http-status-and-case-code#id-4.-direct-debit | Mandatory | min length: 1 | max length: 7."},"responseMessage":{"type":"string","description":"Response Description. | min length: 1 | max length: 150"},"referenceNo":{"type":"string","description":"Reference Number"},"redirectUrl":{"type":"string","description":"Redirect URL to Authenticate Customer | Will show only if CHANNEL-ID is DH"}}}}}}
```


---

# 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/mandiri-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.
