Skip to content
Sellzy

Stripe payments

Take card payments with Stripe Checkout and signature-checked webhooks.

Cash on delivery works out of the box. Add Stripe to accept cards.

1. Get your keys

  1. Create an account at dashboard.stripe.com/register and stay in test mode.
  2. Copy the Secret key (sk_test_…) from dashboard.stripe.com/test/apikeys.
  3. In apps/api/.env:
STRIPE_SECRET_KEY=sk_test_...
STRIPE_CURRENCY=usd

2. Set up the webhook

Orders are marked paid only by Stripe’s webhook, never by the browser. That stops anyone faking a payment.

Locally, install the Stripe CLI, then in a second terminal:

stripe login
pnpm --filter @sellzy/api webhook

Copy the whsec_… it prints into STRIPE_WEBHOOK_SECRET and restart the API.

Live, open dashboard.stripe.com/webhooks → Add endpoint:

  • URL: https://YOUR-API-DOMAIN/api/payments/webhook
  • Events: checkout.session.completed and payment_intent.succeeded

Copy the endpoint’s signing secret into STRIPE_WEBHOOK_SECRET on your API server.

3. Test

Pay with card 4242 4242 4242 4242, any future date and any CVC. The order turns Paid within a few seconds.

Note

The webhook checks Stripe’s signature and that the amount paid matches the order total. Switch to live keys (sk_live_…) and a live webhook only when you go live.

Stuck? Run pnpm check:setup, check Troubleshooting, or contact support.