Prepaid credit packs
Add non-giftable credits through one-time Stripe Checkout.
| Pack | Price | Effective rate |
|---|---|---|
| 1,000 credits | $10 | $0.010/credit |
| 5,000 credits | $45 | $0.009/credit |
| 25,000 credits | $200 | $0.008/credit |
The server maps pack ID 1000, 5000 or 25000 to an allowlisted Stripe Price ID and creates a one-time Checkout Session.
Fulfillment
Credits are granted once after Stripe confirms the Checkout Session. Repeated delivery or refresh cannot grant the same pack twice.
After the browser returns to Usage & Billing, the Console verifies the session and refetches the balance. The success toast appears only after the new purchased balance is confirmed.
Prepaid credits cannot be transferred through the gifting flow.
Start a purchase
/api/stripe/clawdbase-creditsThe client sends one allowlisted pack identifier. The server maps it to the configured Stripe Price ID and authoritative credit quantity. It does not accept an arbitrary amount, credit value or Price ID.
{
"pack": "5000"
}Purchase flow
Choose a pack
Display the pack credits, price and effective rate before leaving the Console. Disable only the selected Buy action while Checkout is created.
Complete Stripe Checkout
The session uses one-time payment mode and carries server-authored user and credit metadata.
Verify the return
Send the returned cs_... ID to /api/stripe/clawdbase-sync-session. The server verifies ownership and paid/completed state.
Grant once
The fulfillment function calls clawdbase_add_purchased_credits with a Stripe-derived idempotency reference, then returns the fresh balance.
Retry behavior
Refreshing the success URL or receiving repeated Stripe confirmation cannot grant a second pack. A processed session returns an idempotent success. If fulfillment fails after payment, contact support with the Checkout receipt and do not repurchase until it is reconciled.
Balance behavior
Purchased credits are used after Free, gifted and included balances, and before eligible overage. They remain separately visible so a user can distinguish subscription allowance from prepaid inventory.