Commit 180bea9
Add Coupon API Support to Messaging API (#719)
line/line-openapi#111
# Add Coupon API Support to Messaging API
We've supported a set of new APIs that make it possible to create,
manage, and deliver coupons via the Messaging API. These features
provide functionality similar to what's available through the LINE
Official Account Manager interface ([see
here](https://www.lycbiz.com/jp/manual/OfficialAccountManager/coupons-create/)),
allowing developers to integrate coupon-related workflows into their
bots more flexibly.
For more details, see the official announcement:
[LINE Developers News — Coupon API Released
(2025/08/06)](https://developers.line.biz/en/news/2025/08/06/coupon-api/)
## New API Endpoints
- `POST /v2/bot/coupon`
Create a new coupon.
The request includes metadata such as the coupon title, description,
image URLs, validity period, reward details(e.g. 1000yen discount),
acquisition requirements, time zone, etc.
- `GET /v2/bot/coupon`
Retrieve a list of coupons associated with the bot.
- `GET /v2/bot/coupon/{couponId}`
Fetch detailed information about a specific coupon.
- `PUT /v2/bot/coupon/{couponId}`
Mark a coupon as expired.
## Messaging API Update
Message Object now supports a new type: `type=coupon`
This allows developers to send coupons directly to users via the
Messaging API, similar to sending text, image, or template messages.
## Example Requests
### Create a Coupon
```
POST /v2/bot/coupon
Content-Type: application/json
```
#### Request body
```json
{
"title": "1000 yen off coupon",
"acquisitionCondition": {
"type": "normal"
},
"visibility": "PUBLIC",
"startTimestamp": 1672537600,
"endTimestamp": 1672624000,
"maxUseCountPerTicket": 1,
"reward": {
"type": "discount",
"priceInfo": {
"priceInfoType": "fixed",
"fixedAmount": 1000
}
},
"imageUrl": "https://example.com/coupon_image.png",
"barcodeImageUrl": "https://example.com/coupon_barcode.png",
"timezone": "ASIA_TOKYO"
}
```
#### Response
```json
{
"couponId": "abc1234"
}
```
### Send a Coupon Message
```json
{
"to": "<userId>",
"messages": [
{
"type": "coupon",
"couponId": "abc1234"
}
]
}
```
---------
Co-authored-by: github-actions <[email protected]>
Co-authored-by: habara keigo <[email protected]>1 parent ebf52cb commit 180bea9
File tree
126 files changed
+127858
-9033
lines changed- docs
- classes
- files
- indices
- js
- namespaces
- packages
- src/clients/messaging-api/lib
- Api
- Model
- test/clients/messaging-api/Api
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
126 files changed
+127858
-9033
lines changedLines changed: 4536 additions & 2858 deletions
Large diffs are not rendered by default.
Lines changed: 1892 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1892 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1968 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 2208 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1968 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1968 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1892 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1892 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1968 additions & 0 deletions
Large diffs are not rendered by default.
0 commit comments