Get a checkout session
Retrieves a checkout session with current status, payment config, and optionally the full order with transactions. Status is synced from the underlying order on each retrieval.
GET
/checkout-sessions/{sessionId}
Retrieves a checkout session with current status, payment config, and optionally the full order with transactions. Status is synced from the underlying order on each retrieval.
Path Parameters
sessionId
string (uuid)
required
path
Checkout session UUID
Example:
"550e8400-e29b-41d4-a716-446655440000"Query Parameters
include
string
optional
query
Pass 'order' to embed the full order object with transactions in the response
Responses
200
Checkout session retrieved successfully
application/jsonsuccess
boolean
REQUIRED
message
string
REQUIRED
data
object
REQUIRED
Checkout session state with order link
id
string (uuid)
REQUIRED
status
string
REQUIRED
Checkout session status
Enum:
open, processing, complete, expiredsuccess_url
string | null
REQUIRED
Resolved success redirect URL (template variables replaced)
cancel_url
string | null
REQUIRED
Resolved cancel redirect URL (template variables replaced)
metadata
object
REQUIRED
order_id
string (uuid) | null
REQUIRED
Linked order ID (null before order creation)
client_reference_id
string | null
REQUIRED
Merchant-side reference ID
expires_at
string (date-time)
REQUIRED
created_at
string (date-time)
REQUIRED
order
object | null
Full order with transactions. Only included when ?include=order is passed.
order
unknown
REQUIRED
depositTxs
object[]
REQUIRED
Array of:
orderId
string (uuid)
REQUIRED
Associated order ID
chain
number
REQUIRED
Chain where transaction occurred
from
string | null
Sender address (can be null)
txHash
string
REQUIRED
Transaction hash
amount
string
REQUIRED
Transaction amount
createdAt
number
REQUIRED
Transaction timestamp
relayTxs
object[]
REQUIRED
Array of:
orderId
string (uuid)
REQUIRED
Associated order ID
chain
number
REQUIRED
Chain where relay occurred
txHash
string
REQUIRED
Relay transaction hash
status
string
REQUIRED
Relay transaction status
Enum:
pending, success, failure, refund, delayed, waitingcreatedAt
number
REQUIRED
Relay timestamp
executeTx
unknown | null
REQUIRED
refundTxs
object[]
REQUIRED
Array of:
orderId
string (uuid)
REQUIRED
Associated order ID
chain
number
REQUIRED
Chain where refund occurred
txHash
string
REQUIRED
Refund transaction hash
amount
string
REQUIRED
Refunded amount
status
string
REQUIRED
Refund status
Enum:
success, failurecreatedAt
number
REQUIRED
Refund timestamp
points
number | null
REQUIRED
statusCode
number
REQUIRED
400
Checkout session not found
curl -X GET 'https://mainnet.anyspend.com/checkout-sessions/550e8400-e29b-41d4-a716-446655440000'
const response = await fetch('https://mainnet.anyspend.com/checkout-sessions/550e8400-e29b-41d4-a716-446655440000', {
method: 'GET'
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://mainnet.anyspend.com/checkout-sessions/550e8400-e29b-41d4-a716-446655440000')
print(response.json())
200
Response
{
"success": true,
"message": "Checkout session retrieved",
"data": {
"id": "<uuid>",
"status": "open",
"success_url": "<string>",
"cancel_url": "<string>",
"metadata": "<object>",
"order_id": "<uuid>",
"client_reference_id": "<string>",
"expires_at": "2024-01-01T00:00:00Z",
"created_at": "2024-01-01T00:00:00Z",
"order": {
"order": {
"id": "5392f7a7-d472-4d6b-9848-bd07117fb82d",
"recipientAddress": "0xb34facb90a200251318e8841c05102366f2158cf",
"globalAddress": "0xa640beaa78eeb64bb269f2baf8202b9a7316e123",
"srcChain": 8453,
"dstChain": 8453,
"srcTokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"dstTokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"srcAmount": "93354000",
"status": "executed",
"errorDetails": "<string>",
"createdAt": 1752505794679,
"expiredAt": 1752506694679,
"filledAt": 123,
"receivedDepositAt": 123,
"creatorAddress": "0xb34facb90a200251318e8841c05102366f2158cf",
"partnerId": "<string>",
"clientReferenceId": "<string>",
"onrampMetadata": {
"country": {},
"vendor": {},
"paymentMethod": {},
"redirectUrl": {},
"stripeAmountInCents": {},
"ipAddress": {},
"fingerprint": {}
},
"oneClickBuyUrl": "<string>",
"stripePaymentIntentId": "pi_3Rko0sJnoDg53PsP0PDLsHkR",
"settlement": {
"actualDstAmount": {},
"relay": {}
},
"fee": {},
"type": "swap",
"payload": {
"expectedDstAmount": {}
},
"metadata": {
"srcToken": {},
"dstToken": {}
}
},
"depositTxs": [
{
"orderId": "5392f7a7-d472-4d6b-9848-bd07117fb82d",
"chain": 8453,
"from": "0xa7539e73700B1726aBA29526606442A491Ef5747",
"txHash": "0x60ece99a645201668d20db6775a6b3d30967433ff0750b356cdad46d3e13f9c8",
"amount": "93354000",
"createdAt": 1752505811105
}
],
"relayTxs": [
{
"orderId": "5392f7a7-d472-4d6b-9848-bd07117fb82d",
"chain": 8453,
"txHash": "0x9df917e14bb089f74763d1d2662761d75c97a5a068b8a9e411c3d384c9c40d19",
"status": "pending",
"createdAt": 1752505817654
}
],
"executeTx": {
"orderId": "5392f7a7-d472-4d6b-9848-bd07117fb82d",
"chain": 8453,
"txHash": "0x1234567890abcdef1234567890abcdef12345678",
"createdAt": 1752505820000
},
"refundTxs": [
{
"orderId": "5392f7a7-d472-4d6b-9848-bd07117fb82d",
"chain": 8453,
"txHash": "0xabcdef1234567890abcdef1234567890abcdef12",
"amount": "93354000",
"status": "success",
"createdAt": 1752505825000
}
],
"points": 123
}
},
"statusCode": 200
}
GET
/checkout-sessions/{sessionId}