Get Transaction
Retrieve details of a specific transaction by ID.
GET
https://api.zenpayz.com/merchant/api/v1/transactions/{transactionId}Bearer · API key
Request
Path Parameters
| Parameter | Type | Description |
|---|---|---|
transactionId REQUIRED | string | Transaction ID (e.g., txn_xxxxx) |
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 |
Response
Success (200 OK)
{
"success": true,
"data": {
"id": "txn_xxxxx",
"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": 1000,
"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:35:00.000Z"
},
"message": "Transaction retrieved successfully",
"meta": {}
}
Error Responses
| Code | HTTP | Message |
|---|---|---|
| UNAUTHORIZED | 401 | Invalid API key |
| TRANSACTION_NOT_FOUND | 404 | Transaction doesn't exist |
Examples
- cURL
- SDK
curl -X GET "https://api.zenpayz.com/merchant/api/v1/transactions/txn_xxxxx" \
-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 transaction = await zenpays.payments.getTransaction('txn_xxxxx');
console.log(`Status: ${transaction.status}`);