Purchase Credits
create-credits-checkout-sessionFull Description
Creates a Stripe checkout session to purchase Happenstance credits. Returns a checkout URL that the user can open in their browser to complete the purchase. Available packages: 100 credits ($25 - $0.25/credit), 1000 credits ($200 - $0.20/credit), 10000 credits ($1500 - $0.15/credit). After purchase, credits are automatically added to the user's account via webhook — no manual step needed. Use get-credits first to check the user's current balance before suggesting a purchase. You can also check to see if the user has auto-reload enabled. If the user is unsure how many credits to buy, recommend 100 credits to start. IMPORTANT: Always return the full checkout URL to the user exactly as provided — do not truncate or shorten it.
Documentation: https://developer.happenstance.ai
Parameters (1 required)
amountnumberNumber of credits to purchase (100, 1000, or 10000)