GET
/v1/transactionsTransactions
Fetches history for the Merchant's dashboard. Use this endpoint to retrieve transaction history, generate reports, and analyze payment data.
Overview
Retrieve a paginated list of all transactions (payments and refunds) for your account. This endpoint is useful for building merchant dashboards, generating reports, and reconciling payments.
Transaction Types:
payment- Successful payment transactionsrefund- Refund transactions (amount will be negative)failed- Failed payment attempts
Query Parameters
Query Parameters
All parameters are optional
limitoptional
Number of results per page (default: 20, max: 100)
offsetoptional
Pagination offset (default: 0)
statusoptional
Filter by status: succeeded, failed, pending, refunded
typeoptional
Filter by type: payment, refund
start_dateoptional
Filter transactions from this date (ISO 8601 format)
end_dateoptional
Filter transactions until this date (ISO 8601 format)
Code Examples
curl -X GET "https://api.demo-gateway.com/v1/transactions?limit=20&offset=0" \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
Response
Status Codes
200
Transactions retrieved successfully400
Invalid query parameters401
Authentication failedSuccess Response
Example response for a successful request
{
"transactions": [
{
"transaction_id": "txn_1234567890abcdef",
"payment_id": "pay_1234567890abcdef",
"type": "payment",
"status": "succeeded",
"amount": 10000,
"currency": "THB",
"created_at": "2024-01-15T10:30:00Z"
},
{
"transaction_id": "txn_0987654321fedcba",
"payment_id": "pay_0987654321fedcba",
"type": "refund",
"status": "succeeded",
"amount": -5000,
"currency": "THB",
"created_at": "2024-01-15T11:00:00Z"
}
],
"total": 150,
"limit": 20,
"offset": 0
}Error Response
Example response for an error
{
"error": {
"code": "invalid_parameters",
"message": "Invalid query parameters",
"type": "validation_error"
}
}