sk_test_ key in the dashboard’s Stripe page. Configure Checkout success and cancel URLs for your application before starting payments.
For a paid monthly plan, create the customer with POST /v1/customers, then call POST /v1/billing/attach with customerId and planId. For a credit pack, send customerId and addOnId instead. Redirect the customer to the returned checkoutUrl.
For a plan, Checkout completion alone does not grant credits. Ledger creates the monthly allocation after it processes the paid Stripe invoice webhook. Credit-pack Checkout uses a one-time payment; Ledger creates that allocation after it receives a paid checkout.session.completed event.
To upgrade an active monthly plan, call POST /v1/billing/upgrade with a more expensive plan and a client-generated Idempotency-Key. If Ledger returns a paymentUrl, send the customer to Stripe’s hosted invoice page. The new plan’s credits apply after payment and Stripe confirmation.
See Integrate Ledger for request bodies and Credits and usage for enforcement behavior.