Skip to content
Menu
All API groups

Billing

Plans, subscription, invoices, usage.

11 endpoints.

GET/v1/billing/plans

Public plan list (no auth)

No key needed

Responses

GET/v1/billing/addons

Public add-on list (assistant conversation bundles; no auth)

No key needed

Responses

GET/v1/billing/subscription

Billing Subscription

Needs a key or a dashboard session

Responses

POST/v1/billing/checkout

Billing Checkout

Needs a key or a dashboard session

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstring | nullnoUnique per logical write (8-255 chars). Retries with the same key are safe. · pattern ^[A-Za-z0-9_\-:.]{8,255}$

Request body application/json CheckoutRequest

NameTypeRequiredDescription
plan_codestringyesmax length 32
interval"month" | "year"nodefault "month"
addonsAddonQuantity[]no

Responses

POST/v1/billing/change-plan

Upgrade or downgrade with proration

Needs a key or a dashboard session

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstring | nullnoUnique per logical write (8-255 chars). Retries with the same key are safe. · pattern ^[A-Za-z0-9_\-:.]{8,255}$

Request body application/json ChangePlanRequest

NameTypeRequiredDescription
plan_codestringyesmax length 32
interval"month" | "year"nodefault "month"
addonsAddonQuantity[]noExtra bundles to buy now with the change.

Responses

POST/v1/billing/addons/purchase

Buy add-on bundles now (one-time charge)

Needs a key or a dashboard session

Parameters

NameInTypeRequiredDescription
Idempotency-Keyheaderstring | nullnoUnique per logical write (8-255 chars). Retries with the same key are safe. · pattern ^[A-Za-z0-9_\-:.]{8,255}$

Request body application/json AddonPurchaseRequest

NameTypeRequiredDescription
codestringyesmax length 48
quantityintegernodefault 1 · min 1 · max 100

Responses

POST/v1/billing/cancel

Billing Cancel

Needs a key or a dashboard session

Request body application/json CancelRequest

NameTypeRequiredDescription
at_period_endbooleannodefault true
reasonstring | nullnomax length 500

Responses

GET/v1/billing/invoices

Billing Invoices

Needs a key or a dashboard session

Responses

GET/v1/billing/portal

Provider portal (card, invoices)

Needs a key or a dashboard session

Responses

POST/v1/billing/webhooks/{provider}

Payment provider webhooks (signature checked, no API key)

No key needed

Parameters

NameInTypeRequiredDescription
providerpath"paddle" | "stripe" | "mock"yes

Responses

  • 200Successful Responsemap<string, boolean>
GET/v1/usage

Usage this period vs the plan

Needs a key or a dashboard session

Responses

Data shapes on this page

PlanOut

NameTypeRequiredDescription
codestringyes
namestringyes
price_month_centsinteger | nullyes
price_year_centsinteger | nullyes
currencystringyes
products_limitinteger | nullyesnull = custom
searches_limitinteger | nullyesSearches per month (Enter). Suggest is never billed.
featuresobjectyes
overageobjectyes
trial_daysintegeryes

AddonOut

An add-on from the catalog (table `addons`). price_month_cents null = price not set yet.

NameTypeRequiredDescription
codestringyes
namestringyes
kind"assistant_conversations"yes
bundle_sizeintegeryes
price_centsinteger | nullyes
currencystringyes
plansstring[]yesPlans that may buy it.
expires"period_end" | "never"yes

SubscriptionOut

NameTypeRequiredDescription
plan_codestringyes
interval"month" | "year"yes
status"trialing" | "active" | "past_due" | "paused" | "canceled" | "incomplete"yes
provider"paddle" | "stripe" | "mock" | "manual"yes
trial_ends_atstring (date-time) | nullno
current_period_startstring (date-time) | nullno
current_period_endstring (date-time) | nullno
cancel_at_period_endbooleannodefault false
addonsmap<string, AddonBalance>noAdd-on code -> balance.

AddonBalance

What the store has of one add-on in the current period.

NameTypeRequiredDescription
unitsintegeryesBought this period (bundles x bundle size).
usedintegeryesCounted from usage (metric assistant_conversation).
remainingintegeryes
period_endstring (date-time) | nullno

CheckoutRequest

NameTypeRequiredDescription
plan_codestringyesmax length 32
interval"month" | "year"nodefault "month"
addonsAddonQuantity[]no

AddonQuantity

NameTypeRequiredDescription
codestringyesmax length 48
quantityintegeryesNumber of bundles.min 1 · max 100

RedirectUrl

NameTypeRequiredDescription
urlstringyes

ChangePlanRequest

NameTypeRequiredDescription
plan_codestringyesmax length 32
interval"month" | "year"nodefault "month"
addonsAddonQuantity[]noExtra bundles to buy now with the change.

AddonPurchaseRequest

Buy more bundles now (one-time charge). Needs a live subscription on a plan that allows it.

NameTypeRequiredDescription
codestringyesmax length 48
quantityintegernodefault 1 · min 1 · max 100

CancelRequest

NameTypeRequiredDescription
at_period_endbooleannodefault true
reasonstring | nullnomax length 500

InvoiceOut

NameTypeRequiredDescription
idstringyes
statusstringyes
currencystringyes
total_minorintegeryes
tax_minorintegeryes
hosted_urlstring | nullno
pdf_urlstring | nullno
issued_atstring (date-time)yes
paid_atstring (date-time) | nullno

UsageOut

NameTypeRequiredDescription
period_startstring (date)yes
period_endstring (date)yes
plan_codestringyes
metricsUsageMetric[]yes
overage_estimate_centsintegeryes
dailyUsageDay[]yes
notices"80_percent" | "100_percent"[]no

UsageMetric

NameTypeRequiredDescription
metric"search" | "assistant_message" | "assistant_conversation" | "translated_product" | "ai_cost_micros_usd" | "products_indexed"yes
usedintegeryes
limitinteger | nullyes
percentnumber | nullyes

UsageDay

NameTypeRequiredDescription
daystring (date)yes
searchesintegeryes
suggests_not_billedintegeryes
assistant_messagesintegeryes
assistant_conversationsintegeryes
translated_productsintegeryes