White-Label Subscriptions
White-Label Subscriptions
Entity-level subscription management for white-label products.
The White-Label Subscription object
Attributes
Create checkout session
/white-label-subscriptions/checkoutCreates a Stripe Checkout session to subscribe to a plan.
Body parameters
Plan slug to subscribe to
Billing interval
Possible values: "monthly", "yearly"
URL to redirect to after successful checkout
URL to redirect to if checkout is cancelled
curl -X POST "https://eu.spaceinvoices.com/white-label-subscriptions/checkout" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-entity-id: YOUR_ENTITY_ID" \
-H "Content-Type: application/json" \
-d '{
"plan_slug": "string",
"billing_interval": "monthly",
"success_url": "string",
"cancel_url": "string"
}'Returns
{
"checkout_url": "string"
}Create customer portal session
/white-label-subscriptions/portalCreates a Stripe Customer Portal session to manage subscription.
Body parameters
URL to redirect to after leaving the portal
curl -X POST "https://eu.spaceinvoices.com/white-label-subscriptions/portal" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-entity-id: YOUR_ENTITY_ID" \
-H "Content-Type: application/json" \
-d '{
"return_url": "string"
}'Returns
{
"portal_url": "string"
}Get current subscription
/white-label-subscriptionsReturns the current entity subscription with plan details and usage stats. Requires entity context.
Returns
{
"plan": {
"id": "string",
"slug": "string",
"name": "string",
"billing_interval": "string",
"base_price_cents": 0,
"limits": {
"documents_per_month": 0
},
"features": [
"string"
],
"is_free": true,
"display_order": 0
},
"status": "string",
"billing_interval": "string",
"current_period_start": "string",
"current_period_end": "string",
"usage": {
"documents_count": 0,
"documents_limit": 0,
"period_start": "string",
"period_end": "string"
}
}Get available plans
/white-label-subscriptions/plansReturns available subscription plans for the current white-label.
Returns
{
"plans": [
{
"id": "string",
"slug": "string",
"name": "string",
"billing_interval": "string",
"base_price_cents": 0,
"limits": {
"documents_per_month": 0
},
"features": [
"string"
],
"is_free": true,
"display_order": 0
}
],
"current_plan_slug": "string"
}Check feature access
/white-label-subscriptions/check-feature/{feature}Checks if a specific feature is available on the current subscription plan.
Path parameters
Feature slug to check
curl "https://eu.spaceinvoices.com/white-label-subscriptions/check-feature/{feature}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-entity-id: YOUR_ENTITY_ID"Returns
{
"feature": "string",
"allowed": true,
"requires_upgrade": true,
"upgrade_plan_slug": "string"
}Check resource limit
/white-label-subscriptions/check-limit/{resource}Checks if the current usage allows creating more of a resource type.
Path parameters
Resource type to check (e.g., 'documents')
curl "https://eu.spaceinvoices.com/white-label-subscriptions/check-limit/{resource}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-entity-id: YOUR_ENTITY_ID"Returns
{
"resource": "string",
"allowed": true,
"usage": 0,
"limit": 0,
"percentage": 0
}