Checkout sessions
From your server, call POST /checkout/sessions with di Authorization and Idempotency-Key headers.
Use one stable key for each order or card registration. Use di same key and body for HTTP and MCP.
You fit set locale (for example, "pt-BR" or "sr") for any session or MCP call. Buyer pages support en, zh, hi, es, ar, fr, bn, pt, id, ur, ru, de, ja, pcm, ar-EG, mr, vi, te, sw, ha, sr.
If you leave locale empty, di browser go choose di first language. Di buyer fit change am on di hosted or embedded page.
Di website, Dev Center, OpenAPI, quick start guides and tool descriptions support di same languages. Use ?lang=sr or Accept-Language: sr for Serbian.
Di authentication screens for Stripe, Teya and di bank wey issue di card dey use di languages wey each one support. Each verified API key get im own general limit of 500 requests every hour. HTTP and MCP dey count together for dat key. If you get HTTP 429, wait di time wey Retry-After show before you try again.
Send one of these request bodies. Replace {{person_id}} with active CRM person for your tenant.
Save di body wey you choose as checkout.json. From di merchant server:
curl --fail-with-body -X POST 'https://chronosfy.com/api/checkout/sessions' -H "Authorization: $AUTH" -H 'Content-Type: application/json' -H 'Idempotency-Key: order-42-v1' --data-binary @checkout.jsonSet AUTH to "ApiKey <key>" or "Bearer <token>". Keep am on di server. To check status, replace SESSION_ID:
curl --fail-with-body 'https://chronosfy.com/api/checkout/sessions/SESSION_ID' -H "Authorization: $AUTH"Pay once (amount for di smallest currency unit; payments:links)
{
"mode": "payment",
"amount": 2990,
"currency": "GBP",
"description": "Order 42",
"client_reference_id": "order-42",
"embed_origin": "https://shop.example",
"return_url": "https://shop.example/orders/42"
}Authorise charges wey go repeat (financial_recurrences:write and payments:setup)
{
"mode": "recurring",
"locale": "en",
"amount": 9900,
"currency": "GBP",
"description": "Monthly membership",
"person_id": "{{person_id}}",
"recurrence": {
"frequency": "monthly",
"timezone": "Europe/London",
"first_payment": {
"timing": "after_days",
"days": 7
}
},
"embed_origin": "https://shop.example",
"return_url": "https://shop.example/membership"
}Use {"timing":"immediate"} to collect money for di first cycle for checkout. You go also need payments:links permission.
Use {"timing":"after_days","days":7} for 1–400 calendar days from when di buyer agree, or {"timing":"at","at":"..."} for future ISO timestamp within 400 days.
E fit renew evri day, evri week or evri month. Renewal dey follow di local calendar. If di date no dey for one short month, e go use di last day of dat month.
Di buyer go see di price and di date for di first payment before e agree. Di schedule go start only after di server confirm say di process don finish.
After e finish, check recurrence_id with GET /recurrences/{id}. To cancel, use DELETE /recurrences/{id}.
initial_payment_paid show say dem confirm di first charge for checkout. If di first payment go happen later, di buyer fit finish registration now without paying anything.
An old link no go start any renewal wey di buyer no ask for. If di terms change, cancel di original and ask di buyer to agree again.
For Teya charges wey dey repeat, you need transactions/online/create and transactions/online/id/get. If Teya clearly decline di charge for temporary reason, we check di result again before we retry after 24h and then after 72h (maximum 3 attempts). If we no know di outcome and no reference dey, person must review am.
Save di card with di provider without buying anything (payments:setup)
{
"mode": "setup",
"storage": "provider",
"person_id": "{{person_id}}",
"currency": "GBP",
"embed_origin": "https://shop.example",
"return_url": "https://shop.example/cards"
}Save di card for di tenant vault without provider (vault:write)
{
"mode": "setup",
"storage": "tenant_vault",
"person_id": "{{person_id}}",
"embed_origin": "https://shop.example",
"return_url": "https://shop.example/cards"
}You fit choose Stripe or Teya ("stripe" or "teya"). If you no choose, we go use di main provider for di tenant.
Di Brazilian product for Stone integration never dey selected. We no dey switch provider automatically.
return_url must use HTTPS. To embed checkout, set embed_origin to di exact HTTPS origin of di store.
Treat checkout_url and im fragment as private link for di buyer. Di first access window na one hour.
Di buyer fit open di URL directly. If you choose embedded presentation, di store fit also mount di checkout like dis:
<div id="checkout"></div>
<script src="https://chronosfy.com/api/checkout/sdk.js"></script>
<script>
// session comes from your store backend, which holds the API key.
if (session.presentation === 'embedded') {
const mounted = ChronosfyCheckout.mount('#checkout', session.checkout_url, {
onComplete: () => window.location.assign(session.mode === 'recurring' ? '/membership' : session.mode === 'payment' ? '/orders/42' : '/cards')
});
// In a single-page app call mounted.destroy() when leaving this view.
} else if (session.checkout_url) {
window.location.assign(session.checkout_url);
}
</script>For embedded Stripe, set di store publishable key. For Teya, use OAuth credentials for dat store and di public key for im payment webhook. If di provider only returns hosted URL, checkout go redirect. Allow di Chronosfy origin in frame-src and script-src for your site, together with di SDK, frames and connections of your provider.
GET /settings/payment/webhook-url (owner) dey show webhook_urls.stripe and webhook_urls.teya even before you change di main provider.
Di tenant vault dey use separate Chronosfy frame. No put card data for merchant scripts, MCP, logs or webhook payloads.
Subscribe to checkout.session.completed, checkout.session.failed, checkout.session.expired and checkout.session.needs_review.
GET /checkout/sessions/{id} need payments:read. Fulfil di order only if di payment don complete. If setup complete, e mean say
dem don save di card for di person wey you choose. payment_method_id identifies di Stripe payment method, vault card or Teya registration inside Chronosfy. Di existing tools for off-session charges fit use Stripe or di vault routes wey you set up.
We dey keep di Teya reference encrypted. If browser return, redirect or run SDK callback, e only mean say di browser don move to another step.
Di reconciler and provider notifications finish their work separately from di browser. For Teya setup, deliver payment.succeeded.v1 to https://chronosfy.com/api/checkout/webhooks/teya/{tenant} to link di verified token.
For MCP, call create_checkout_session with di same body plus request_key. Call get_checkout_session with { "id": "..." }.
If conflict (409) happen, check di original body. After timeout, send di original request again with di same key.
Use GET for di final result. If you repeat di request after dat, checkout_url=null. For existing payment links, continue to use /payment/links.
## Refunds
Stripe and Teya fit return all di money or part of am. Enter di amount for di smallest unit of di currency. Use new key for each separate refund. If you send di same request again, use di same key. Na only succeeded confirm say di refund don go through. Di next renewals still dey on schedule.
Di provider don refund am
`already_refunded_externally`
Anoda request don refund am
`already_refunded_by_other_request`
curl -X POST "$API/checkout/sessions/$CHECKOUT_ID/refund" \
-H "Authorization: ApiKey $API_KEY" -H "Idempotency-Key: refund:order-42:1" \
-H "Content-Type: application/json" -d '{"amount":2500,"reason":"requested_by_customer"}'
curl "$API/payment/refunds/$REFUND_ID" -H "Authorization: ApiKey $API_KEY"payments:refund POST /checkout/sessions/{id}/refund
payments:refund POST /payment/links/{id}/refund
payments:refund POST /payment/charges/{charge_id}/refund
payments:read GET /payment/refunds/{id}
MCP request_refund, get_refund
Teya refunds/create## Di reply wey card processing give
gateway_response show di Chronosfy operation, status and code. provider_response keep di provider original fields wey merchant fit see, plus di card issuer codes if dem dey. E go be null if na local storage, if reply no come, or if old record no get saved reply. After di browser come back, use di checkout ID check di result for your server.
{
"provider_response": {
"provider": "teya",
"body": {
"status": "FAILURE",
"status_reason": "INSUFFICIENT_FUNDS",
"issuer_result": { "response_code": "51" }
}
},
"gateway_response": {
"operation": "charge",
"status": "failed",
"code": "CHARGE_FAILED",
"reason": "insufficient_funds"
}
}## Default payment provider
If you save login details, di default go stay as e be, even for di first provider. To choose di account for new payments, di tenant owner go pick one saved account and confirm di change. You fit name di provider for checkout before you choose default.
GET /api/settings/payment
Authorization: Bearer <owner_access_token>
POST /api/auth/reauth
Authorization: Bearer <owner_access_token>
Content-Type: application/json
{"password":"<password>","operation":"PUT /settings/payment/default"}
PUT /api/settings/payment/default
Authorization: Bearer <owner_access_token>
X-Reauth-Token: <reauth_token>
Content-Type: application/json
{"config_id":"<configurations[].config_id>"}MCP: set_default_payment_provider({config_id, reauth_token})