Create a Stripe Checkout session
POST
/stripe/checkout
const url = 'https://example.com/api/stripe/checkout';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"plan":"example","priceId":"example","successUrl":"https://example.com","cancelUrl":"https://example.com"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/stripe/checkout \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "plan": "example", "priceId": "example", "successUrl": "https://example.com", "cancelUrl": "https://example.com" }'Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ” Media type application/json
object
plan
Plan name (e.g., pro, team)
string
priceId
Stripe price ID (alternative to plan)
string
successUrl
string format: uri
cancelUrl
string format: uri
Responses
Section titled “ Responses ”Checkout session URL
Media type application/json
object
url
required
string format: uri
Invalid request
Media type application/json
object
error
required
Human-readable error message
string
code
Stable machine-readable error code for client branching
string
fieldErrors
First validation message per field path
object
key
additional properties
string
issues
Structured validation issues (Zod)
Array<object>
object
path
required
string
message
required
string
retryAfter
Seconds until rate limit resets (429 responses)
number
Not authenticated
Media type application/json
object
error
required
Human-readable error message
string
code
Stable machine-readable error code for client branching
string
fieldErrors
First validation message per field path
object
key
additional properties
string
issues
Structured validation issues (Zod)
Array<object>
object
path
required
string
message
required
string
retryAfter
Seconds until rate limit resets (429 responses)
number
reconnect
True if re-linking GitHub may fix the issue
boolean