> For the complete documentation index, see [llms.txt](https://arito-dev.gitbook.io/arito-api-integration-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://arito-dev.gitbook.io/arito-api-integration-documentation/list-api/import-invoice.md).

# Import Invoice

Used to retrieve a list of customers based on specified conditions

<table data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td>Method</td><td><a data-footnote-ref href="#user-content-fn-1"><mark style="color:green;"><strong>POST</strong></mark></a></td></tr><tr><td>Link</td><td><mark style="color:orange;"><strong>{{host}}/Invoice/Import</strong></mark></td></tr></tbody></table>

{% tabs %}
{% tab title="Request" %}

## Authorization

<table data-header-hidden><thead><tr><th width="183"></th><th></th></tr></thead><tbody><tr><td>Type</td><td><mark style="color:blue;">Bearer Token</mark></td></tr><tr><td>Token</td><td><mark style="color:orange;">{{access_token}}</mark></td></tr></tbody></table>

## Body

```json
{
    "memvars": {
        "master": [
            {
                "api_code": 1,
                "so_ct": "API-001",
                "ngay_ct": "2023-05-23T00:00:00.000Z",
                "ma_nt": "VND",
                "ty_gia": 1,
                "ma_kh": "API-KH0001",
                "ma_nvbh": ""
            }
        ],
        "detail": [
            {
                "api_code": 1,
                "ma_vt": "API-VT0001",
                "dvt": "CAI",
                "ma_kho": "BAR2",
                "so_luong": 10,
                "gia_nt2": 20000,
                "tien_nt2": 200000
            },
            {
                "api_code": 1,
                "ma_vt": "API-VT0001",
                "dvt": "CAI",
                "ma_kho": "KTP",
                "so_luong": 5,
                "gia_nt2": 10000,
                "tien_nt2": 50000
            }
        ],
        "payment": [
            {
                "api_code": 1,
                "ma_httt": "TIENMAT",
                "t_tt_nt": 150000
            },
            {
                "api_code": 1,
                "ma_httt": "VISA",
                "t_tt_nt": 100000
            }
        ]
    }
}
```

## Parameter description

1. General information on the invoice: memvars.master

<table><thead><tr><th width="144">Name</th><th width="59" data-type="checkbox">(*)</th><th width="102">Type</th><th>Description</th></tr></thead><tbody><tr><td>api_code</td><td>true</td><td>string</td><td>The unique key for each invoice, within the same secret connecting to the API, this api_code is not allowed to be duplicated</td></tr><tr><td>so_ct</td><td>true</td><td>string</td><td>Invoice number</td></tr><tr><td>ngay_ct</td><td>true</td><td>datetime</td><td>Invoice date, ISO 8601 format</td></tr><tr><td>ma_nt</td><td>false</td><td>string</td><td>Currency code</td></tr><tr><td>ty_gia</td><td>false</td><td>numeric</td><td>Invoice Exchange Rate</td></tr><tr><td>ma_kh</td><td>true</td><td>string</td><td>Customer Purchase Code</td></tr><tr><td>ma_nvbh</td><td>false</td><td>string</td><td>Salesperson Code</td></tr></tbody></table>

2. Invoice details: memvars.detail

This detailed data must not be left blank

<table><thead><tr><th width="143">Name</th><th width="63" data-type="checkbox">(*)</th><th width="103">Type</th><th>Description</th></tr></thead><tbody><tr><td>api_code</td><td>true</td><td>string</td><td>The key to the invoice, this key is set the same as the api_code string in the master. Within the same invoice, this string is identical</td></tr><tr><td>ma_vt</td><td>true</td><td>string</td><td>Product code</td></tr><tr><td>dvt</td><td>true</td><td>string</td><td>Unit code</td></tr><tr><td>ma_kho</td><td>true</td><td>string</td><td>Sales warehouse code</td></tr><tr><td>so_luong</td><td>false</td><td>numeric</td><td>Sales quantity</td></tr><tr><td>gia_nt2</td><td>false</td><td>numeric</td><td>Unit selling price</td></tr><tr><td>tien_nt2</td><td>true</td><td>nuemric</td><td>Total amount</td></tr></tbody></table>

3. Payment information: memvars.payment

The payment data is allowed to be blank if the invoice does not track by payment method

<table><thead><tr><th width="146">Name</th><th width="64" data-type="checkbox">(*)</th><th width="104">Type</th><th>Description</th></tr></thead><tbody><tr><td>api_code</td><td>true</td><td>string</td><td>The key to the invoice, this key is set to be identical to the api_code string in the master. In the same invoice, this string is the same</td></tr><tr><td>ma_httt</td><td>true</td><td>string</td><td>Payment method code for invoices</td></tr><tr><td>t_tt_nt</td><td>true</td><td>numeric</td><td>The total amount to be paid using this method</td></tr></tbody></table>
{% endtab %}

{% tab title="Response" %}

```json
{
    "code": 200,
    "msg": "Ok",
    "value": null,
    "data": null
}
```

## Descripsion result

<table><thead><tr><th width="159">Tên</th><th>Diễn giải</th></tr></thead><tbody><tr><td>code</td><td>When successfully executed, the status code is 200. For other codes, such as 401, 452... it indicates a failed operation, accompanied by a descriptive message explaining the result</td></tr><tr><td>msg</td><td>Description of API execution results</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

[^1]:
