Skip to main content
GET
/
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"

// List all refunds
const response = await fetch(
  'https://api.swiftpay.cx/api/refunds?page=1&limit=20',
  {
    headers: {
      'Authorization': 'Bearer mp_live_your_api_key'
    }
  }
);

const refunds = await response.json();

// Filter by specific session
const sessionRefunds = await fetch(
  'https://api.swiftpay.cx/api/refunds?transactionId=sess_abc123',
  {
    headers: {
      'Authorization': 'Bearer mp_live_your_api_key'
    }
  }
).then(r => r.json());
import requests

# List all refunds
response = requests.get(
    'https://api.swiftpay.cx/api/refunds',
    headers={'Authorization': 'Bearer mp_live_your_api_key'},
    params={'page': 1, 'limit': 20}
)

refunds = response.json()

# Filter by status
completed_refunds = requests.get(
    'https://api.swiftpay.cx/api/refunds',
    headers={'Authorization': 'Bearer mp_live_your_api_key'},
    params={'status': 'completed'}
).json()
{
  "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"

// List all refunds
const response = await fetch(
  'https://api.swiftpay.cx/api/refunds?page=1&limit=20',
  {
    headers: {
      'Authorization': 'Bearer mp_live_your_api_key'
    }
  }
);

const refunds = await response.json();

// Filter by specific session
const sessionRefunds = await fetch(
  'https://api.swiftpay.cx/api/refunds?transactionId=sess_abc123',
  {
    headers: {
      'Authorization': 'Bearer mp_live_your_api_key'
    }
  }
).then(r => r.json());
import requests

# List all refunds
response = requests.get(
    'https://api.swiftpay.cx/api/refunds',
    headers={'Authorization': 'Bearer mp_live_your_api_key'},
    params={'page': 1, 'limit': 20}
)

refunds = response.json()

# Filter by status
completed_refunds = requests.get(
    'https://api.swiftpay.cx/api/refunds',
    headers={'Authorization': 'Bearer mp_live_your_api_key'},
    params={'status': 'completed'}
).json()
{
  "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
  }
}