# List all sessions
curl "https://api.swiftpay.cx/api/checkout/sessions?limit=20" \
-H "Authorization: Bearer mp_live_your_api_key"
# Filter by status
curl "https://api.swiftpay.cx/api/checkout/sessions?status=completed&limit=50" \
-H "Authorization: Bearer mp_live_your_api_key"
# With date range
curl "https://api.swiftpay.cx/api/checkout/sessions?startDate=2024-01-01&endDate=2024-01-31" \
-H "Authorization: Bearer mp_live_your_api_key"
// Basic list
const response = await fetch(
'https://api.swiftpay.cx/api/checkout/sessions?limit=20',
{
headers: {
'Authorization': 'Bearer mp_live_your_api_key'
}
}
);
const sessions = await response.json();
// Paginate through all results
let cursor = null;
const allSessions = [];
do {
const url = new URL('https://api.swiftpay.cx/api/checkout/sessions');
url.searchParams.set('limit', '100');
if (cursor) url.searchParams.set('cursor', cursor);
const res = await fetch(url, {
headers: { 'Authorization': 'Bearer mp_live_your_api_key' }
});
const data = await res.json();
allSessions.push(...data.data);
cursor = data.pagination.nextCursor;
} while (cursor);
import requests
# Basic list
response = requests.get(
'https://api.swiftpay.cx/api/checkout/sessions',
headers={'Authorization': 'Bearer mp_live_your_api_key'},
params={'status': 'completed', 'limit': 50}
)
sessions = response.json()
# Paginate through results
all_sessions = []
cursor = None
while True:
params = {'limit': 100}
if cursor:
params['cursor'] = cursor
response = requests.get(
'https://api.swiftpay.cx/api/checkout/sessions',
headers={'Authorization': 'Bearer mp_live_your_api_key'},
params=params
)
data = response.json()
all_sessions.extend(data['data'])
if not data['pagination'].get('nextCursor'):
break
cursor = data['pagination']['nextCursor']
{
"success": true,
"data": [
{
"id": "sess_abc123",
"amountInCents": 2999,
"currency": "USD",
"status": "completed",
"customerEmail": "customer@example.com",
"metadata": {
"orderId": "order_12345"
},
"createdAt": "2024-01-15T10:30:00Z"
},
{
"id": "sess_def456",
"amountInCents": 4999,
"currency": "USD",
"status": "pending",
"customerEmail": "another@example.com",
"metadata": {},
"createdAt": "2024-01-15T09:15:00Z"
}
],
"pagination": {
"hasMore": true,
"nextCursor": "cursor_xyz789",
"total": 150
}
}
Checkout Sessions
List Checkout Sessions
List all checkout sessions with filtering and pagination
GET
/
api
/
checkout
/
sessions
# List all sessions
curl "https://api.swiftpay.cx/api/checkout/sessions?limit=20" \
-H "Authorization: Bearer mp_live_your_api_key"
# Filter by status
curl "https://api.swiftpay.cx/api/checkout/sessions?status=completed&limit=50" \
-H "Authorization: Bearer mp_live_your_api_key"
# With date range
curl "https://api.swiftpay.cx/api/checkout/sessions?startDate=2024-01-01&endDate=2024-01-31" \
-H "Authorization: Bearer mp_live_your_api_key"
// Basic list
const response = await fetch(
'https://api.swiftpay.cx/api/checkout/sessions?limit=20',
{
headers: {
'Authorization': 'Bearer mp_live_your_api_key'
}
}
);
const sessions = await response.json();
// Paginate through all results
let cursor = null;
const allSessions = [];
do {
const url = new URL('https://api.swiftpay.cx/api/checkout/sessions');
url.searchParams.set('limit', '100');
if (cursor) url.searchParams.set('cursor', cursor);
const res = await fetch(url, {
headers: { 'Authorization': 'Bearer mp_live_your_api_key' }
});
const data = await res.json();
allSessions.push(...data.data);
cursor = data.pagination.nextCursor;
} while (cursor);
import requests
# Basic list
response = requests.get(
'https://api.swiftpay.cx/api/checkout/sessions',
headers={'Authorization': 'Bearer mp_live_your_api_key'},
params={'status': 'completed', 'limit': 50}
)
sessions = response.json()
# Paginate through results
all_sessions = []
cursor = None
while True:
params = {'limit': 100}
if cursor:
params['cursor'] = cursor
response = requests.get(
'https://api.swiftpay.cx/api/checkout/sessions',
headers={'Authorization': 'Bearer mp_live_your_api_key'},
params=params
)
data = response.json()
all_sessions.extend(data['data'])
if not data['pagination'].get('nextCursor'):
break
cursor = data['pagination']['nextCursor']
{
"success": true,
"data": [
{
"id": "sess_abc123",
"amountInCents": 2999,
"currency": "USD",
"status": "completed",
"customerEmail": "customer@example.com",
"metadata": {
"orderId": "order_12345"
},
"createdAt": "2024-01-15T10:30:00Z"
},
{
"id": "sess_def456",
"amountInCents": 4999,
"currency": "USD",
"status": "pending",
"customerEmail": "another@example.com",
"metadata": {},
"createdAt": "2024-01-15T09:15:00Z"
}
],
"pagination": {
"hasMore": true,
"nextCursor": "cursor_xyz789",
"total": 150
}
}
List Checkout Sessions
Returns a paginated list of checkout sessions for your business.Request
Bearer token with your API key
Filter by status:
pending, processing, completed, failed,
cancelled, refunded, or all.Number of results per page (1-100).
Page number for pagination.
Search by customer email or description.
Filter sessions created after this ISO 8601 date.
Filter sessions created before this ISO 8601 date.
Response
Whether the request was successful
Show properties
Show properties
# List all sessions
curl "https://api.swiftpay.cx/api/checkout/sessions?limit=20" \
-H "Authorization: Bearer mp_live_your_api_key"
# Filter by status
curl "https://api.swiftpay.cx/api/checkout/sessions?status=completed&limit=50" \
-H "Authorization: Bearer mp_live_your_api_key"
# With date range
curl "https://api.swiftpay.cx/api/checkout/sessions?startDate=2024-01-01&endDate=2024-01-31" \
-H "Authorization: Bearer mp_live_your_api_key"
// Basic list
const response = await fetch(
'https://api.swiftpay.cx/api/checkout/sessions?limit=20',
{
headers: {
'Authorization': 'Bearer mp_live_your_api_key'
}
}
);
const sessions = await response.json();
// Paginate through all results
let cursor = null;
const allSessions = [];
do {
const url = new URL('https://api.swiftpay.cx/api/checkout/sessions');
url.searchParams.set('limit', '100');
if (cursor) url.searchParams.set('cursor', cursor);
const res = await fetch(url, {
headers: { 'Authorization': 'Bearer mp_live_your_api_key' }
});
const data = await res.json();
allSessions.push(...data.data);
cursor = data.pagination.nextCursor;
} while (cursor);
import requests
# Basic list
response = requests.get(
'https://api.swiftpay.cx/api/checkout/sessions',
headers={'Authorization': 'Bearer mp_live_your_api_key'},
params={'status': 'completed', 'limit': 50}
)
sessions = response.json()
# Paginate through results
all_sessions = []
cursor = None
while True:
params = {'limit': 100}
if cursor:
params['cursor'] = cursor
response = requests.get(
'https://api.swiftpay.cx/api/checkout/sessions',
headers={'Authorization': 'Bearer mp_live_your_api_key'},
params=params
)
data = response.json()
all_sessions.extend(data['data'])
if not data['pagination'].get('nextCursor'):
break
cursor = data['pagination']['nextCursor']
{
"success": true,
"data": [
{
"id": "sess_abc123",
"amountInCents": 2999,
"currency": "USD",
"status": "completed",
"customerEmail": "customer@example.com",
"metadata": {
"orderId": "order_12345"
},
"createdAt": "2024-01-15T10:30:00Z"
},
{
"id": "sess_def456",
"amountInCents": 4999,
"currency": "USD",
"status": "pending",
"customerEmail": "another@example.com",
"metadata": {},
"createdAt": "2024-01-15T09:15:00Z"
}
],
"pagination": {
"hasMore": true,
"nextCursor": "cursor_xyz789",
"total": 150
}
}
⌘I