List Transactions
Retrieve a paginated list of transactions with optional filters.
GET
https://api.zenpayz.com/merchant/api/v1/transactionsBearer · API key
Request
Headers
| Header | Description |
|---|---|
Authorization REQUIRED | Bearer {api_key} |
X-Signature REQUIRED | HMAC-SHA256 signature |
X-Timestamp REQUIRED | ISO 8601 timestamp |
X-Secret-Salt REQUIRED | Secret salt for HMAC validation |
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page OPTIONAL | integer1 | Page number |
limit OPTIONAL | integer20 | Items per page (max 100) |
status OPTIONAL | string- | Filter by status (initiated, processing, success, failed, cancelled, refunded, partially_refunded) |
currency OPTIONAL | string- | Filter by currency code |
paymentMethod OPTIONAL | string- | Filter by payment method |
customerId OPTIONAL | string- | Filter by customer ID |
startDate OPTIONAL | string- | Created after (ISO 8601) |
endDate OPTIONAL | string- | Created before (ISO 8601) |
minAmount OPTIONAL | number- | Minimum amount |
maxAmount OPTIONAL | number- | Maximum amount |
search OPTIONAL | string- | Search by transaction ID or reference |
Response
Success (200 OK)
{
"success": true,
"data": {
"data": [
{
"id": "txn_1234567890abcdef",
"intent_id": "pi_xxxxx",
"merchant_id": "mer_xxxxx",
"customer_id": "cus_xxxxx",
"customer_name": "John Doe",
"customer_email": "john@example.com",
"customer_phone": "+1234567890",
"amount": 10000,
"currency": "USD",
"status": "success",
"payment_method": "upi",
"description": "Order #123",
"metadata": {
"orderId": "order_123"
},
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-01-15T10:31:00.000Z"
}
],
"pagination": {
"total": 1500,
"page": 1,
"limit": 20,
"totalPages": 75
}
},
"message": "Transactions retrieved successfully",
"meta": {}
}
Transaction Status
| Status | Description |
|---|---|
initiated | Transaction initiated |
processing | Payment being processed |
success | Payment completed successfully |
failed | Payment failed |
cancelled | Transaction cancelled |
refunded | Transaction refunded |
partially_refunded | Transaction partially refunded |
Examples
- cURL
- SDK
curl -X GET "https://api.zenpayz.com/merchant/api/v1/transactions?status=success&limit=50" \
-H "Authorization: Bearer zp_test_xxxxx" \
-H "X-Timestamp: 2024-01-15T10:30:00.000Z" \
-H "X-Signature: a1b2c3d4e5f6..." \
-H "X-Secret-Salt: your_secret_salt"
const response = await zenpays.transactions.list({
status: 'success',
limit: 50,
});
const { data: transactions, pagination } = response.data;
console.log(`Found ${pagination.total} transactions`);
transactions.forEach(txn => {
console.log(`${txn.id}: ${txn.amount} ${txn.currency}`);
});