API REFERENCE
Get Account Subscription
On this page
/api/accounts/{id}/subscriptionRetrieve the subscription that confers an account's plan, directly or via an organization: isPro, status, plan, source, plus the billing fields name, amountCents, currency, interval, collectionMethod and currentPeriodEnd. Everything but isPro and status is null when status is none. id may be the authenticated account or an organization the caller belongs to.
Authentication
x-api-key in header
bearerAuth bearer
Request
curl --request GET \
--url 'https://api.recoupable.dev/api/accounts/YOUR_ID/subscription' \
--header 'x-api-key: YOUR_API_KEY'Replace the YOUR_ placeholders with your values. Required query parameters are included; optional parameters are listed below.
Parameters
Path parameters
idstringrequiredThe unique identifier (UUID) of the account. Must be the authenticated account or another accessible via organization membership.
Responses
200Subscription retrieved successfully+
application/json
isProbooleanrequiredTrue when the account has an active paid subscription, directly or via an organization.
statusstring · enumrequiredLifecycle state of the subscription. none when no subscription exists.
Values: "active", "trialing", "canceled", "past_due", "none"
planstringrequirednullablePlan identifier (e.g. pro). Null when no subscription exists.
sourcestring · enumrequirednullableOrigin of the subscription. account for direct, organization when covered by an organization. Null when no subscription exists.
Values: "account", "organization"
namestringrequirednullableDisplay name of the plan's Stripe price (nickname) or product. Null when no subscription exists.
amountCentsintegerrequirednullableRecurring amount in the smallest currency unit (cents for USD). Null when no subscription exists.
currencystringrequirednullableISO 4217 currency code, lowercase.
intervalstring · enumrequirednullableBilling interval of the recurring price.
Values: "day", "week", "month", "year"
collectionMethodstring · enumrequirednullablecharge_automatically bills the card on file at renewal; send_invoice emails an invoice that is paid manually (enterprise plans). A saved card is never charged for a send_invoice plan.
Values: "charge_automatically", "send_invoice"
currentPeriodEndstringrequirednullableEnd of the current billing period: the renewal date, or the next invoice date for invoiced plans.
format: date-time
401Unauthorized - invalid or missing authentication+
application/json
errorstringrequiredHuman-readable error message.
{
"error": "Unauthorized"
}403Forbidden - account not accessible to the authenticated account+
application/json
errorstringrequiredHuman-readable error message.
404Account not found+
application/json
errorstringrequiredHuman-readable error message.
Full specification
Download the OpenAPI file for complete schemas, constraints, and examples.
Download accounts.jsonView operation source
{
"description": "Retrieve the subscription that confers an account's plan, directly or via an organization: `isPro`, `status`, `plan`, `source`, plus the billing fields `name`, `amountCents`, `currency`, `interval`, `collectionMethod` and `currentPeriodEnd`. Everything but `isPro` and `status` is null when `status` is `none`. `id` may be the authenticated account or an organization the caller belongs to.",
"parameters": [
{
"name": "id",
"in": "path",
"description": "The unique identifier (UUID) of the account. Must be the authenticated account or another accessible via organization membership.",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"security": [
{
"apiKeyAuth": []
},
{
"bearerAuth": []
}
],
"responses": {
"200": {
"description": "Subscription retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SubscriptionResponse"
}
}
}
},
"401": {
"description": "Unauthorized - invalid or missing authentication",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SubscriptionErrorResponse"
},
"example": {
"error": "Unauthorized"
}
}
}
},
"403": {
"description": "Forbidden - account not accessible to the authenticated account",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SubscriptionErrorResponse"
}
}
}
},
"404": {
"description": "Account not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SubscriptionErrorResponse"
}
}
}
}
}
}