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/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"
quantityintegernoPlans sold by size (Enterprise): blocks of `sizing.block_products` products, 1 to 40. 1 for every other plan.default 1 · min 1 · max 40

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"
quantityintegernoPlans sold by size (Enterprise): blocks of `sizing.block_products` products, 1 to 40. 1 for every other plan.default 1 · min 1 · max 40

Responses

POST/v1/billing/change-plan/preview

What a plan change charges today (nothing changes)

Needs a key or a dashboard session

Request body application/json ChangePlanRequest

NameTypeRequiredDescription
plan_codestringyesmax length 32
interval"month" | "year"nodefault "month"
quantityintegernoPlans sold by size (Enterprise): blocks of `sizing.block_products` products, 1 to 40. 1 for every other plan.default 1 · min 1 · max 40

Responses

POST/v1/billing/cancel

Billing Cancel

Needs a key or a dashboard session

Request body application/json CancelRequest

NameTypeRequiredDescription
at_period_endbooleannoMust be true: a store's plan runs to the end of the paid period (no refunds). false is refused with 403 cancel_now_not_allowed; only the super-admin console can end a plan now.default true
reasonstring | nullnomax length 500

Responses

POST/v1/billing/resume

Keep my plan: undo a cancel at period end before the period ends

Needs a key or a dashboard session

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
sizingPlanSizing | nullnoSet when the plan is bought by catalog size.

PlanSizing

A plan bought by catalog size: price per month = graduated tiers on the number of blocks.

NameTypeRequiredDescription
block_productsintegeryesProducts in one block (the plan's products_limit).
max_blocksintegeryesMost blocks sold online. Above that: talk to sales.
searches_per_extra_blockintegeryesSearches per month added by each block after the first.
tiersPriceTier[]yes

PriceTier

NameTypeRequiredDescription
up_tointeger | nullyesLast block of this tier. null = every block after the tiers before.
month_centsintegeryesPrice per block per month in this tier. Yearly = 10 x.

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
quantityintegernoBlocks of a plan sold by size (Enterprise); 1 for other plans.default 1

CheckoutRequest

NameTypeRequiredDescription
plan_codestringyesmax length 32
interval"month" | "year"nodefault "month"
quantityintegernoPlans sold by size (Enterprise): blocks of `sizing.block_products` products, 1 to 40. 1 for every other plan.default 1 · min 1 · max 40

RedirectUrl

NameTypeRequiredDescription
urlstringyes

ChangePlanRequest

NameTypeRequiredDescription
plan_codestringyesmax length 32
interval"month" | "year"nodefault "month"
quantityintegernoPlans sold by size (Enterprise): blocks of `sizing.block_products` products, 1 to 40. 1 for every other plan.default 1 · min 1 · max 40

ChangePlanPreview

What POST /v1/billing/change-plan with the same body would charge today. Nothing changes.

NameTypeRequiredDescription
plan_codestringyes
interval"month" | "year"yes
quantityintegernodefault 1
proration"prorate_now" | "prorate_next_invoice"yesprorate_now: an upgrade, the difference is charged now. prorate_next_invoice: a downgrade, the credit goes on the next invoice.
knownbooleanyesFalse: the amount is not known (see `reason`); confirm without an amount.
amount_minorinteger | nullnoCharged today in minor units (cents): the provider's amount for the plan change (tax included) plus add-on bundles at their list price. 0 = nothing is charged today.
tax_minorinteger | nullno
currencystring | nullno
reason"provider_has_no_preview" | "provider_error" | "addon_price_unknown" | nullnoWhy the amount is not known. None when `known` is true.

CancelRequest

NameTypeRequiredDescription
at_period_endbooleannoMust be true: a store's plan runs to the end of the paid period (no refunds). false is refused with 403 cancel_now_not_allowed; only the super-admin console can end a plan now.default 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_codestring | nullyesnull = the store has no plan yet (see TenantOut.billing_state).
metricsUsageMetric[]yes
overage_estimate_centsintegeryes
dailyUsageDay[]yes
notices"80_percent" | "100_percent"[]no

UsageMetric

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

UsageDay

NameTypeRequiredDescription
daystring (date)yes
searchesintegeryes
suggests_not_billedintegeryes
translated_productsintegeryes