Skip to content

White-Label Subscriptions

The White-Label Subscription object

object

Attributes

featurestring
allowedboolean
requires_upgradeboolean
upgrade_plan_slugstring

Create checkout session

POST/white-label-subscriptions/checkout

Creates a Stripe Checkout session to subscribe to a plan.

Body parameters

plan_slugstringrequired

Plan slug to subscribe to

billing_intervalstringrequired

Billing interval

Possible values: "monthly", "yearly"

success_urlstring<uri>required

URL to redirect to after successful checkout

cancel_urlstring<uri>required

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_urlstring
json
{
  "checkout_url": "string"
}

Create customer portal session

POST/white-label-subscriptions/portal

Creates a Stripe Customer Portal session to manage subscription.

Body parameters

return_urlstring<uri>required

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_urlstring
json
{
  "portal_url": "string"
}

Get current subscription

GET/white-label-subscriptions

Returns the current entity subscription with plan details and usage stats. Requires entity context.

Returns

planobject
statusstring
billing_intervalstring
current_period_startstring
current_period_endstring
usageobject
json
{
  "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

GET/white-label-subscriptions/plans

Returns available subscription plans for the current white-label.

Returns

plansarray of objects
current_plan_slugstring
json
{
  "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

GET/white-label-subscriptions/check-feature/{feature}

Checks if a specific feature is available on the current subscription plan.

Path parameters

featurestringrequired

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

featurestring
allowedboolean
requires_upgradeboolean
upgrade_plan_slugstring
json
{
  "feature": "string",
  "allowed": true,
  "requires_upgrade": true,
  "upgrade_plan_slug": "string"
}

Check resource limit

GET/white-label-subscriptions/check-limit/{resource}

Checks if the current usage allows creating more of a resource type.

Path parameters

resourcestringrequired

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

resourcestring
allowedboolean
usageinteger
limitinteger
percentagenumber
json
{
  "resource": "string",
  "allowed": true,
  "usage": 0,
  "limit": 0,
  "percentage": 0
}