Skip to main content
GET
https://api.swiftpay.cx
/
api
/
refunds
# List all refunds
curl "https://api.swiftpay.cx/api/refunds?page=1&limit=20" \
  -H "Authorization: Bearer mp_live_your_api_key"

# Filter by session

curl "https://api.swiftpay.cx/api/refunds?transactionId=sess_abc123" \
 -H "Authorization: Bearer mp_live_your_api_key"

# Filter by status

curl "https://api.swiftpay.cx/api/refunds?status=completed" \
 -H "Authorization: Bearer mp_live_your_api_key"

{
  "success": true,
  "data": [
    {
      "id": "ref_xyz789",
      "checkoutSessionId": "sess_abc123",
      "amountInCents": 2999,
      "reason": "Customer requested refund",
      "status": "completed",
      "createdAt": "2024-01-15T10:30:00Z"
    },
    {
      "id": "ref_abc456",
      "checkoutSessionId": "sess_def789",
      "amountInCents": 4999,
      "reason": "Product not as described",
      "status": "pending",
      "createdAt": "2024-01-14T15:20:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 45,
    "totalPages": 3
  }
}

List Refunds

Returns a paginated list of refunds for your business.

Request

Authorization
string
required
Bearer token with your API key
transactionId
string
Filter by checkout session ID
status
string
Filter by status: pending, processing, completed, failed
page
integer
default:"1"
Page number for pagination
limit
integer
default:"20"
Number of results per page (1-100)

Response

success
boolean
Whether the request was successful
data
array
Array of refund objects
pagination
object
# List all refunds
curl "https://api.swiftpay.cx/api/refunds?page=1&limit=20" \
  -H "Authorization: Bearer mp_live_your_api_key"

# Filter by session

curl "https://api.swiftpay.cx/api/refunds?transactionId=sess_abc123" \
 -H "Authorization: Bearer mp_live_your_api_key"

# Filter by status

curl "https://api.swiftpay.cx/api/refunds?status=completed" \
 -H "Authorization: Bearer mp_live_your_api_key"

{
  "success": true,
  "data": [
    {
      "id": "ref_xyz789",
      "checkoutSessionId": "sess_abc123",
      "amountInCents": 2999,
      "reason": "Customer requested refund",
      "status": "completed",
      "createdAt": "2024-01-15T10:30:00Z"
    },
    {
      "id": "ref_abc456",
      "checkoutSessionId": "sess_def789",
      "amountInCents": 4999,
      "reason": "Product not as described",
      "status": "pending",
      "createdAt": "2024-01-14T15:20:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 45,
    "totalPages": 3
  }
}