GET
/
api
/
v1
/
payment-sessions
/
{sessionId}
Retrieve a payment session
curl --request GET \
  --url https://api.switchflows.net/api/v1/payment-sessions/{sessionId}
{
  "status": "<string>",
  "capturedVia": {},
  "failoverUsed": true,
  "attempts": [
    {}
  ]
}
Returns the session’s current status and its per-gateway attempt trail. Use this to reconcile a checkout whose webhook you missed, or to poll after a customer’s browser disconnected mid-payment.
For fulfillment, prefer webhooks — they push the same data the moment the outcome is known. This endpoint is the pull-based complement, not a substitute for verifying webhook signatures.

Request

curl https://api.switchflows.net/api/v1/payment-sessions/ps_1a2b3c4d \
  -H "Authorization: Bearer $SWITCHFLOW_SECRET_KEY"
sessionId
string
required
The session identifier from the create response.

Response

{
  "sessionId": "ps_1a2b3c4d",
  "status": "SUCCEEDED",
  "amountMinor": 4900,
  "currency": "USD",
  "orderRef": "ORDER-10023",
  "capturedVia": "ADYEN",
  "failoverUsed": true,
  "createdAt": "2026-07-06T10:42:31Z",
  "attempts": [
    {
      "attemptNumber": 1,
      "gateway": "STRIPE",
      "outcome": "DECLINED",
      "declineCode": "do_not_honor",
      "declineClass": "HARD",
      "latencyMs": 812
    },
    {
      "attemptNumber": 2,
      "gateway": "ADYEN",
      "outcome": "APPROVED",
      "declineCode": null,
      "declineClass": null,
      "latencyMs": 1104
    }
  ]
}
status
string
CREATED | SUCCEEDED | DECLINED | DEGRADED | EXPIRED.
capturedVia
string | null
Which of your gateways captured (STRIPE / ADYEN); null unless SUCCEEDED.
failoverUsed
boolean
true when the capture happened on a gateway other than the first one attempted.
attempts
array
One entry per gateway attempt, in order. outcome is APPROVED, DECLINED, TIMEOUT, or GATEWAY_ERROR; declineClass is HARD, SOFT, or FRAUD for declines. Latency is per-attempt, in milliseconds.