Billing
Get billing info
GET
Get billing info. Scoped to the organization named by organization_id.
header
AuthorizationBearer <esk_live_…>A workspace API key created in workspace settings. It acts as the member who created it, narrowed to its abilities, projects and credit limit. Each operation names the ability it needs.
Scope: billing:read
organization_id*stringMatch
^org_Endless-Api-Version?stringPin the caller to an API major (1). Omit to accept the current version. A major this deployment cannot serve is refused with 400 unsupported_api_version.
OK
application/json- response
organization_id*stringorganization_name*stringhas_customer*booleanhas_subscription*booleancustomer*|nullsubscription*|nullavailable_plans*array<>credit_purchase*postpaid*|nullstore_subscription?|nullcurl -X GET 'https://api.endless.app/organizations/org_abc123/billing'Example Response
{ "organization_id": "string", "organization_name": "string", "has_customer": true, "has_subscription": true, "customer": { "id": "string", "name": "string", "email": "string", "billing_emails": [ "string" ], "balance": 0, "delinquent": true, "has_payment_method": true, "payment_method": { "type": "string", "brand": "string", "last4": "string", "exp_month": 0, "exp_year": 0, "funding": "string", "is_default": true }, "chargeable_card": { "type": "string", "brand": "string", "last4": "string", "exp_month": 0, "exp_year": 0, "funding": "string", "is_default": true } }, "subscription": { "id": "string", "status": "active", "is_active": true, "current_period_start": "string", "current_period_end": "string", "next_period_start": "string", "next_period_end": "string", "next_invoice": { "amount_due": 0, "currency": "string", "billed_at": "string" }, "cancel_at": "string", "canceled_at": "string", "cancel_at_period_end": true, "trial_start": "string", "trial_end": "string", "collection_method": "string", "cancels_at_trial_end": true, "is_linked": true, "latest_invoice": { "status": "string", "amount_due": 0, "amount_paid": 0, "currency": "string", "hosted_invoice_url": "string", "due_date": "string", "created": "string" }, "discounts": [ { "id": "string", "coupon_name": "string", "percent_off": 0, "amount_off": 0, "currency": "string", "duration": "string", "duration_in_months": 0, "end": "string" } ], "collection_state": { "collects": "card", "has_payment_method": true, "card": { "type": "string", "brand": "string", "last4": "string", "exp_month": 0, "exp_year": 0, "funding": "string", "is_default": true }, "card_expired": true, "card_source": "subscription", "customer_default_card": { "type": "string", "brand": "string", "last4": "string", "exp_month": 0, "exp_year": 0, "funding": "string", "is_default": true }, "billing_email": "string", "trial_outcome": "bills", "trial_ends_at": "string", "trial_end_behavior": "string", "self_renews": true, "ends_at": "string", "ends_reason": "scheduled_date", "next_bill": "scheduled", "next_bill_at": "string", "last_payment": { "at": "string", "amount": 0, "currency": "string", "out_of_band": true }, "open_drafts": 0 }, "plan": { "plan_id": "hobby", "name": "string", "description": "string", "credits": 0, "price": 0, "currency": "string", "interval": "month" }, "scheduled_change": { "effective_date": "string", "managed_by_staff": true, "new_plan": { "plan_id": "hobby", "name": "string", "credits": 0, "price": 0, "currency": "string", "interval": "month" } } }, "available_plans": [ { "id": "string", "plan_id": "hobby", "name": "string", "description": "string", "prices": [ { "id": "string", "amount": 0, "currency": "string", "interval": "month", "credits": 0, "usage_interval": "string", "usage_interval_count": 0 } ] } ], "credit_purchase": { "blocked_reason": "no_subscription", "rate": { "unit_amount_cents": -9007199254740991, "credits_per_billing_period": -9007199254740991, "credits_per_cycle": -9007199254740991, "currency": "string" }, "pays_out_of_band": true, "next_invoice_at": "string" }, "postpaid": { "contact_email": "string", "contact_phone": "string", "partner_support": true }, "store_subscription": { "plan": "hobby", "product_id": "string", "original_transaction_id": "string", "will_renew": true, "current_period_end": "string", "is_active": true }}