Billing
Create a checkout
Creates a Stripe Checkout page for a credit purchase and returns its URL. Requires billing_write.
amount_micros is 5to1,000 in whole cents. Paying saves the card for auto-recharge, and both success and cancel return to the console’s billing page. The credit is added once the payment is confirmed, not by this response. Returns 200, not 201.
POST
/
v1
/
billing
/
checkout
Create a checkout
curl --request POST \
--url https://api.opentype.dev/v1/billing/checkout \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount_micros": 1
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount_micros: 1})
};
fetch('https://api.opentype.dev/v1/billing/checkout', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.opentype.dev/v1/billing/checkout"
payload = { "amount_micros": 1 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"checkout_url": "<string>"
}Authorizations
bearerbearer
An API key (otsk_ + 64 hex) or a console session token.
Body
application/json
5,000,000 to 1,000,000,000 ($5 to $1,000), a multiple of 10,000 (whole cents).
Required range:
x >= 0Response
Where to send the user to pay.
Create a checkout
curl --request POST \
--url https://api.opentype.dev/v1/billing/checkout \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount_micros": 1
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount_micros: 1})
};
fetch('https://api.opentype.dev/v1/billing/checkout', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.opentype.dev/v1/billing/checkout"
payload = { "amount_micros": 1 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"checkout_url": "<string>"
}