The SwitchFlow integration API is intentionally small: one server-side call per checkout (create a payment session), one read endpoint (session status with the attempt trail), and a signed webhook stream back to you. Everything else — gateway connections, routing rules, keys, analytics — is managed in the dashboard.

Base URL

https://api.switchflows.net/api/v1
All requests and responses are JSON (Content-Type: application/json) over HTTPS.

Environments

There are no separate sandbox hosts. The environment is determined by the key you authenticate with:
EnvironmentSecret key prefixBehavior
Testsf_test_sk_Routes against sandbox gateways; test cards control outcomes
Livesf_live_sk_Real captures on your live gateway accounts
Test and live are fully isolated: keys, webhook endpoints, and data never cross environments.

Idempotency

POST /payment-sessions accepts an optional Idempotency-Key header (any unique string; a UUID is conventional). Retrying a request with the same key returns the original session instead of creating a duplicate. Strongly recommended — network timeouts on payment calls are exactly when you need safe retries.
-H "Idempotency-Key: 4f9c2f6a-6d1e-4b3a-9e64-1f2ab33c9d10"

Money

Amounts are integer minor units (amountMinor): 4900 means USD 49.00, INR 49.00, etc. Currency is an ISO 4217 alpha-3 code ("USD").

Health

GET https://api.switchflows.net/api/v1/meta is an unauthenticated liveness probe returning the service name and server time — useful for your monitoring.