Open the panel

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/coupons
Scope coupons:readLimit read (600 per minute)

Query

NameTypeRequiredDescription
cursorstringNoThe next_cursor of the previous page.
limitintegerNoPage 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}
Scope coupons:readLimit read (600 per minute)

Path

NameTypeRequiredDescription
idstringYesThe 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/coupons
Scope coupons:writeLimit change (120 per minute)

One 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

NameTypeRequiredDescription
namestringNoThe name. Up to 60 characters.
kindstringYesWhat kind it is. One of percent, amount.
valueintegerYespercent: 1–100 (100 = free) · amount: L$ off. From 1 to 1,000,000.
scopeobjectNoWhere it is valid.
scope.modestringYesall = everything · except = all but the lists · only = just the lists. One of all, except, only.
scope.productsarray of stringsNoProduct ids.
scope.groupsarray of stringsNoGroup ids.
min_priceintegerNoThe lowest price it works on, in L$. From 0 to 1,000,000.
starts_atstring or nullNoWhen it starts.
ends_atstring or nullNoWhen it ends.
max_usesinteger or nullNonull = unlimited From 1 to 1,000,000.
per_avatarinteger or nullNoUses per avatar (default 1; null = unlimited). From 1 to 1,000,000.
avatarsarray of stringsNoPersonal coupon: only these avatars.
codestringNo3–24 letters, numbers, - or _ (empty = generated). Up to 24 characters.
batchobjectNoCreate single-use codes instead of one code.
batch.prefixstringNoUp to 10 characters.
batch.countintegerYesFrom 1 to 500.
notifybooleanNoPersonal 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}
Scope coupons:writeLimit change (120 per minute)

active: false pauses it.

Send only what changes. code can only change while nobody has used the coupon.

Path

NameTypeRequiredDescription
idstringYesThe id.

Body

NameTypeRequiredDescription
namestringNoThe name. Up to 60 characters.
kindstringNoWhat kind it is. One of percent, amount.
valueintegerNopercent: 1–100 (100 = free) · amount: L$ off. From 1 to 1,000,000.
scopeobjectNoWhere it is valid.
scope.modestringYesall = everything · except = all but the lists · only = just the lists. One of all, except, only.
scope.productsarray of stringsNoProduct ids.
scope.groupsarray of stringsNoGroup ids.
min_priceintegerNoThe lowest price it works on, in L$. From 0 to 1,000,000.
starts_atstring or nullNoWhen it starts.
ends_atstring or nullNoWhen it ends.
max_usesinteger or nullNonull = unlimited From 1 to 1,000,000.
per_avatarinteger or nullNoUses per avatar (default 1; null = unlimited). From 1 to 1,000,000.
avatarsarray of stringsNoPersonal coupon: only these avatars.
activebooleanNofalse = paused.
codestringNoOnly 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 ​

FieldTypeDescription
idstringThe id.
namestringThe name.
codestringThe code (the first one of a batch).
codesintegerHow many codes (1, or the batch size). From -9,007,199,254,740,991 to 9,007,199,254,740,991.
codes_usedintegerFrom -9,007,199,254,740,991 to 9,007,199,254,740,991.
batchbooleanA batch of single-use codes.
kindstringWhat kind it is. One of percent, amount.
valueintegerpercent: 1–100 (100 = free) · amount: L$ off. From -9,007,199,254,740,991 to 9,007,199,254,740,991.
scopeobjectWhere it is valid: all products, all except the lists, or only the lists.
scope.modestringall = everything · except = all but the lists · only = just the lists. One of all, except, only.
scope.productsarray of stringsProduct ids.
scope.groupsarray of stringsGroup ids.
min_priceintegerThe lowest price it works on, in L$. From -9,007,199,254,740,991 to 9,007,199,254,740,991.
starts_atstring or nullISO 8601 date and time (UTC), or null.
ends_atstring or nullISO 8601 date and time (UTC), or null.
max_usesinteger or nullFrom -9,007,199,254,740,991 to 9,007,199,254,740,991.
per_avatarinteger or nullFrom -9,007,199,254,740,991 to 9,007,199,254,740,991.
avatarsarray of stringsPersonal coupon: only these avatars can use it (empty = anyone).
activebooleanfalse = paused.
statestringactive, scheduled, ended, paused or used_up.
usesintegerHow many times it was used. From -9,007,199,254,740,991 to 9,007,199,254,740,991.
discount_givenintegerL$ given as discount. From -9,007,199,254,740,991 to 9,007,199,254,740,991.
revenueintegerL$ sold with it. From -9,007,199,254,740,991 to 9,007,199,254,740,991.
created_atstringISO 8601 date and time (UTC).