Create a Stripe Checkout session for an active subscription plan.
const url = 'https://data.predictefy.com/v1/billing/subscribe';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"planId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://data.predictefy.com/v1/billing/subscribe \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "planId": "example" }'Key-authed and WEIGHT 0 (starting a subscription never debits credits). The returned URL is Stripe-hosted; monthly credit grants land later via the webhook’s invoice.paid handler, from the plan’s monthly_credit_grant. ONE open subscription per account — 409 SUBSCRIPTION_EXISTS while a non-terminal subscription or a recent (30 min) pending subscribe checkout exists. Only active rows with self_serve=true are purchasable; Enterprise is contract-only. 503 BILLING_UNAVAILABLE until the STRIPE_* env is configured.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
An ACTIVE, PRICED, self-serve plans id.
Examplegenerated
{ "planId": "example"}Responses
Section titled “Responses”The hosted Stripe Checkout URL.
object
object
Examplegenerated
{ "success": true, "data": { "url": "example" }}Enveloped error.
object
object
Always present on errors; quote this id when reporting a failed request.
Present only when a venue error is attributed to a specific exchange.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}Enveloped error.
object
object
Always present on errors; quote this id when reporting a failed request.
Present only when a venue error is attributed to a specific exchange.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}Enveloped error.
object
object
Always present on errors; quote this id when reporting a failed request.
Present only when a venue error is attributed to a specific exchange.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}Enveloped error.
object
object
Always present on errors; quote this id when reporting a failed request.
Present only when a venue error is attributed to a specific exchange.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}Enveloped error.
object
object
Always present on errors; quote this id when reporting a failed request.
Present only when a venue error is attributed to a specific exchange.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}Enveloped error.
object
object
Always present on errors; quote this id when reporting a failed request.
Present only when a venue error is attributed to a specific exchange.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}Enveloped error.
object
object
Always present on errors; quote this id when reporting a failed request.
Present only when a venue error is attributed to a specific exchange.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}Enveloped error.
object
object
Always present on errors; quote this id when reporting a failed request.
Present only when a venue error is attributed to a specific exchange.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}