StoreLyne API docs 2026-11

Discount codes

GET/admin/2026-11/discounts

scope read_discounts

Response 200

  • dataarray of objectrequired
  • data[].idID (dsc_...)required
  • data[].codestringrequired
  • data[].kindenumrequired

    One of percent fixed

  • data[].valueintegerrequired

    Basis points for percent (1000 = 10%), paise for fixed.

  • data[].min_subtotalintegerrequired
  • data[].max_usesinteger or nullrequired
  • data[].usesintegerrequired
  • data[].page_slugstring or nullrequired

    Only for this payment page; null for the whole store.

  • data[].starts_attimestamp or nullrequired
  • data[].ends_attimestamp or nullrequired
  • data[].statusenumrequired

    One of active disabled

  • data[].created_attimestamprequired

Errors

401authentication_requiredSend a valid access token or session.
403missing_scopeThe app token does not have the scope this endpoint needs.
429rate_limitedToo many requests. Wait for the time in RateLimit-Reset.
500internal_errorSomething went wrong on our side. Quote the trace_id to support.
curl https://api.storelyne.com/admin/2026-11/discounts \
  -H "Authorization: Bearer pat_live_..."
Response 200
{
  "data": [
    {
      "id": "dsc_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
      "code": "string",
      "kind": "percent",
      "value": 1,
      "min_subtotal": 49900,
      "max_uses": 1,
      "uses": 1,
      "page_slug": "festive-saree",
      "starts_at": "2026-11-04T10:00:00.000Z",
      "ends_at": "2026-11-04T10:00:00.000Z",
      "status": "active",
      "created_at": "2026-11-04T10:00:00.000Z"
    }
  ]
}

Create a discount code

POST/admin/2026-11/discounts

scope write_discountsIdempotency-Key required

Headers

  • Idempotency-Keystringrequired

    Unique key for this request. Retries with the same key return the first response.

    At least 1 characters · Up to 255 characters

  • X-CSRF-Tokenstring

    Required with a seller session cookie: the value of the orb_csrf cookie.

Request body

  • codestringrequired
  • kindenumrequired

    One of percent fixed

  • valueintegerrequired

    Up to 10000000

  • min_subtotalinteger

    Default 0 · 0 to 10000000

  • max_usesinteger or null

    Default null

  • page_slugstring or null

    Default null

  • starts_attimestamp or null

    Default null

  • ends_attimestamp or null

    Default null

Response 201

  • idID (dsc_...)required
  • codestringrequired
  • kindenumrequired

    One of percent fixed

  • valueintegerrequired

    Basis points for percent (1000 = 10%), paise for fixed.

  • min_subtotalintegerrequired
  • max_usesinteger or nullrequired
  • usesintegerrequired
  • page_slugstring or nullrequired

    Only for this payment page; null for the whole store.

  • starts_attimestamp or nullrequired
  • ends_attimestamp or nullrequired
  • statusenumrequired

    One of active disabled

  • created_attimestamprequired

Errors

400idempotency_key_requiredEvery POST needs an Idempotency-Key header.
400validation_failedA field in the request is missing or invalid. See param.
401authentication_requiredSend a valid access token or session.
403missing_scopeThe app token does not have the scope this endpoint needs.
409conflictThe request conflicts with the current state of the object.
409idempotency_in_progressA request with this Idempotency-Key is still running.
422idempotency_key_reusedThis Idempotency-Key was used with a different request.
429rate_limitedToo many requests. Wait for the time in RateLimit-Reset.
500internal_errorSomething went wrong on our side. Quote the trace_id to support.
curl -X POST https://api.storelyne.com/admin/2026-11/discounts \
  -H "Authorization: Bearer pat_live_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "code": "string",
  "kind": "percent",
  "value": 1
}'
Response 201
{
  "id": "dsc_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
  "code": "string",
  "kind": "percent",
  "value": 1,
  "min_subtotal": 49900,
  "max_uses": 1,
  "uses": 1,
  "page_slug": "festive-saree",
  "starts_at": "2026-11-04T10:00:00.000Z",
  "ends_at": "2026-11-04T10:00:00.000Z",
  "status": "active",
  "created_at": "2026-11-04T10:00:00.000Z"
}

Turn a code on or off, or change its end date or limit

PATCH/admin/2026-11/discounts/{id}

scope write_discounts

Path parameters

  • idID (dsc_...)required

Headers

  • X-CSRF-Tokenstring

    Required with a seller session cookie: the value of the orb_csrf cookie.

Request body

  • statusenum

    One of active disabled

  • ends_attimestamp or null
  • max_usesinteger or null

Response 200

  • idID (dsc_...)required
  • codestringrequired
  • kindenumrequired

    One of percent fixed

  • valueintegerrequired

    Basis points for percent (1000 = 10%), paise for fixed.

  • min_subtotalintegerrequired
  • max_usesinteger or nullrequired
  • usesintegerrequired
  • page_slugstring or nullrequired

    Only for this payment page; null for the whole store.

  • starts_attimestamp or nullrequired
  • ends_attimestamp or nullrequired
  • statusenumrequired

    One of active disabled

  • created_attimestamprequired

Errors

400validation_failedA field in the request is missing or invalid. See param.
401authentication_requiredSend a valid access token or session.
403missing_scopeThe app token does not have the scope this endpoint needs.
404resource_not_foundThe object does not exist or belongs to another store.
429rate_limitedToo many requests. Wait for the time in RateLimit-Reset.
500internal_errorSomething went wrong on our side. Quote the trace_id to support.
curl -X PATCH https://api.storelyne.com/admin/2026-11/discounts/dsc_01JCG8ZQ5S7T0V4X8K2M3N6P9R \
  -H "Authorization: Bearer pat_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "status": "active",
  "ends_at": "2026-11-04T10:00:00.000Z",
  "max_uses": 1
}'
Response 200
{
  "id": "dsc_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
  "code": "string",
  "kind": "percent",
  "value": 1,
  "min_subtotal": 49900,
  "max_uses": 1,
  "uses": 1,
  "page_slug": "festive-saree",
  "starts_at": "2026-11-04T10:00:00.000Z",
  "ends_at": "2026-11-04T10:00:00.000Z",
  "status": "active",
  "created_at": "2026-11-04T10:00:00.000Z"
}