Skip to main content
GET
/
api
/
v1
/
coupons
JavaScript
import Stigg from '@stigg/typescript';

const client = new Stigg({
  apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const couponListResponse of client.v1.coupons.list()) {
  console.log(couponListResponse.id);
}
{
  "data": [
    {
      "id": "<string>",
      "name": "<string>",
      "description": "<string>",
      "type": "FIXED",
      "status": "ACTIVE",
      "source": "STIGG",
      "percentOff": 123,
      "amountsOff": [
        {
          "amount": 123,
          "currency": "usd"
        }
      ],
      "billingId": "<string>",
      "billingLinkUrl": "<string>",
      "durationInMonths": 123,
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z"
    }
  ],
  "pagination": {
    "next": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "prev": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  }
}

Authorizations

X-API-KEY
string
header
required

Server API Key

Headers

X-API-KEY
string
required

API Key

Query Parameters

after
string<uuid>

Return items that come after this cursor

before
string<uuid>

Return items that come before this cursor

limit
integer
default:20

Maximum number of items to return

Required range: 1 <= x <= 100

Response

OK

Response list object

data
Coupon · object[]
required
pagination
object
required

Pagination metadata including cursors for navigating through results