Stripe checkout

From shogo-labs/shogo-ai · View interactive version

Stripe checkout is an AI agent skill from the GitHub repository shogo-labs/shogo-ai. Switch on the store's real Stripe payments — the hosted-checkout route already ships; this wires the owner's key and verifies it

How to use this skill

Skill file

Switch on Stripe checkout

The checkout route already ships in this project at custom-routes.ts

(POST /api/checkout + a POST /api/webhooks/stripe). It uses **Stripe Hosted

Checkout** (a redirect), NOT Stripe Elements — do not swap in

@stripe/react-stripe-js; the "Elements context" / network errors come from

that path. You do NOT need to write the route. You only need to give it the

owner's key and verify it. If you must change server logic, edit

custom-routes.ts (never server.tsx, which is generated).

Step 1 — Put the owner's Stripe secret key in the environment

real charges. It's THEIR Stripe account — that's where the money lands.

env/secret store). Never put it in source or the client bundle.

to rotate it after setup; then never echo it again. If they already gave it

to you earlier, USE it — don't re-ask.

That's the only required step. With the key set, /api/checkout returns a real

Stripe URL and the storefront's Checkout button starts working.

Step 2 — Verify before telling the owner it works

A green build only proves it compiled. Hit the endpoint with a real product id

from src/data/store-content.ts:

curl -s -w "\nHTTP %{http_code}\n" -X POST \
  http://localhost:$RUNTIME_PORT/api/checkout \
  -H 'Content-Type: application/json' \
  -d '{"items":[{"id":"<a-real-product-id>","quantity":1}]}'

Expect {"ok":true,"url":"https://checkout.stripe.com/..."}.

mismatch.

Then add a product to the cart in the preview and click Checkout — you should

land on Stripe's page and, after a test payment, return to ?checkout=success.

Step 3 (recommended) — Mark orders paid via webhook

The webhook route also already ships (POST /api/webhooks/stripe). To activate:

https://<published-domain>/api/webhooks/stripe, event

checkout.session.completed.

Without the webhook, checkout still works and the cart clears on the success

redirect; orders just stay pending in the DB instead of flipping to paid.

Reading orders

order list on the public storefront.

Guardrails

prices from the browser. Keep it that way if you edit the route.

confirmed the flow end-to-end.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.