Coupons PRO
A coupon is a code customers type on the vendor. It can take off a percentage or an amount in L$.
List coupons
GET
/couponsQuery
| Name | Type | Required | Description |
|---|---|---|---|
cursor | string | No | The next_cursor of the previous page. |
limit | integer | No | Page size (default 50, max 200). |
Example
bash
curl "https://api.fastyvendor.com/api/v1/coupons?limit=1" \
-H "Authorization: Bearer $FASTY_KEY"js
const res = await fetch('https://api.fastyvendor.com/api/v1/coupons?limit=1', {
headers: {
Authorization: `Bearer ${process.env.FASTY_KEY}`,
},
})
const data = await res.json()python
import os, requests
res = requests.get(
"https://api.fastyvendor.com/api/v1/coupons?limit=1",
headers={"Authorization": f"Bearer {os.environ['FASTY_KEY']}"},
)
data = res.json()lsl
llHTTPRequest(API + "/coupons?limit=1",
[HTTP_CUSTOM_HEADER, "Authorization", "Bearer " + KEY,
HTTP_BODY_MAXLENGTH, 16384],
"");Response: 200 OK
json
{
"items": [
{
"id": "cpn_pr1767nzgys18y",
"name": "Summer sale",
"code": "DOCMW2G7Z1O",
"codes": 1,
"codes_used": 0,
"batch": false,
"kind": "percent",
"value": 20,
"scope": {
"mode": "all",
"products": [],
"groups": []
},
"min_price": 0,
"starts_at": null,
"ends_at": null,
"max_uses": null,
"per_avatar": 1,
"avatars": [],
"active": true,
"state": "active",
"uses": 0,
"discount_given": 0,
"revenue": 0,
"created_at": "2026-11-04T18:27:04.056Z"
}
],
"next_cursor": "1"
}Get a coupon
GET
/coupons/{id}Path
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The id. |
Example
bash
curl "https://api.fastyvendor.com/api/v1/coupons/cpn_pr1767nzgys18y" \
-H "Authorization: Bearer $FASTY_KEY"js
const res = await fetch('https://api.fastyvendor.com/api/v1/coupons/cpn_pr1767nzgys18y', {
headers: {
Authorization: `Bearer ${process.env.FASTY_KEY}`,
},
})
const data = await res.json()python
import os, requests
res = requests.get(
"https://api.fastyvendor.com/api/v1/coupons/cpn_pr1767nzgys18y",
headers={"Authorization": f"Bearer {os.environ['FASTY_KEY']}"},
)
data = res.json()lsl
llHTTPRequest(API + "/coupons/cpn_pr1767nzgys18y",
[HTTP_CUSTOM_HEADER, "Authorization", "Bearer " + KEY,
HTTP_BODY_MAXLENGTH, 16384],
"");Response: 200 OK
json
{
"id": "cpn_pr1767nzgys18y",
"name": "Summer sale",
"code": "DOCMW2G7Z1O",
"codes": 1,
"codes_used": 0,
"batch": false,
"kind": "percent",
"value": 20,
"scope": {
"mode": "all",
"products": [],
"groups": []
},
"min_price": 0,
"starts_at": null,
"ends_at": null,
"max_uses": null,
"per_avatar": 1,
"avatars": [],
"active": true,
"state": "active",
"uses": 0,
"discount_given": 0,
"revenue": 0,
"created_at": "2026-11-04T18:27:04.056Z"
}Create a coupon
POST
/couponsOne code, or a batch of single-use codes (batch.count up to 500).
Leave code out and Fasty creates one. For a batch of single-use codes, send {"kind": "percent", "value": 10, "batch": {"prefix": "VIP", "count": 50}}: the answer lists every code in codes.
Body
| Name | Type | Required | Description |
|---|---|---|---|
name | string | No | The name. Up to 60 characters. |
kind | string | Yes | What kind it is. One of percent, amount. |
value | integer | Yes | percent: 1–100 (100 = free) · amount: L$ off. From 1 to 1,000,000. |
scope | object | No | Where it is valid. |
scope.mode | string | Yes | all = everything · except = all but the lists · only = just the lists. One of all, except, only. |
scope.products | array of strings | No | Product ids. |
scope.groups | array of strings | No | Group ids. |
min_price | integer | No | The lowest price it works on, in L$. From 0 to 1,000,000. |
starts_at | string or null | No | When it starts. |
ends_at | string or null | No | When it ends. |
max_uses | integer or null | No | null = unlimited From 1 to 1,000,000. |
per_avatar | integer or null | No | Uses per avatar (default 1; null = unlimited). From 1 to 1,000,000. |
avatars | array of strings | No | Personal coupon: only these avatars. |
code | string | No | 3–24 letters, numbers, - or _ (empty = generated). Up to 24 characters. |
batch | object | No | Create single-use codes instead of one code. |
batch.prefix | string | No | Up to 10 characters. |
batch.count | integer | Yes | From 1 to 500. |
notify | boolean | No | Personal coupon: send the code to the avatars by IM. |
Example
bash
curl -X POST "https://api.fastyvendor.com/api/v1/coupons" \
-H "Authorization: Bearer $FASTY_KEY" \
-H "Idempotency-Key: my-unique-id-123" \
-H "Content-Type: application/json" \
-d '{"name":"Summer sale","code":"DOCMW2G7Z1O","kind":"percent","value":20,"per_avatar":1}'js
const res = await fetch('https://api.fastyvendor.com/api/v1/coupons', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.FASTY_KEY}`,
'Idempotency-Key': 'my-unique-id-123',
'Content-Type': 'application/json',
},
body: JSON.stringify({"name":"Summer sale","code":"DOCMW2G7Z1O","kind":"percent","value":20,"per_avatar":1}),
})
const data = await res.json()python
import os, requests
res = requests.post(
"https://api.fastyvendor.com/api/v1/coupons",
headers={"Authorization": f"Bearer {os.environ['FASTY_KEY']}", "Idempotency-Key": "my-unique-id-123"},
json={"name":"Summer sale","code":"DOCMW2G7Z1O","kind":"percent","value":20,"per_avatar":1},
)
data = res.json()lsl
llHTTPRequest(API + "/coupons",
[HTTP_METHOD, "POST",
HTTP_MIMETYPE, "application/json",
HTTP_CUSTOM_HEADER, "Authorization", "Bearer " + KEY,
HTTP_CUSTOM_HEADER, "Idempotency-Key", "my-unique-id-123"],
"{\"name\":\"Summer sale\",\"code\":\"DOCMW2G7Z1O\",\"kind\":\"percent\",\"value\":20,\"per_avatar\":1}");Response: 201 Created
json
{
"coupon": {
"id": "cpn_pr1767nzgys18y",
"name": "Summer sale",
"code": "DOCMW2G7Z1O",
"codes": 1,
"codes_used": 0,
"batch": false,
"kind": "percent",
"value": 20,
"scope": {
"mode": "all",
"products": [],
"groups": []
},
"min_price": 0,
"starts_at": null,
"ends_at": null,
"max_uses": null,
"per_avatar": 1,
"avatars": [],
"active": true,
"state": "active",
"uses": 0,
"discount_given": 0,
"revenue": 0,
"created_at": "2026-11-04T18:27:04.056Z"
},
"codes": [
"DOCMW2G7Z1O"
]
}Change a coupon
PATCH
/coupons/{id}active: false pauses it.
Send only what changes. code can only change while nobody has used the coupon.
Path
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The id. |
Body
| Name | Type | Required | Description |
|---|---|---|---|
name | string | No | The name. Up to 60 characters. |
kind | string | No | What kind it is. One of percent, amount. |
value | integer | No | percent: 1–100 (100 = free) · amount: L$ off. From 1 to 1,000,000. |
scope | object | No | Where it is valid. |
scope.mode | string | Yes | all = everything · except = all but the lists · only = just the lists. One of all, except, only. |
scope.products | array of strings | No | Product ids. |
scope.groups | array of strings | No | Group ids. |
min_price | integer | No | The lowest price it works on, in L$. From 0 to 1,000,000. |
starts_at | string or null | No | When it starts. |
ends_at | string or null | No | When it ends. |
max_uses | integer or null | No | null = unlimited From 1 to 1,000,000. |
per_avatar | integer or null | No | Uses per avatar (default 1; null = unlimited). From 1 to 1,000,000. |
avatars | array of strings | No | Personal coupon: only these avatars. |
active | boolean | No | false = paused. |
code | string | No | Only while nobody used it, and not for batches. Up to 24 characters. |
Example
bash
curl -X PATCH "https://api.fastyvendor.com/api/v1/coupons/cpn_pr1767nzgys18y" \
-H "Authorization: Bearer $FASTY_KEY" \
-H "Content-Type: application/json" \
-d '{"active":false}'js
const res = await fetch('https://api.fastyvendor.com/api/v1/coupons/cpn_pr1767nzgys18y', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.FASTY_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({"active":false}),
})
const data = await res.json()python
import os, requests
res = requests.patch(
"https://api.fastyvendor.com/api/v1/coupons/cpn_pr1767nzgys18y",
headers={"Authorization": f"Bearer {os.environ['FASTY_KEY']}"},
json={"active":False},
)
data = res.json()lsl
llHTTPRequest(API + "/coupons/cpn_pr1767nzgys18y",
[HTTP_METHOD, "PATCH",
HTTP_MIMETYPE, "application/json",
HTTP_CUSTOM_HEADER, "Authorization", "Bearer " + KEY],
"{\"active\":false}");Response: 200 OK
json
{
"id": "cpn_pr1767nzgys18y",
"name": "Summer sale",
"code": "DOCMW2G7Z1O",
"codes": 1,
"codes_used": 0,
"batch": false,
"kind": "percent",
"value": 20,
"scope": {
"mode": "all",
"products": [],
"groups": []
},
"min_price": 0,
"starts_at": null,
"ends_at": null,
"max_uses": null,
"per_avatar": 1,
"avatars": [],
"active": false,
"state": "paused",
"uses": 0,
"discount_given": 0,
"revenue": 0,
"created_at": "2026-11-04T18:27:04.056Z"
}The coupon object
| Field | Type | Description |
|---|---|---|
id | string | The id. |
name | string | The name. |
code | string | The code (the first one of a batch). |
codes | integer | How many codes (1, or the batch size). From -9,007,199,254,740,991 to 9,007,199,254,740,991. |
codes_used | integer | From -9,007,199,254,740,991 to 9,007,199,254,740,991. |
batch | boolean | A batch of single-use codes. |
kind | string | What kind it is. One of percent, amount. |
value | integer | percent: 1–100 (100 = free) · amount: L$ off. From -9,007,199,254,740,991 to 9,007,199,254,740,991. |
scope | object | Where it is valid: all products, all except the lists, or only the lists. |
scope.mode | string | all = everything · except = all but the lists · only = just the lists. One of all, except, only. |
scope.products | array of strings | Product ids. |
scope.groups | array of strings | Group ids. |
min_price | integer | The lowest price it works on, in L$. From -9,007,199,254,740,991 to 9,007,199,254,740,991. |
starts_at | string or null | ISO 8601 date and time (UTC), or null. |
ends_at | string or null | ISO 8601 date and time (UTC), or null. |
max_uses | integer or null | From -9,007,199,254,740,991 to 9,007,199,254,740,991. |
per_avatar | integer or null | From -9,007,199,254,740,991 to 9,007,199,254,740,991. |
avatars | array of strings | Personal coupon: only these avatars can use it (empty = anyone). |
active | boolean | false = paused. |
state | string | active, scheduled, ended, paused or used_up. |
uses | integer | How many times it was used. From -9,007,199,254,740,991 to 9,007,199,254,740,991. |
discount_given | integer | L$ given as discount. From -9,007,199,254,740,991 to 9,007,199,254,740,991. |
revenue | integer | L$ sold with it. From -9,007,199,254,740,991 to 9,007,199,254,740,991. |
created_at | string | ISO 8601 date and time (UTC). |