GET
/v1/transactions

Transactions

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 transactions
  • refund - Refund transactions (amount will be negative)
  • failed - Failed payment attempts

Query Parameters

Query Parameters
All parameters are optional
limit
optional

Number of results per page (default: 20, max: 100)

offset
optional

Pagination offset (default: 0)

status
optional

Filter by status: succeeded, failed, pending, refunded

type
optional

Filter by type: payment, refund

start_date
optional

Filter transactions from this date (ISO 8601 format)

end_date
optional

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 successfully
400
Invalid query parameters
401
Authentication failed
Success 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"
  }
}