Uprails

List Payments

Retrieve a list of payments with optional filtering.

GEThttps://api.uprails.com/payments/list

Returns a list of payments. The payments are returned sorted by creation date, with the most recently created payments appearing first. You can filter by various parameters to narrow down the results.

Request Example

List Payments
# List all payments
curl "https://api.uprails.com/payments/list" \
  -H "api-key: snd_YOUR_API_KEY"

# List with filters
curl "https://api.uprails.com/payments/list?status=succeeded&limit=20&created_gte=2024-01-01" \
  -H "api-key: snd_YOUR_API_KEY"

# List payments for a specific customer
curl "https://api.uprails.com/payments/list?customer_id=cus_xyz789" \
  -H "api-key: snd_YOUR_API_KEY"

Query Parameters

limitintegerdefault: 10

Number of payments to return (1-100)

offsetintegerdefault: 0

Number of payments to skip

statusstring

Filter by payment status

Enum:succeededfailedprocessingrequires_capturecancelled
customer_idstring

Filter by customer ID

created_gtestring

Filter payments created on or after this date (ISO 8601)

created_ltestring

Filter payments created on or before this date (ISO 8601)

currencystring

Filter by currency code

Response

200OK
{
  "data": [
    {
      "payment_id": "pay_1234567890abcdef",
      "merchant_id": "mer_abcdef123456",
      "status": "succeeded",
      "amount": 5000,
      "amount_received": 5000,
      "currency": "USD",
      "payment_method": "card",
      "customer_id": "cus_xyz789",
      "created": "2024-01-15T10:30:00Z"
    },
    {
      "payment_id": "pay_0987654321fedcba",
      "merchant_id": "mer_abcdef123456",
      "status": "succeeded",
      "amount": 2500,
      "amount_received": 2500,
      "currency": "USD",
      "payment_method": "card",
      "customer_id": "cus_abc123",
      "created": "2024-01-14T15:00:00Z"
    }
  ],
  "total_count": 150,
  "has_more": true
}

Pagination

Use limit and offset to paginate through results. The response includes total_count and has_more to help with pagination logic.

Pagination Examplejavascript
// Example pagination logic
let offset = 0;
const limit = 20;

do {
  const response = await fetch(
    `https://api.uprails.com/payments/list?limit=${limit}&offset=${offset}`,
    { headers: { 'api-key': 'snd_YOUR_API_KEY' } }
  );
  const data = await response.json();

  // Process payments
  data.data.forEach(payment => {
    console.log(payment.payment_id, payment.status);
  });

  offset += limit;
} while (data.has_more);

Filtering Examples

By Date Range

/payments/list?created_gte=2024-01-01T00:00:00Z&created_lte=2024-01-31T23:59:59Z

By Status

/payments/list?status=succeeded

By Customer

/payments/list?customer_id=cus_xyz789

Combined Filters

/payments/list?status=succeeded&customer_id=cus_xyz789&currency=USD&limit=50