Public
Initiate a Stripe Checkout Session
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

Stripe Checkout API

A lightweight Stripe Checkout Session endpoint built on Val Town with Hono + Deno.

Base URL: https://stripe.val.run

Endpoints

GET /

Renders this README as HTML.

POST /checkout

Creates a Stripe Checkout Session in Elements UI mode and returns the clientSecret needed to mount Stripe Elements on your frontend.

Response:

{ "clientSecret": "cs_test_..." }

Setup

Environment Variables

VariableRequiredDescription
STRIPE_SECRET_KEYYour Stripe secret API key (sk_test_... or sk_live_...)
STRIPE_PRICE_IDOptionalA Stripe Price ID (price_...). Defaults to {{PRICE_ID}} placeholder.