REST API
Subscribd ships a public REST API for headless or mobile integrations. It is disabled by default — enable it inconfig/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 (thetoken_middleware config key).
Issue a token
Revoke a token
Plans
Plans are read-only via the API. Write operations (create/update/delete) are admin-only.List plans
Get a plan
Subscriptions
All subscription endpoints are scoped to the token owner — a billable cannot access another billable’s subscriptions.List subscriptions
Get a subscription
Cancel a subscription
immediately: false (default) cancels at period end (grace period). immediately: true revokes access immediately.
Resume a subscription
Tally metered usage
idempotencyKey is optional. When provided, duplicate requests with the same key are silently ignored.
Upgrade from free
Invoices
List invoices
Get an invoice
Payment methods
List payment methods
Delete a payment method
Set as default
Error responses
All errors return a JSON body withmessage and an appropriate HTTP status code.
| Status | Meaning |
|---|---|
| 401 | Invalid or missing Bearer token |
| 403 | Token owner does not own the resource |
| 404 | Resource not found |
| 422 | Validation error — errors key contains field-level messages |
| 500 | Gateway or server error — check your logs |
Rate limiting
Rate limiting is not applied by default. Add it via yourtoken_middleware stack:
Next steps
- Testing — How to test API integrations with the FakeGateway
- Hooks and Events — Events fired during API operations