# BTN v1.0

## Process Flow

There is one method to integrate with BTN VA:

### VA From Acquirer

Merchant could hit create VA API (service code 27) to create their virtual account number by acquirer. The number created then will be inquired by acquirer, merchant can get the payment notification.&#x20;

Check this flow diagram to get know about this method

<figure><img src="/files/okyroKBP6oZdMyzx4nxA" alt=""><figcaption><p>Register VA Flow</p></figcaption></figure>

## Integration Steps&#x20;

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

1. [Create Virtual Account](#1.-create-virtual-account)
2. [Display Virtual Account](#2.-display-virtual-account)
3. [Acknowledge payment result](#3.-acknowledge-payment-result)

***

### 1. Create Virtual Account&#x20;

To create Virtual Account, 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">/bi-snap-va/btn/v1/transfer-va/create-va
</code></pre></td></tr></tbody></table>

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

1. #### DOKU Generate Payment Code

{% openapi src="/files/D1wGpJq3mZ4tfFDY8uFG" path="/bi-snap-va/btn/v1/transfer-va/create-va" method="post" %}
[BTN - DGPC1.json](https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FtNl3ACsMylVMJV6OJzdt%2FBTN%20-%20DGPC1.json?alt=media\&token=762c2143-5c4c-435f-a6bf-601f203eb679)
{% endopenapi %}

2. #### Merchant Generate Payment Code

{% openapi src="/files/d9Bwaf9jBuy5JFfcXq14" path="/bi-snap-va/btn/v1/transfer-va/create-va" method="post" %}
[BTN - MGPC1.json](https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FNShfDgd7XmIZfdFhTAzv%2FBTN%20-%20MGPC1.json?alt=media\&token=e8596450-36bb-4503-b1c7-ae68ffcc6ace)
{% endopenapi %}

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

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

#### 2. Display Virtual Account

You can display the payment code to your customer by using `virtual_account_info.virtual_account_number` 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](/get-started-with-doku-api/notification/http-notification-sample-for-snap.md) .

#### 4. 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](/get-started-with-doku-api/check-status-api/snap.md).

## 2. Direct Inquiry

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

1. Setup Inquiry URL on DOKU Dashboard
2. Generate Payment Code on your End
3. Receive Inquiry Request from DOKU
4. Acknowledge Payment Notification

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

<figure><img src="/files/UFMZMMHHiaPNc6xvKFk1" alt=""><figcaption></figcaption></figure>

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

#### 1. 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 %}

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

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

#### 3. Receive Inquiry Request from DOKU

Here is the sample request header, request body from DOKU

{% openapi src="/files/u5FgiFeDZdgQtnDSpIr4" path="/url-direct-inquiry-merchant" method="post" %}
[MANDIRI - DIPC.json](https://3092822868-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqCxtvLoJNNxvp4U7kLHd%2Fuploads%2FUo7GVJq2lrENLbOSboMg%2FMANDIRI%20-%20DIPC.json?alt=media\&token=66b5f471-501b-4667-b3b3-8f718e5087aa)
{% endopenapi %}

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

#### 4. 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](/get-started-with-doku-api/check-status-api/snap.md).


---

# 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/archive/snap/virtual-account/btn-v1.0.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.
