# Hạn sử dụng sản phẩm

* API này dùng để lấy [hạn sử dụng sản phẩm](https://nhanh.vn/inventory/expire/index).

## Request

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

```curl
curl --location 'https://pos.open.nhanh.vn/v3.0/product/expire?appId={{appId}}&businessId={{businessId}}' \
--header 'Authorization: {{accessToken}}' \
--header 'Content-Type: application/json'
--data '{
    "filters": {
        "billId": "ID hóa đơn"
    },
}'
```

### Filters

| Key                | Type   | Description                                     |
| ------------------ | ------ | ----------------------------------------------- |
| billId             | int    | ID hóa đơn xuất nhập kho                        |
| depotId            | int    | ID kho hàng                                     |
| categoryId         | int    | ID danh mục của sản phẩm                        |
| internalCategoryId | int    | ID danh mục nội bộ của sản phẩm                 |
| expiredDateFrom    | string | Thời gian hết hạn từ, định dạng Y-m-d           |
| expiredDateTo      | string | Thời gian hết hạn đến, định dạng Y-m-d          |
| daysWarningFrom    | int    | Số ngày cảnh báo trước từ                       |
| daysWarningTo      | int    | Số ngày cảnh báo trước đến                      |
| status             | int    | <p>Trạng thái<br>1 = Active<br>2 = Inactive</p> |

## 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": "Giá trị để lấy dữ liệu trang tiếp theo"
  },
  "data": [
    {
      "depot": {
        "id": "(int) ID kho hàng",
        "name": "(string) Tên kho hàng"
      },
      "product": {
        "id": "(int) ID sản phẩm",
        "name": "(string) Tên sản phẩm"
      },
      "billId": "(int) ID xuất nhập kho",
      "quantity": "(double) Số lượng",
      "expiredDate": "(string) Thời gian hết hạn, định dạng Y-m-d",
      "priorWarningDays": "(int) Số ngày cảnh báo trước",
      "status": "(int) Trạng thái"
    }
  ]
}
```


---

# 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/product/expire.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.
