# Hạn mức tồn kho

* Tính năng này dùng để lấy [danh sách hạn mức tồn kho](https://nhanh.vn/inventory/archive/index).
* Dữ liệu sẽ được phân trang, mỗi trang tối đa không quá 50 sản phẩm.

## Request

* Xem [common request params](/v3/readme.md#request-params).

```curl
curl --location --globoff 'https://pos.open.nhanh.vn/v3.0/inventory/archive?appId={{appId}}&businessId={{businessId}}' \
--header 'Authorization: {{accessToken}}' \
--header 'Content-Type: application/json' \
--data '{
    "filters": {
    },
    "paginator": {
        "size": 50,
        "sort": {"id": "desc"},
        "next": {"id": 100}
    }
}'
```

### Filters

| Key           | Type  | Description                                             |
| ------------- | ----- | ------------------------------------------------------- |
| productIds    | array | Mảng ID sản phẩm, tối đa 100                            |
| depotIds      | array | Id cửa hàng - tối đa 500                                |
| categoryId    | int   | Id danh mục sản phẩm                                    |
| brandId       | array | ID thương hiệu                                          |
| createdAtFrom | int   | Tạo hạn mức tồn kho từ ngày (định dạng timestamp)       |
| createdAtTo   | int   | Tạo hạn mức tồn kho đến ngày (định dạng timestamp)      |
| updatedAtFrom | int   | Cập nhật hạn mức tồn kho từ ngày (định dạng timestamp)  |
| updatedAtTo   | int   | Cập nhật hạn mức tồn kho đến ngày (định dạng timestamp) |

### Paginator

* Xem cấu trúc chung [tại đây](/v3/readme.md#paginator).

#### sort

| Value | Description | Sort                          |
| ----- | ----------- | ----------------------------- |
| id    | ID sản phẩm | desc: giảm dần, asc: tăng dần |

## Response

* Xem cấu trúc chung [tại đây](/v3/readme.md#response).

### Failed response

* Xem các mã lỗi chung [tại đây](/v3/readme.md#failed-response).

### Successful response

```json
{
	"code": 1,
	"paginator": {
		"next": "Dùng để lấy dũ liệu trang tiếp theo"
	},
	"data": [
		{
            "depot": {
                "id": "(int) Id cửa hàng",
                "name": "(string) Tên cửa hàng"
            },
			"product": {
				"id": "(double) Id sản phẩm",
				"barcode": "(string) Mã vạch sản phẩm",
				"code": "(string) Mã sản phẩm",
				"name": "(string) Tên sản phẩm",
				"remain": "(double) Tồn hiện tại"
			},
            "minRemain": "(double) Tồn tối thiểu sản phẩm",
            "maxRemain": "(double) Tồn tối đa sản phẩm",
            "waiting": "(double) Số lượng chờ nhập hàng",
            "available": "(double) Số lượng có thể bán",
            "createdBy": {
                "id": "(int) Id người tạo",
                "name": "(string) Tên người tạo"
            },
            "createdAt": "(double) Thời gian tạo hạn mức tồn kho",
            "updatedAt": "(double) Thời gian cập nhật hạn mức tồn kho"
		}
	]
}
```


---

# 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://apidocs.nhanh.vn/v3/inventory/archive.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.
