# Thêm mã coupon vào chương trình

Tính năng này được sử dụng để cập nhật thêm mã vào chương trình coupon đã có trên hệ thống.

## Request

* Xem [common request params](https://apidocs.nhanh.vn/v3/readme#request-params).
* Xem [Postman sample](https://apidocs.nhanh.vn/v3/promotion/batchincreasecode).

```curl
curl --location 'https://pos.open.nhanh.vn/v3.0/promotion/batchincreasecode?appId={{appId}}&businessId={{businessId}}' \
--header 'Authorization: {{accessToken}}' \
--header 'Content-Type: application/json'
--data '{
    "batchId": 27642,
    "couponNumber": 500,
    "canUsedTimes": 10
}'
```

### Thông tin cập nhật chương trình coupon

| Key          | Type                       | Description                                   |
| ------------ | -------------------------- | --------------------------------------------- |
| batchId      | int $$^{{\color{red}\*}}$$ | ID chương trình coupon                        |
| couponNumber | int $$^{{\color{red}\*}}$$ | Số lượng mã coupon muốn thêm (Tối đa 1000 mã) |
| canUsedTimes | int $$^{{\color{red}\*}}$$ | Số lần sử dụng từng mã coupon                 |
| codeLength   | int                        | Độ dài mã coupon                              |
| prefix       | string                     | Tiền tố                                       |
| suffix       | string                     | Hậu tố                                        |

## 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,
  "data": {
    "batchId": "(int) ID chương trình giảm giá"
  }
}
```
