Start Stripe Checkout to buy credits (API key)
curl --request POST \
--url https://api.trysnapit.com/api/v1/credits/checkout \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"packageId": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({packageId: '<string>'})
};
fetch('https://api.trysnapit.com/api/v1/credits/checkout', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trysnapit.com/api/v1/credits/checkout"
payload = { "packageId": "<string>" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"url": "https://checkout.stripe.com/c/pay/cs_test_…",
"sessionId": "cs_test_a1b2c3"
}{
"statusCode": 401,
"message": "Invalid or missing API key",
"error": "Unauthorized"
}{
"statusCode": 401,
"message": "Invalid or missing API key",
"error": "Unauthorized"
}{
"statusCode": 401,
"message": "Invalid or missing API key",
"error": "Unauthorized"
}{
"statusCode": 401,
"message": "Invalid or missing API key",
"error": "Unauthorized"
}Programmatic API
Start Stripe Checkout to buy credits (API key)
Creates a Stripe Checkout session for the given package. Open url in a browser to pay, then call POST /api/v1/credits/checkout/confirm with sessionId (or wait for the Stripe webhook). Success/cancel redirect URLs are the same as Settings → Billing in the web app.
POST
/
api
/
v1
/
credits
/
checkout
Start Stripe Checkout to buy credits (API key)
curl --request POST \
--url https://api.trysnapit.com/api/v1/credits/checkout \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"packageId": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({packageId: '<string>'})
};
fetch('https://api.trysnapit.com/api/v1/credits/checkout', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trysnapit.com/api/v1/credits/checkout"
payload = { "packageId": "<string>" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"url": "https://checkout.stripe.com/c/pay/cs_test_…",
"sessionId": "cs_test_a1b2c3"
}{
"statusCode": 401,
"message": "Invalid or missing API key",
"error": "Unauthorized"
}{
"statusCode": 401,
"message": "Invalid or missing API key",
"error": "Unauthorized"
}{
"statusCode": 401,
"message": "Invalid or missing API key",
"error": "Unauthorized"
}{
"statusCode": 401,
"message": "Invalid or missing API key",
"error": "Unauthorized"
}Authorizations
Bearer sk_live_… (include the Bearer prefix)
Body
application/json
Credit package UUID to purchase

