Skip to content

Start a Stripe Checkout to buy credit

POST
/v1/billing/checkout
curl --request POST \
--url https://api.supposing.app/v1/billing/checkout \
--header 'Content-Type: application/json' \
--data '{ "amount_usd": 1, "success_url": "example", "cancel_url": "example" }'
Media typeapplication/json
CheckoutIn
object
amount_usd
required
Amount Usd

Whole US dollars, 5 to 1000.

integer
success_url
Success Url
Any of:
string
<= 2000 characters
cancel_url
Cancel Url
Any of:
string
<= 2000 characters

Example generated

{
"amount_usd": 1,
"success_url": "example",
"cancel_url": "example"
}

Successful Response

Media typeapplication/json
CheckoutSession
object
id
required
Id
string
url
required
Url

Send the customer here to pay. Credit arrives when Stripe confirms the payment.

string

Example generated

{
"id": "example",
"url": "example"
}

Client error. Branch on code; show message and hint.

Media typeapplication/json
Error

The body of every non-2xx response.

object
code
required
Code

Stable machine-readable code, e.g. dataset_not_found.

string
message
required
Message
string
hint
Hint

What to do next.

Any of:
string
details
Details

Per-field problems, for invalid_request.

Any of:
Array<object>
ErrorDetail
object
field
required
Field

Dotted path to the field, e.g. ranking.rubric.

string
message
required
Message
string

Example generated

{
"code": "example",
"message": "example",
"hint": "example",
"details": [
{
"field": "example",
"message": "example"
}
]
}

Server error.

Media typeapplication/json
Error

The body of every non-2xx response.

object
code
required
Code

Stable machine-readable code, e.g. dataset_not_found.

string
message
required
Message
string
hint
Hint

What to do next.

Any of:
string
details
Details

Per-field problems, for invalid_request.

Any of:
Array<object>
ErrorDetail
object
field
required
Field

Dotted path to the field, e.g. ranking.rubric.

string
message
required
Message
string

Example generated

{
"code": "example",
"message": "example",
"hint": "example",
"details": [
{
"field": "example",
"message": "example"
}
]
}