CreditsPurchase credits

Purchase credits

Create a Stripe Checkout session for a one-time credit top-up. Top-ups persist beyond the monthly reset.

curl -X POST https://api.chuger.com/v1/credits/purchase \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"credits": 1000}'
{
  "checkout_url": "https://checkout.stripe.com/c/pay/cs_test_...",
  "session_id": "cs_test_..."
}

Creates a Stripe Checkout session for a one-time credit top-up. The response includes a checkout_url that your user must visit to complete payment. Once paid, the purchased credits are added to your balance and persist beyond the monthly reset — they don't expire at month end.

POST https://api.chuger.com/v1/credits/purchase

All /v1/credits/* endpoints are free to call and not subject to per-minute rate limits. The credits aren't deducted from your balance until payment completes.

Authentication

Bearer token in the Authorization header. See Authentication.

Request body

Content-Type: application/json

body
creditsinteger
Required

Number of credits to purchase. Integer between 100 and 10,000 per call.

Example

Redirect your user to checkout_url. After the payment completes the purchased credits are added to the account balance — they sit on top of your monthly allowance and persist across monthly resets.

Response fields

checkout_urlstring
Required

Stripe-hosted checkout page. Redirect your user here.

session_idstring
Required

Stripe Checkout session identifier. Useful for reconciliation in your own systems.

Errors

StatusWhen
401Missing or invalid token
422credits missing, not an integer, or outside the 100–10,000 range

See Errors for the full reference.