For the complete documentation index, see llms.txt. This page is also available as Markdown.

V1 Subscriptions

Subscription management (v1)

List subscriptions

get

List subscriptions with filtering and pagination.

Additional filter query parameters are available depending on the resource.

Authorizations
AuthorizationstringRequired

Account API key authentication. Pass an API key as a Bearer token in the Authorization header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes.

Query parameters
pageintegerOptional

Page number (1-based)

Example: 1
per_pageintegerOptional

Items per page (default 50)

Example: 50
sortstringOptional

Sort field (prefix with - for descending)

Example: -created_at
searchstringOptional

Full-text search query

Responses
200

Paginated list of resources

application/json
pageintegerRequired

Current page number

Example: 1
per_pageintegerRequired

Items per page

Example: 50
totalintegerRequired

Total number of items

Example: 250
total_pagesintegerRequired

Total number of pages

Example: 5
get/v1/subscriptions
GET /v1/subscriptions HTTP/1.1
Host: api.spiffy.co
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "data": [],
  "page": 1,
  "per_page": 50,
  "total": 250,
  "total_pages": 5
}

Report metered usage

post

Reports metered usage for a subscription. Returns the Stripe usage record(s).

Authorizations
AuthorizationstringRequired

Account API key authentication. Pass an API key as a Bearer token in the Authorization header. An account may have multiple named keys; any of them grants full access to all endpoints — equivalent to all OAuth scopes.

Path parameters
subscription_idstringRequired

Subscription ID

Body
quantitynumberRequired

Usage quantity to report

timestampnumberOptional

Unix timestamp for the usage event (defaults to now)

Responses
200

Stripe usage record(s)

application/json
any · nullableOptional
post/v1/subscriptions/{subscription_id}/usage
POST /v1/subscriptions/{subscription_id}/usage HTTP/1.1
Host: api.spiffy.co
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 28

{
  "quantity": 1,
  "timestamp": 1
}

No content

Last updated