# BCA v1.0

### Integration methods[​](https://dashboard.doku.com/docs/docs/jokul-direct/virtual-account/bca-va-guide#integration-methods) <a href="#integration-methods" id="integration-methods"></a>

There are two methods to integrate with BCA VA:

1. **Create VA**: The VA number will be registered to DOKU and Acquirer will inquiry to our side when the customer make payment at the acquirer channel (ATM, mobile banking, internet banking, etc.)
   1. **DOKU Generated Payment Code (DGPC)**: The VA number is generated by DOKU. Suitable for e-commerce business model.
   2. **Merchant Generated Payment Code (MGPC)**: The VA number is generated by Merchant. Suitable for top up business model.
2. **Direct Inquiry (DIPC)**: The VA number is registered on merchant side and DOKU will forward Acquirer inquiry request to merchant side when the customer make payment at the acquirer channel (ATM, mobile banking, internet banking, etc.)

## Integration Steps

#### Precondition&#x20;

{% hint style="info" %}
Get Token API

As client who hit DOKU's API such as Create VA, you need to obtain an access token first. Learn how to do it in this [section](https://developers.doku.com/accept-payments/direct-api/snap/integration-guide/get-token-api).&#x20;
{% endhint %}

{% hint style="info" %}
Generate Signature

`X- SIGNATURE` is a security parameter that needs to be generated on merchant's Backend to verify the request authenticity.

So, it's very crucial for merchant to generate the X-SIGNATURE. Learn how to do it in this [section](https://developers.doku.com/get-started-with-doku-api/signature-component/snap)
{% endhint %}

Here is the overview of how to integrate with Virtual Account:

