/checkout/sessionsImplementedCreate checkout session
Create a hosted checkout session for a customer payment. This is the main server-side checkout API.
Auth
Bearer API key
Scope
checkout_sessions:create
Handler
apps/web/app/api/v1/checkout/sessions/route.ts
- The current public API contract uses camelCase JSON fields.
- countryCode is required so provider availability can be routed correctly.
- The customer should be redirected to checkoutSession.checkoutUrl.
Request
bashcurl -X POST https://app.yeraconnect.io/api/v1/checkout/sessions \
-H "Authorization: Bearer yera_test_sk_your_secret_key" \
-H "Content-Type: application/json" \
-d '{
"amount": 250,
"currency": "EUR",
"destinationAsset": "USDC",
"network": "polygon",
"countryCode": "DE",
"customerEmail": "customer@example.com",
"orderId": "ORDER-1001",
"successUrl": "https://merchant.com/success",
"cancelUrl": "https://merchant.com/cancel"
}'Request body
json{
"amount": 250,
"currency": "EUR",
"destinationAsset": "USDC",
"network": "polygon",
"countryCode": "DE",
"customerEmail": "customer@example.com",
"orderId": "ORDER-1001",
"successUrl": "https://merchant.com/success",
"cancelUrl": "https://merchant.com/cancel",
"metadata": {
"cartId": "cart_1001"
}
}Response
json{
"ok": true,
"checkoutSession": {
"id": "yc_sess_123456",
"externalSessionId": "yc_sess_123456",
"checkoutUrl": "https://checkout.yeraconnect.io/pay/yc_sess_123456",
"status": "pending",
"amount": "250",
"currency": "EUR",
"destinationAsset": "USDC",
"network": "polygon",
"mode": "test",
"provider": "yera_checkout",
"railType": "fiat_to_crypto",
"createdAt": "2026-06-21T12:00:00.000Z",
"expiresAt": null
}
}