Skip to main content
GET
/
api
/
v1
/
subscriptions
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 subscriptionListResponse of client.v1.subscriptions.list()) {
  console.log(subscriptionListResponse.id);
}
{
  "data": [
    {
      "id": "<string>",
      "customerId": "<string>",
      "billingId": "<string>",
      "createdAt": "2023-11-07T05:31:56Z",
      "startDate": "2023-11-07T05:31:56Z",
      "status": "PAYMENT_PENDING",
      "pricingType": "FREE",
      "paymentCollection": "NOT_REQUIRED",
      "planId": "<string>",
      "payingCustomerId": "<string>",
      "resourceId": "<string>",
      "endDate": "2023-11-07T05:31:56Z",
      "effectiveEndDate": "2023-11-07T05:31:56Z",
      "cancellationDate": "2023-11-07T05:31:56Z",
      "trialEndDate": "2023-11-07T05:31:56Z",
      "cancelReason": "UPGRADE_OR_DOWNGRADE",
      "metadata": {},
      "currentBillingPeriodStart": "2023-11-07T05:31:56Z",
      "currentBillingPeriodEnd": "2023-11-07T05:31:56Z",
      "paymentCollectionMethod": "CHARGE",
      "prices": []
    }
  ],
  "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
customerId
string

Filter by customer ID

status
string

Filter by status (comma-separated)

Response

OK

Response list object

data
Subscription · object[]
required
pagination
object
required

Pagination metadata including cursors for navigating through results