# Quà tặng sản phẩm

* Tính năng này dùng để lấy danh sách quà tặng theo sản phẩm. Hỗ trợ tìm kiếm thông qua ID sản phẩm.

## Request

* Xem [common request params](https://apidocs.nhanh.vn/v3/readme#request-params).
* Xem [Postman sample](https://www.postman.com/nhanh-vn/pos-open-nhanh-vn/request/zg05uhc/product-gift).

```curl
curl --location 'https://pos.open.nhanh.vn/v3.0/product/gift?appId={{appId}}&businessId={{businessId}}' \
--header 'Authorization: {{accessToken}}' \
--header 'Content-Type: application/json'
--data '{
    "filters": {
        "ids": [100,101]
    },
    "paginator": {
        "size": 50
    }
}'
```

### Filters

| Key | Type  | Description                   |
| --- | ----- | ----------------------------- |
| ids | array | Mảng ID sản phẩm cần tìm kiếm |

## Response

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

### Failed response

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

### Successful response

```json
{
  "code": 1,
  "paginator": {
    "next": "Dùng để lấy dữ liệu trang tiếp theo"
  },
  "data": [
    {
      "categoryId": "(int) ID danh mục",
      "quantity": "(int) Số lượng quà tặng",
      "value": "(int) Giá trị quà tặng",
      "promotion": {
        "id": "(int) ID chương trình khuyến mại",
        "startDate": "(string) Ngày bắt đầu",
        "endDate": "(string) Ngày kết thúc",
        "status": "(int) Trạng thái: 1 = Active, 2 = Inactive"
      },
      "product": {
        "id": "(int) ID sản phẩm",
        "code": "(string) Mã sản phẩm",
        "name": "(string) Tên sản phẩm"
      },
      "gift": {
        "id": "(int) ID sản phẩm quà tặng",
        "code": "(string) Mã sản phẩm quà tặng",
        "name": "(string) Tên sản phẩm quả tặng"
      },
      "createdAt": "(int) Thời gian tạo (định dạng timestamp)"
    }
  ]
}
```
