Skip to main content

REST API

Subscribd ships a public REST API for headless or mobile integrations. It is disabled by default — enable it in config/subscribd.php:

Authentication

The API uses stateless Bearer tokens issued per-billable. The token issuance and revocation endpoints are protected by your own session auth (the token_middleware config key).

Issue a token

No request body required. The authenticated user receives a token scoped to their account. Response:

Revoke a token

Use the Bearer token on all other endpoints:

Plans

Plans are read-only via the API. Write operations (create/update/delete) are admin-only.

List plans

Response:

Get a plan


Subscriptions

All subscription endpoints are scoped to the token owner — a billable cannot access another billable’s subscriptions.

List subscriptions

Response:

Get a subscription

Cancel a subscription

Request body (optional):
immediately: false (default) cancels at period end (grace period). immediately: true revokes access immediately.

Resume a subscription

Resumes a paused or grace-period subscription.

Tally metered usage

Request body:
idempotencyKey is optional. When provided, duplicate requests with the same key are silently ignored.

Upgrade from free

Request body:
Upgrades a community/free subscription to a paid plan. Assumes payment has already been collected.

Invoices

List invoices

Response:

Get an invoice


Payment methods

List payment methods

Response:

Delete a payment method

Set as default


Error responses

All errors return a JSON body with message and an appropriate HTTP status code.

Rate limiting

Rate limiting is not applied by default. Add it via your token_middleware stack:

Next steps

  • Testing — How to test API integrations with the FakeGateway
  • Hooks and Events — Events fired during API operations