create_checkout
Get a hosted-checkout link outside beta. Disabled while beta pricing is free.
The REQUIRED idempotency_key creates or replays one durable order and Stripe is
called under an order-derived key, so a retry never mints a second order or
session. Args: pack (from pricing.credit_packs), idempotency_key,
success_url/cancel_url, api_key (spend). Returns {checkout_url, pack, credits,
usd_cents, expires_at, order_id, order_state, replayed}. Errors: unauthorized,
forbidden, invalid_request, idempotency_conflict, payments_disabled, rate_limited.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pack | Yes | Which credit pack to buy, given as its CREDITS amount and matched against pricing.credit_packs exactly (not a dollar figure and not an index). A value that is not an offered pack is invalid_request. | |
| api_key | No | API key for this call. Omit to fall back to the Authorization: Bearer / X-API-Key request header (streamable-HTTP only), then the VHGENGINE_API_KEY env var (the stdio default). No key resolvable -> unauthorized. | |
| cancel_url | No | Where Stripe sends the browser if your human abandons checkout. At most 2048 characters. Omit to use the deployment's default. | |
| success_url | No | Where Stripe sends the browser after a successful payment. At most 2048 characters. Omit to use the deployment's default landing page. | |
| idempotency_key | Yes | REQUIRED caller-chosen replay key for this checkout. The same key replays the same durable order and Stripe session (never a second charge intent); the same key with different arguments is an idempotency_conflict. Matches REST's required Idempotency-Key header. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pack | No | Which pack this session buys. | |
| credits | No | Credits that land on your balance after the webhook confirms payment. | |
| usd_cents | No | What your human is charged, in cents. | |
| expires_at | No | When the checkout link stops working, ISO-8601 UTC. | |
| checkout_url | No | The URL your human opens to pay. Single use. |