> For the complete documentation index, see [llms.txt](https://docs.neox.vn/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.neox.vn/docs/collections/integration/virtual-accounts/generate-qr-data.md).

# API Generate QR data for virtual account

* **Purpose**: This is the API used to generate QR data with a specified amount for a virtual account.
* **API**:
  * Path: ***v2/col/virtual-accounts/qrData***
  * Method: ***POST***
  * Request: Content-Type: ***application/json***

## Request

### Request Body Field Descriptions (JSON)

| Field Name                   | Type   | Required | Description                       |
| ---------------------------- | ------ | -------- | --------------------------------- |
| virtualAccountRequestId (\*) | string | No       | Virtual account request ID        |
| bankAccountNumber (\*)       | string | No       | Bank account number               |
| amount                       | number | No       | Amount of the transaction         |
| remark                       | string | No       | Remark for the transaction        |
| extraInfo                    | object | No       | Additional information (optional) |

(\*) At least one of `virtualAccountRequestId` or `bankAccountNumber` is required to identify the virtual account for which the QR data is being generated.

### Request sample

```json
{
  "virtualAccountRequestId": "e1b2c3d4-5678-1234-9abc-1234567890ab",
  "bankAccountNumber": "NEO0003044",
  "amount": 100000,
  "remark": "THANH TOAN DON HANG 1778577017037",
  "extraInfo": {}
}
```

## Response

### Response Field Descriptions

| Field Name    | Type   | Description                         |
| ------------- | ------ | ----------------------------------- |
| code          | number | Response code                       |
| state         | number | State of the response               |
| data          | object | Details of the created virtual card |
| message       | string | Response message                    |
| neoResponseId | string | Unique Neo response identifier      |

#### `data` object fields

| Field Name              | Type   | Description                   |
| ----------------------- | ------ | ----------------------------- |
| virtualAccountRequestId | string | Virtual account request ID    |
| bankId                  | string | Bank ID                       |
| bankName                | string | Bank name                     |
| bankAccountNumber       | string | Bank account number           |
| bankAccountName         | string | Bank account name             |
| amount                  | number | Amount of the transaction     |
| remark                  | string | Remark for the transaction    |
| qrText                  | string | QR code text                  |
| extraInfo               | object | Additional information        |
| createdAt               | string | Creation timestamp (ISO 8601) |

### Response sample

```json
{
  "code": 1,
  "state": 2,
  "data": {
    "virtualAccountRequestId": "5029e5b0-5824-4a0c-bd7a-808439cced22",
    "bankId": "MSCBVNVX",
    "bankName": "Military Commercial Joint stock Bank",
    "bankAccountNumber": "NEO0003044",
    "bankAccountName": "SUMTING WONG",
    "amount": 100000,
    "remark": "THANH TOAN DON HANG 1778577017037",
    "qrText": "00020101021238580010A000000727012800069704260114969889007057920208QRIBFTTA53037045405100005802VN62470843THANH TOAN DON HANG 177857701703763042A83",
    "extraInfo": {},
    "createdAt": "2023-11-15T02:27:18.241Z"
  },
  "message": "Successful",
  "neoResponseId": "ac23ea1c-98db-4ed6-b927-7e7692ef2f69"
}
```

## Example cURL

```bash
curl -X POST "https://{base_url_openapi}/" \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -H "Accept-Language: en" \
  -d '{
  "virtualAccountRequestId": "e1b2c3d4-5678-1234-9abc-1234567890ab",
  "bankAccountNumber": "NEO0003044",
  "amount": 100000,
  "remark": "THANH TOAN DON HANG 1778577017037",
  "extraInfo": {}
}'
```

## Notes

* Requires Bearer token in the Authorization header.
* The Accept-Language header can be used to specify the response language (Support: "vi", "en").
* The `extraInfo` field can be used to pass any additional information that may be required for processing the request, and it will be included in the response as well.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.neox.vn/docs/collections/integration/virtual-accounts/generate-qr-data.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
