# Currency conversion API

## Usage

* This is the API to convert a currency to VND.
* Sequence Diagram&#x20;

<figure><img src="/files/UcDu8AMBEcSycZiutU9D" alt="" width="563"><figcaption><p>Conversion flow</p></figcaption></figure>

* Step 1: Merchant calls [GetExchangeRate API](/docs/global/disbursement/integration/get-exchange-rate-api.md) to get list of exchange rates.
* Step 2: Merchant call Exchange API. If returned status is PASSED, NeoX will process

  the request and notify the result via [webhook](/docs/global/disbursement/integration/event-notification.md#notifies-about-currency-exchanged).

## API

* Path: */v2/dib/exchange/{srcCurrency}-(dstCurrency}*
* Method: POST
* Request: Content-Type: application/json&#x20;
* Url Params:

  *srcCurrency*: Currency code supported by NeoX.

  *dstCurrency*: Only support VND in this version.

Ex:  */v2/dib/exchange/USD-VND*

### Request

<table><thead><tr><th width="159.33333333333334">Parameter</th><th width="130">Data Type </th><th width="100" data-type="checkbox">Require</th><th>Description</th></tr></thead><tbody><tr><td>requestId </td><td>String </td><td>true</td><td><p>UUID is generated by merchant. (Unique) </p><p>Exp:“90e7340b-5cbe-4ce7-886f-55181040af4f” </p></td></tr><tr><td>amount </td><td>Number </td><td>true</td><td>The amount</td></tr><tr><td>currency</td><td>String</td><td>true</td><td>The currency of the amount (srcCurrency or dstCurrency) is used for calculating the origin amount and target amount</td></tr><tr><td>description</td><td>String (256)</td><td>false</td><td>Description</td></tr></tbody></table>

### Response

<table><thead><tr><th width="139.33333333333334">Field name</th><th width="203">Data Type </th><th>Description</th></tr></thead><tbody><tr><td>code </td><td>Number </td><td>System’s error code </td></tr><tr><td>message </td><td>String </td><td>Error description </td></tr><tr><td>data </td><td>Object</td><td>Exchange response data below.</td></tr></tbody></table>

Exchange response data:

<table><thead><tr><th width="137.33333333333334">Field name</th><th width="206">Data Type </th><th>Description</th></tr></thead><tbody><tr><td>requestId </td><td>String </td><td>requestId in the exchange request.</td></tr><tr><td>status </td><td>String </td><td><em>PASSED</em>: Request successfully. Wait for result notification through <a href="/pages/OfdtvWaTdlaGsfu11tPF#notifies-about-currency-exchanged">webhook</a>.<br><em>FAILED</em>: Submit request failed.</td></tr><tr><td>code </td><td>Number</td><td>Logic's error code</td></tr></tbody></table>


---

# 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://docs.neox.vn/docs/global/disbursement/integration/currency-conversion-api.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.
