staqlydocs
REST APIAPI referenceBilling

Subscription period, cards on file and invoices

Subscription period, cards on file and invoices (admin)

Every request sends Authorization: Bearer ...: the access token in local mode, an API key stk_... in cloud mode. Use Send to try it against your cloud instance with your API key.

GET
/v1/billing/details

Read from Stripe on every request and never stored: the current subscription (status, billing period, cancellation, trial end, price), the cards on file (brand, last four digits, expiry) and the newest invoices, 24 per page. Without billing or before the first checkout the lists are empty.

Authorization

headerAuthorizationBearer <token>

API key (stk_...), or in the Community Edition the access token (stk_local_...)

Query Parameters

starting_after?string

The id of the last invoice of the previous page; the answer then lists only invoices

Response Body

Billing details

application/json
  1. response
enabled*boolean

Billing is configured on this instance

subscription*|null
payment_methods*array<>
invoices*array<>
has_more_invoices*boolean

Older invoices exist; pass the last id as starting_after

managed_payments*boolean

Checkouts on this server use Stripe Managed Payments: Stripe, through Link, is the merchant of record and sends the receipts and invoices

curl -X GET 'https://staqly.example.com/v1/billing/details'
{  "enabled": true,  "subscription": {    "status": "active",    "current_period_start": "string",    "current_period_end": "string",    "cancel_at_period_end": true,    "cancel_at": "string",    "canceled_at": "string",    "trial_end": "string",    "amount": 2900,    "currency": "usd",    "interval": "month",    "quantity": 3  },  "payment_methods": [    {      "brand": "visa",      "last4": "4242",      "exp_month": 12,      "exp_year": 2030,      "default": true    }  ],  "invoices": [    {      "id": "in_1Q2w3E4r5T6y7U8i",      "number": "A1B2C3D4-0001",      "created": "string",      "period_start": "string",      "period_end": "string",      "total": 0,      "amount_paid": 0,      "amount_due": 0,      "currency": "usd",      "status": "paid",      "hosted_invoice_url": "string",      "invoice_pdf": "string"    }  ],  "has_more_invoices": true,  "managed_payments": true}