Skip to main content
POST /v1/organizations/{organizationId}/billing/projects/{projectId}/purchase Purchases or changes the selected project’s plan for the supplied category and planCode. A 202 response means the change is pending: poll the returned operation URL and honor Retry-After until it succeeds or fails. A 200 response means the idempotency key resolved to an operation that is already terminal; inspect that result rather than assuming success from the status code alone. Supply the required Idempotency-Key header. Supply both organizationId and projectId to select the project within its organization.
TypeScript

Parameters

string
required
Identifies one logical mutation across retries.
string
required
string
required
The project being billed.

Body

string
required
Category slug, e.g. analytics or messaging.
string
required
Plan to subscribe to, e.g. analytics_pro.

Returns

200 The idempotency key resolved to an operation that is already terminal. TerminalBillingOperation One of: SucceededBillingOperation
null
required
BillingOperationKind
required
string
required
Stable handle for this provisioning action.
string | null
required
BillingOperationResult
required
"succeeded"
required
Terminal. The result is authoritative.
string | null
required
One of: FailedBillingOperation
BillingOperationFailure
required
BillingOperationKind
required
string
required
Stable handle for this provisioning action.
string | null
required
null
required
"failed"
required
Terminal. Failure contains a stable code and retryability.
string | null
required
202 Plan change accepted. Poll the returned operation until it succeeds or fails. PendingBillingOperation Headers: Location. The raw response carries these headers; see Raw responses.
null
required
BillingOperationKind
required
string
required
Stable handle for this provisioning action.
null
required
null
required
"pending"
required
Accepted and still executing. Poll the operation route.
string | null
required