1. [Create Virtual Account](#id-1.-create-va)

   [a. DOKU Generate Payment Code](#a.-doku-generate-payment-code)

   [b. Merchant Generate Payment Code](#b.-merchant-generate-payment-code)

   [c. Display Virtual Account](#c.-display-virtual-account)

   [d. Acknowledge Payment Result](#d.-acknowledge-payment-result)

   [e. Hit DOKU Check Status API](#e.-hit-doku-check-status-api)

   [f. Delete Virtual Account](#f.-delete-payment-code)

   [g .Update Virtual Account](#g.-update-payment-code)

***

### 1. Create VA

To create VA, you will need to hit this API through your Backend:

#### API Endpoint

<table><thead><tr><th>Type</th><th>Value</th></tr></thead><tbody><tr><td>Service Code</td><td>27</td></tr><tr><td>HTTP Method</td><td>POST</td></tr><tr><td>API Endpoint Sandbox </td><td><p></p><pre class="language-json"><code class="lang-json">https://api-sandbox.doku.com/.../
</code></pre></td></tr><tr><td>API Endpoint Production</td><td><p></p><pre class="language-json"><code class="lang-json">https://api.doku.com/..../
</code></pre></td></tr><tr><td>Path</td><td><p></p><pre class="language-json"><code class="lang-json">/virtual-accounts/bi-snap-va/v1/transfer-va/create-va
</code></pre></td></tr></tbody></table>

Here is the sample request header, request body and response body for BCA VA&#x20;

#### a. DOKU Generate Payment Code

Check this flow diagram to get know about this method

<div align="center" data-full-width="true"><figure><img src="https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FctXy3OIqF4KkJVNaJX4A%2FSNAP%20FLOW-DGPC.png?alt=media&#x26;token=4d0dfb3d-a19c-45d0-9ae3-53dc5fbe08d2" alt=""><figcaption><p>DOKU Generate Payment Code</p></figcaption></figure></div>

#### Request Header

<table data-full-width="false"><thead><tr><th>Parameter</th><th>Type</th><th>Mandatory</th><th>Description</th></tr></thead><tbody><tr><td>X- TIMESTAMP</td><td>String</td><td>Mandatory</td><td>Client's current local time in yyyy-MM-ddTHH:mm:ssZ format</td></tr><tr><td>X-SIGNATURE</td><td>String</td><td>Mandatory</td><td>Algorithm symmetric signature HMAC_SHA2512(clientSecret, stringToSign) <br>Refer to this <a href="../../../get-started-with-doku-api/signature-component/snap/symmetric-signature">Docs</a></td></tr><tr><td>X-PARTNER-ID</td><td>String</td><td>Mandatory</td><td>Unique ID for a partner (Merchant Client ID )</td></tr><tr><td>X-EXTERNAL-ID</td><td>String</td><td>Mandatory</td><td>Numeric string. Reference number that should be unique in the same day ( request-id)</td></tr><tr><td>CHANNEL-ID</td><td>String</td><td>Mandatory</td><td>channel ID for VA</td></tr><tr><td>Authorization</td><td>String</td><td>Mandatory</td><td>Bearer "access token" obtainedn from Get B2B Token API , refer to this <a href="../../../accept-payments/direct-api/snap/integration-guide/get-token-api">Docs</a></td></tr></tbody></table>

{% openapi src="<https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FJ4qGfwAAPtG2ii7bAz0k%2Fbcava%20-%20DGPC.json?alt=media&token=fe766f55-c49f-4016-8bf7-a89e23f5f946>" path="/virtual-accounts/bi-snap-va/v1/transfer-va/create-va" method="post" %}
[bcava - DGPC.json](https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FJ4qGfwAAPtG2ii7bAz0k%2Fbcava%20-%20DGPC.json?alt=media\&token=fe766f55-c49f-4016-8bf7-a89e23f5f946)
{% endopenapi %}

[Learn what are the response codes!](https://developers.doku.com/get-started-with-doku-api/response-code/http-status-and-case-code)

#### b. Merchant Generate Payment Code

Check this flow diagram to get know about this method

<div data-full-width="true"><figure><img src="https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2F6NUOPYG4t9mvP0Z8SVq7%2FSNAP%20FLOW-MGPC.png?alt=media&#x26;token=75afb86d-240d-4ba1-8f07-b470c77c2b3c" alt=""><figcaption><p>Merchant Generate Payment Code</p></figcaption></figure></div>

#### Request Header

<table data-full-width="false"><thead><tr><th>Parameter</th><th>Type</th><th>Mandatory</th><th>Description</th></tr></thead><tbody><tr><td>X- TIMESTAMP</td><td>String</td><td>Mandatory</td><td>Client's current local time in yyyy-MM-ddTHH:mm:ssZ format</td></tr><tr><td>X-SIGNATURE</td><td>String</td><td>Mandatory</td><td>Algorithm symmetric signature HMAC_SHA2512(clientSecret, stringToSign) <br>Refer to this <a href="../../../get-started-with-doku-api/signature-component/snap/symmetric-signature">Docs</a></td></tr><tr><td>X-PARTNER-ID</td><td>String</td><td>Mandatory</td><td>Unique ID for a partner (Merchant Client ID )</td></tr><tr><td>X-EXTERNAL-ID</td><td>String</td><td>Mandatory</td><td>Numeric string. Reference number that should be unique in the same day ( request-id)</td></tr><tr><td>CHANNEL-ID</td><td>String</td><td>Mandatory</td><td>channel ID for VA</td></tr><tr><td>Authorization</td><td>String</td><td>Mandatory</td><td>Bearer "access token" obtainedn from Get B2B Token API , refer to this <a href="../../../accept-payments/direct-api/snap/integration-guide/get-token-api">Docs</a></td></tr></tbody></table>

{% openapi src="<https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FmJLWszRZ3xL1M1uEx8oJ%2Fbcava%20-%20MGPC.json?alt=media&token=ea710caa-5590-4d0f-9f69-57294492342f>" path="/virtual-accounts/bi-snap-va/v1/transfer-va/create-va" method="post" %}
[bcava - MGPC.json](https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FmJLWszRZ3xL1M1uEx8oJ%2Fbcava%20-%20MGPC.json?alt=media\&token=ea710caa-5590-4d0f-9f69-57294492342f)
{% endopenapi %}

[Learn what are the response codes!](https://developers.doku.com/get-started-with-doku-api/response-code/http-status-and-case-code)

{% hint style="success" %}
**Pro Tips!**

1. You can also show payment instruction link to your customer by using `additionalInfo.howToPayPage`&#x20;
2. If you wish to customize the UI for the payment instruction, you can use the `additionalInfo.howToPayApi`
   {% endhint %}

#### c. Display Virtual Account

You can display the payment code to your customer by using `virtualAccountData.virtualAccountNo` that you retrieved from the API response.

#### d. 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](https://developers.doku.com/get-started-with-doku-api/notification/http-notification-sample-for-snap) .

{% openapi src="<https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FnQGwhUXSYpHnXNnr8gVY%2FPayment%20Notification.json?alt=media&token=cc3fbba5-cbbb-4a36-b63d-0445e9901801>" path="/v1/transfer-va/payment" method="post" %}
[Payment Notification.json](https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FnQGwhUXSYpHnXNnr8gVY%2FPayment%20Notification.json?alt=media\&token=cc3fbba5-cbbb-4a36-b63d-0445e9901801)
{% endopenapi %}

#### e. Hit DOKU Check Status API

If you do not receive notifications from DOKU due to some issue, you can perform an API status check on the DOKU side to determine the updated transaction status. See the detailed request and response here [Check Status API](https://developers.doku.com/get-started-with-doku-api/check-status-api/snap).

***

#### f. Delete Payment Code

If you wish to delete your virtual account, you can do that by hitting the API with this API :&#x20;

#### Request Header

<table data-full-width="false"><thead><tr><th>Parameter</th><th>Type</th><th>Mandatory</th><th>Description</th></tr></thead><tbody><tr><td>X- TIMESTAMP</td><td>String</td><td>Mandatory</td><td>Client's current local time in yyyy-MM-ddTHH:mm:ssZ format</td></tr><tr><td>X-SIGNATURE</td><td>String</td><td>Mandatory</td><td>Algorithm symmetric signature HMAC_SHA2512(clientSecret, stringToSign) <br>Refer to this <a href="../../../get-started-with-doku-api/signature-component/snap/symmetric-signature">Docs</a></td></tr><tr><td>X-PARTNER-ID</td><td>String</td><td>Mandatory</td><td>Unique ID for a partner (Merchant Client ID )</td></tr><tr><td>X-EXTERNAL-ID</td><td>String</td><td>Mandatory</td><td>Numeric string. Reference number that should be unique in the same day ( request-id)</td></tr><tr><td>CHANNEL-ID</td><td>String</td><td>Mandatory</td><td>channel ID for VA</td></tr><tr><td>Authorization</td><td>String</td><td>Mandatory</td><td>Bearer "access token" obtainedn from Get B2B Token API , refer to this <a href="../../../accept-payments/direct-api/snap/integration-guide/get-token-api">Docs</a></td></tr></tbody></table>

{% openapi src="<https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FGHGldp2kzcdUvoPHbSIt%2Fbcava%20-%20DELETE%20VA.json?alt=media&token=3911d75a-482b-4009-a38b-4de00980a221>" path="/virtual-accounts/bi-snap-va/v1/transfer-va/delete-va" method="post" %}
[bcava - DELETE VA.json](https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FGHGldp2kzcdUvoPHbSIt%2Fbcava%20-%20DELETE%20VA.json?alt=media\&token=3911d75a-482b-4009-a38b-4de00980a221)
{% endopenapi %}

#### g. Update Payment Code

If you wish to update your virtual account, you can do that by hitting the API with this API :&#x20;

#### Request Header

<table data-full-width="false"><thead><tr><th>Parameter</th><th>Type</th><th>Mandatory</th><th>Description</th></tr></thead><tbody><tr><td>X- TIMESTAMP</td><td>String</td><td>Mandatory</td><td>Client's current local time in yyyy-MM-ddTHH:mm:ssZ format</td></tr><tr><td>X-SIGNATURE</td><td>String</td><td>Mandatory</td><td>Algorithm symmetric signature HMAC_SHA2512(clientSecret, stringToSign) <br>Refer to this <a href="../../../get-started-with-doku-api/signature-component/snap/symmetric-signature">Docs</a></td></tr><tr><td>X-PARTNER-ID</td><td>String</td><td>Mandatory</td><td>Unique ID for a partner (Merchant Client ID )</td></tr><tr><td>X-EXTERNAL-ID</td><td>String</td><td>Mandatory</td><td>Numeric string. Reference number that should be unique in the same day ( request-id)</td></tr><tr><td>CHANNEL-ID</td><td>String</td><td>Mandatory</td><td>channel ID for VA</td></tr><tr><td>Authorization</td><td>String</td><td>Mandatory</td><td>Bearer "access token" obtainedn from Get B2B Token API , refer to this <a href="../../../accept-payments/direct-api/snap/integration-guide/get-token-api">Docs</a></td></tr></tbody></table>

{% openapi src="<https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FMrwZAk7TuMSm4GuRnZ4a%2Fbcava%20-%20UPDATE%20VA.json?alt=media&token=79ff3a35-b4a4-4efd-a684-34939acb5ecf>" path="/virtual-accounts/bi-snap-va/v1/transfer-va/update-va" method="post" %}
[bcava - UPDATE VA.json](https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FMrwZAk7TuMSm4GuRnZ4a%2Fbcava%20-%20UPDATE%20VA.json?alt=media\&token=79ff3a35-b4a4-4efd-a684-34939acb5ecf)
{% endopenapi %}

***

### Additional Feature

#### Open Payment&#x20;

DOKU supports open payment meaning that your customer can input their own payment amount. To use open amount, you need to set `virtualAccountTrxType` = `2` and you  need to send `totalAmount.value` = `0`and `totalAmount.currency` = `IDR` DOKU. Here is the sample:

```json
{
    "partnerServiceId": "  888994",
        ...
    "totalAmount": {
        "value": "0",
        "currency": "IDR"
      },
      ...
    "virtualAccountTrxType": "2",
    ...
}
```

***

### 2. Direct Inquiry

<table><thead><tr><th>Type</th><th>Value</th></tr></thead><tbody><tr><td>Service Code</td><td>24</td></tr><tr><td>HTTP Method</td><td>POST</td></tr><tr><td>API Endpoint Sandbox </td><td><p></p><pre class="language-json"><code class="lang-json">https://api-sandbox.doku.com/.../
</code></pre></td></tr><tr><td>API Endpoint Production</td><td><p></p><pre class="language-json"><code class="lang-json">https://api.doku.com/..../
</code></pre></td></tr><tr><td>Path</td><td><p></p><pre class="language-json"><code class="lang-json">/virtual-accounts/bi-snap-va/v1/transfer-va/create-va
</code></pre></td></tr></tbody></table>

Here is the overview of how to integrate Direct Inquiry BCA VA :&#x20;

2. [Direct Inquiry](#id-2.-direct-inquiry)

   a.  [Setup Inquiry URL on DOKU Dashboard](#a.-setup-inquiry-url-on-doku-dashboard)

   b. [Generate Payment Code on your End](#b.-generate-payment-code-on-your-end)

   c. [Receive Inquiry Request from DOKU](#c.-receive-inquiry-request-from-doku)

   d. [Acknowledge Payment Notification](#d.-acknowledge-payment-notification)

   e. [Hit DOKU Check Status API](#e.-hit-doku-check-status-api-1)

Check this flow to diagram to get know about this API :&#x20;

<div data-full-width="true"><figure><img src="https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FjU6l2oVY7dxRvnjV1O1l%2FSNAP%20FLOW-DIPC.png?alt=media&#x26;token=937344a0-3758-4289-b823-aee2755a6c77" alt=""><figcaption><p>Direct Inquiry</p></figcaption></figure></div>

To get Inquiry Request from DOKU,  you will need to hit this API through your Backend:

#### a. Setup Inquiry URL on DOKU Dashboard

To receive the inquiry request from DOKU. You must set your `Inquiry URL` to DOKU. Please contact our team for the setup.&#x20;

{% hint style="info" %}
Please inform the `Inquiry URL` for Sandbox environment and Production environment.
{% endhint %}

#### b. Generate Payment Code on your end

Generate payment is done in your system. The payment code length maximum is `23` digits.

#### c. Receive Inquiry Request from DOKU

Here is the sample request header, request body from DOKU

#### Request Header

<table data-full-width="false"><thead><tr><th>Parameter</th><th>Type</th><th>Mandatory</th><th>Description</th></tr></thead><tbody><tr><td>X- TIMESTAMP</td><td>String</td><td>Mandatory</td><td>Client's current local time in yyyy-MM-ddTHH:mm:ssZ format</td></tr><tr><td>X-SIGNATURE</td><td>String</td><td>Mandatory</td><td>Algorithm symmetric signature HMAC_SHA2512(clientSecret, stringToSign) <br>Refer to this <a href="../../../get-started-with-doku-api/signature-component/snap/symmetric-signature">Docs</a></td></tr><tr><td>X-PARTNER-ID</td><td>String</td><td>Mandatory</td><td>Unique ID for a partner (Merchant Client ID )</td></tr><tr><td>X-EXTERNAL-ID</td><td>String</td><td>Mandatory</td><td>Numeric string. Reference number that should be unique in the same day ( request-id)</td></tr><tr><td>CHANNEL-ID</td><td>String</td><td>Mandatory</td><td>channel ID for VA</td></tr><tr><td>Authorization</td><td>String</td><td>Mandatory</td><td>Bearer "access token" obtainedn from Get B2B Token API , refer to this <a href="../../../accept-payments/direct-api/snap/integration-guide/get-token-api">Docs</a></td></tr></tbody></table>

{% openapi src="<https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FKPp6Spuj2cJqb1JhzV1G%2Fbcava%20-%20DIPC.json?alt=media&token=5846e51d-d4da-4918-aaf4-0b1df942eccb>" path="/v1/transfer-va/inquiry" method="post" %}
[bcava - DIPC.json](https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FKPp6Spuj2cJqb1JhzV1G%2Fbcava%20-%20DIPC.json?alt=media\&token=5846e51d-d4da-4918-aaf4-0b1df942eccb)
{% endopenapi %}

#### d. Acknowledge payment notification

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](https://developers.doku.com/get-started-with-doku-api/notification/http-notification-sample-for-snap) .

{% openapi src="<https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FnQGwhUXSYpHnXNnr8gVY%2FPayment%20Notification.json?alt=media&token=cc3fbba5-cbbb-4a36-b63d-0445e9901801>" path="/v1/transfer-va/payment" method="post" %}
[Payment Notification.json](https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FnQGwhUXSYpHnXNnr8gVY%2FPayment%20Notification.json?alt=media\&token=cc3fbba5-cbbb-4a36-b63d-0445e9901801)
{% endopenapi %}

#### e. Hit DOKU Check Status API

If you do not receive notifications from DOKU due to some issue, you can perform an API status check on the DOKU side to determine the updated transaction status. See the detailed request and response here [Check Status API](https://developers.doku.com/get-started-with-doku-api/check-status-api/snap).

***
