curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/billing/credits/checkout' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"amount_dollars": 1.5,
"cancel_url": "string",
"success_url": "string"
}'
{
"amount_cents": 4900,
"checkout_url": "string",
"estimated_outcomes": 1
}
Create a credit checkout handler
Required scope: billing:write
POST
/
api
/
v1
/
billing
/
credits
/
checkout
curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/billing/credits/checkout' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"amount_dollars": 1.5,
"cancel_url": "string",
"success_url": "string"
}'
{
"amount_cents": 4900,
"checkout_url": "string",
"estimated_outcomes": 1
}
Required scope:
billing:write
Request body
CreateCreditCheckoutRequest
number (double)
required
Dollar amount of prepaid credits to purchase.
string
required
URL to redirect to if the customer cancels.
string
required
URL to redirect to after successful checkout.
Response
CreateCreditCheckoutResponse
integer (int64)
required
Purchased amount in cents.
string
required
Full Stripe Checkout URL to redirect the customer to
integer (int64)
required
Approximate number of outcomes this credit amount can cover.
Status codes
| Code | Meaning |
|---|---|
200 | Credit checkout session created |
401 | Unauthorized — missing or invalid credentials |
403 | Forbidden — the key/token lacks the required scope |
429 | Rate limited — see Retry-After / X-RateLimit-Reset |
503 | Billing not configured |
curl --request POST \
--url 'https://api.nsr.stateset.com/api/v1/billing/credits/checkout' \
--header "X-API-Key: $STATESET_NSR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"amount_dollars": 1.5,
"cancel_url": "string",
"success_url": "string"
}'
{
"amount_cents": 4900,
"checkout_url": "string",
"estimated_outcomes": 1
}
Last modified on August 31, 2026