Open the panel

Promotions PRO ​

A promotion takes a percentage off for a period, for the whole store or for some products. In the panel, they are called Discounts. When several apply, the biggest one wins.

List promotions ​

GET/discounts
Scope discounts: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/discounts?limit=1" \
  -H "Authorization: Bearer $FASTY_KEY"
js
const res = await fetch('https://api.fastyvendor.com/api/v1/discounts?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/discounts?limit=1",
    headers={"Authorization": f"Bearer {os.environ['FASTY_KEY']}"},
)
data = res.json()
lsl
llHTTPRequest(API + "/discounts?limit=1",
    [HTTP_CUSTOM_HEADER, "Authorization", "Bearer " + KEY,
     HTTP_BODY_MAXLENGTH, 16384],
    "");

Response: 200 OK

json
{
  "items": [
    {
      "id": "dsc_fkwvf2r58mtetr",
      "name": "Weekend sale",
      "percent": 15,
      "scope": {
        "mode": "all",
        "products": [],
        "groups": []
      },
      "starts_at": "2026-11-04T18:27:04.208Z",
      "ends_at": null,
      "state": "active",
      "products": 98,
      "sales": 0,
      "revenue": 0,
      "given": 0,
      "created_at": "2026-11-04T18:27:04.209Z"
    }
  ],
  "next_cursor": "1"
}

Create a promotion ​

POST/discounts
Scope discounts:writeLimit change (120 per minute)

A % off with dates. When several apply, the biggest one wins.

Without starts_at, the sale starts now. Without ends_at, it runs until you end it. Vendors change their price by themselves.

Body

NameTypeRequiredDescription
namestringNoThe name. Up to 60 characters.
percentintegerYesPercent off. From 1 to 90.
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.
starts_atstring or nullNonull or missing = now.
ends_atstring or nullNonull = until you end it.

Example

bash
curl -X POST "https://api.fastyvendor.com/api/v1/discounts" \
  -H "Authorization: Bearer $FASTY_KEY" \
  -H "Idempotency-Key: my-unique-id-123" \
  -H "Content-Type: application/json" \
  -d '{"name":"Weekend sale","percent":15}'
js
const res = await fetch('https://api.fastyvendor.com/api/v1/discounts', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.FASTY_KEY}`,
    'Idempotency-Key': 'my-unique-id-123',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"name":"Weekend sale","percent":15}),
})
const data = await res.json()
python
import os, requests

res = requests.post(
    "https://api.fastyvendor.com/api/v1/discounts",
    headers={"Authorization": f"Bearer {os.environ['FASTY_KEY']}", "Idempotency-Key": "my-unique-id-123"},
    json={"name":"Weekend sale","percent":15},
)
data = res.json()
lsl
llHTTPRequest(API + "/discounts",
    [HTTP_METHOD, "POST",
     HTTP_MIMETYPE, "application/json",
     HTTP_CUSTOM_HEADER, "Authorization", "Bearer " + KEY,
     HTTP_CUSTOM_HEADER, "Idempotency-Key", "my-unique-id-123"],
    "{\"name\":\"Weekend sale\",\"percent\":15}");

Response: 201 Created

json
{
  "id": "dsc_fkwvf2r58mtetr",
  "name": "Weekend sale",
  "percent": 15,
  "scope": {
    "mode": "all",
    "products": [],
    "groups": []
  },
  "starts_at": "2026-11-04T18:27:04.208Z",
  "ends_at": null,
  "state": "active",
  "products": 98,
  "sales": 0,
  "revenue": 0,
  "given": 0,
  "created_at": "2026-11-04T18:27:04.209Z"
}

End a promotion now ​

POST/discounts/{id}/end
Scope discounts:writeLimit change (120 per minute)

Path

NameTypeRequiredDescription
idstringYesThe id.

Example

bash
curl -X POST "https://api.fastyvendor.com/api/v1/discounts/dsc_fkwvf2r58mtetr/end" \
  -H "Authorization: Bearer $FASTY_KEY" \
  -H "Idempotency-Key: my-unique-id-123"
js
const res = await fetch('https://api.fastyvendor.com/api/v1/discounts/dsc_fkwvf2r58mtetr/end', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.FASTY_KEY}`,
    'Idempotency-Key': 'my-unique-id-123',
  },
})
const data = await res.json()
python
import os, requests

res = requests.post(
    "https://api.fastyvendor.com/api/v1/discounts/dsc_fkwvf2r58mtetr/end",
    headers={"Authorization": f"Bearer {os.environ['FASTY_KEY']}", "Idempotency-Key": "my-unique-id-123"},
)
data = res.json()
lsl
llHTTPRequest(API + "/discounts/dsc_fkwvf2r58mtetr/end",
    [HTTP_METHOD, "POST",
     HTTP_CUSTOM_HEADER, "Authorization", "Bearer " + KEY,
     HTTP_CUSTOM_HEADER, "Idempotency-Key", "my-unique-id-123"],
    "");

Response: 200 OK

json
{
  "id": "dsc_fkwvf2r58mtetr",
  "name": "Weekend sale",
  "percent": 15,
  "scope": {
    "mode": "all",
    "products": [],
    "groups": []
  },
  "starts_at": "2026-11-04T18:27:04.208Z",
  "ends_at": "2026-11-04T18:27:04.283Z",
  "state": "ended",
  "products": 98,
  "sales": 0,
  "revenue": 0,
  "given": 0,
  "created_at": "2026-11-04T18:27:04.209Z"
}

The promotion object ​

FieldTypeDescription
idstringThe id.
namestringThe name.
percentintegerPercent 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.
starts_atstringISO 8601 date and time (UTC).
ends_atstring or nullISO 8601 date and time (UTC), or null.
statestringThe current state. One of scheduled, active, ended.
productsintegerProducts whose price it changes right now. From -9,007,199,254,740,991 to 9,007,199,254,740,991.
salesintegerHow many sales. 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.
givenintegerL$ given as discount. From -9,007,199,254,740,991 to 9,007,199,254,740,991.
created_atstringISO 8601 date and time (UTC).