Skip to main content
GET
/
api
/
checkout
/
sessions
/
:id
curl https://api.swiftpay.cx/api/checkout/sessions/sess_abc123 \
  -H "Authorization: Bearer mp_live_your_api_key"
{
  "success": true,
  "data": {
    "id": "sess_abc123",
    "amountInCents": 2999,
    "currency": "USD",
    "status": "completed",
    "checkoutUrl": "https://checkout.swiftpay.cx/sess_abc123",
    "customerEmail": "customer@example.com",
    "metadata": {
      "orderId": "order_12345",
      "productName": "Premium Plan"
    },
    "successUrl": "https://yoursite.com/success",
    "cancelUrl": "https://yoursite.com/cancel",
    "expiresAt": "2024-01-15T11:30:00Z",
    "completedAt": "2024-01-15T10:35:00Z",
    "createdAt": "2024-01-15T10:30:00Z"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.swiftpay.cx/llms.txt

Use this file to discover all available pages before exploring further.

Get Checkout Session

Retrieves the details of an existing checkout session.

Request

Authorization
string
required
Bearer token with your API key
id
string
required
The unique identifier of the checkout session (e.g., sess_abc123)

Response

success
boolean
Whether the request was successful
data
object
curl https://api.swiftpay.cx/api/checkout/sessions/sess_abc123 \
  -H "Authorization: Bearer mp_live_your_api_key"
{
  "success": true,
  "data": {
    "id": "sess_abc123",
    "amountInCents": 2999,
    "currency": "USD",
    "status": "completed",
    "checkoutUrl": "https://checkout.swiftpay.cx/sess_abc123",
    "customerEmail": "customer@example.com",
    "metadata": {
      "orderId": "order_12345",
      "productName": "Premium Plan"
    },
    "successUrl": "https://yoursite.com/success",
    "cancelUrl": "https://yoursite.com/cancel",
    "expiresAt": "2024-01-15T11:30:00Z",
    "completedAt": "2024-01-15T10:35:00Z",
    "createdAt": "2024-01-15T10:30:00Z"
  }
}

Session Statuses

StatusDescription
pendingSession created, awaiting customer payment
processingPayment is being processed
completedPayment successful
expiredSession expired before payment
failedPayment failed
Sessions expire after 1 hour by default. Check expiresAt to see when a pending session will expire.