Start the Subscription ($100 a month): a Stripe Checkout link; the plan changes when Stripe confirms the payment
const url = 'https://api.supposing.app/v1/billing/subscribe';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"success_url":"example","cancel_url":"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://api.supposing.app/v1/billing/subscribe \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "success_url": "example", "cancel_url": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Any unique string, e.g. a UUID. Retrying with the same key returns the first response instead of creating a second one. Keys last 24 hours.
Any unique string, e.g. a UUID. Retrying with the same key returns the first response instead of creating a second one. Keys last 24 hours.
Request Body
Section titled “Request Body”Example generated
{ "success_url": "example", "cancel_url": "example"}Responses
Section titled “Responses”Successful Response
object
Stripe Checkout for the Subscription. The plan changes when Stripe confirms the payment (webhook), not when the browser comes back.
Example generated
{ "url": "example"}Client error. Branch on code; show message and hint.
The body of every non-2xx response.
object
Stable machine-readable code, e.g. dataset_not_found.
Per-field problems, for invalid_request.
object
Dotted path to the field, e.g. ranking.rubric.
For plan_limit_* codes: the limit, usage and upgrade.
Which plan limit a plan_limit_* error hit, and the way up.
object
Datasets, items_per_dataset, chars_per_dataset or runs_per_month.
The workspace’s plan: free (Pay as you go) or subscription.
Current usage; for items_per_dataset and chars_per_dataset, the size the dataset would have.
Example generated
{ "code": "example", "message": "example", "hint": "example", "details": [ { "field": "example", "message": "example" } ], "limit": { "name": "example", "plan": "example", "limit": 1, "used": 1, "upgrade_url": "example" }}Server error.
The body of every non-2xx response.
object
Stable machine-readable code, e.g. dataset_not_found.
Per-field problems, for invalid_request.
object
Dotted path to the field, e.g. ranking.rubric.
For plan_limit_* codes: the limit, usage and upgrade.
Which plan limit a plan_limit_* error hit, and the way up.
object
Datasets, items_per_dataset, chars_per_dataset or runs_per_month.
The workspace’s plan: free (Pay as you go) or subscription.
Current usage; for items_per_dataset and chars_per_dataset, the size the dataset would have.
Example generated
{ "code": "example", "message": "example", "hint": "example", "details": [ { "field": "example", "message": "example" } ], "limit": { "name": "example", "plan": "example", "limit": 1, "used": 1, "upgrade_url": "example" }}