<!-- ZenPays documentation · https://docs.zenpays.com/docs/rest-api/endpoints/wallet/wallet-transactions -->

# Get Wallet Transactions

Retrieve wallet transaction history.

## List Transactions

<EndpointHeader verb="GET" path="/merchant/api/v1/wallet/{currency}/transactions" />

### Headers

<ParamTable
  label="Header"
  rows={[
    { name: "Authorization", required: true, desc: "`Bearer {api_key}`" },
    { name: "X-Signature", required: true, desc: "HMAC-SHA256 signature" },
    { name: "X-Timestamp", required: true, desc: "ISO 8601 timestamp" },
    { name: "X-Secret-Salt", required: true, desc: "Secret salt for HMAC validation" },
  ]}
/>

### Query Parameters

<ParamTable
  rows={[
    { name: "page", type: "integer", default: "1", desc: "Page number" },
    { name: "limit", type: "integer", default: "20", desc: "Items per page" },
    { name: "startDate", type: "string", default: "-", desc: "Start date filter (ISO 8601)" },
    { name: "endDate", type: "string", default: "-", desc: "End date filter (ISO 8601)" },
    { name: "type", type: "string", default: "-", desc: "Filter by type (`CREDIT`, `DEBIT`, `SETTLEMENT`, `COMMISSION`, `REFUND`, `CHARGEBACK`, `ADJUSTMENT`)" },
    { name: "status", type: "string", default: "-", desc: "Filter by status (`PENDING`, `PROCESSING`, `COMPLETED`, `FAILED`, `REVERSED`)" },
    { name: "minAmount", type: "number", default: "-", desc: "Minimum transaction amount" },
    { name: "maxAmount", type: "number", default: "-", desc: "Maximum transaction amount" },
    { name: "sortOrder", type: "string", default: "-", desc: "Sort order (`asc` or `desc`)" },
  ]}
/>

### Response (200 OK)

```json
{
  "success": true,
  "data": [
    {
      "id": "wtx_xxxxx",
      "type": "CREDIT",
      "amount": 1000,
      "currency": "USD",
      "balance": 250000,
      "description": "Payment received",
      "reference": "txn_xxxxx",
      "status": "COMPLETED",
      "createdAt": "2024-01-15T10:30:00.000Z"
    },
    {
      "id": "wtx_yyyyy",
      "type": "SETTLEMENT",
      "amount": 500,
      "currency": "USD",
      "balance": 249500,
      "description": "Settlement to bank",
      "reference": "stl_xxxxx",
      "status": "COMPLETED",
      "createdAt": "2024-01-15T09:00:00.000Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 500,
    "totalPages": 25
  }
}
```

---

## Get Transaction Detail

<EndpointHeader verb="GET" path="/merchant/api/v1/wallet/{currency}/transactions/{transactionId}" />

### Path Parameters

<ParamTable
  rows={[
    { name: "transactionId", type: "string", required: true, desc: "Wallet transaction ID" },
  ]}
/>

### Response (200 OK)

```json
{
  "success": true,
  "data": {
    "id": "wtx_xxxxx",
    "type": "CREDIT",
    "amount": 1000,
    "currency": "USD",
    "balance": 250000,
    "description": "Payment received",
    "reference": "txn_xxxxx",
    "status": "COMPLETED",
    "createdAt": "2024-01-15T10:30:00.000Z"
  }
}
```

## Transaction Types

| Type | Description |
|------|-------------|
| `CREDIT` | Money added to wallet |
| `DEBIT` | Money withdrawn from wallet |
| `SETTLEMENT` | Settlement to bank account |
| `COMMISSION` | Commission or fee |
| `REFUND` | Refund processed |
| `CHARGEBACK` | Chargeback deduction |
| `ADJUSTMENT` | Manual adjustment |

## Transaction Statuses

| Status | Description |
|--------|-------------|
| `PENDING` | Transaction initiated, awaiting processing |
| `PROCESSING` | Transaction being processed |
| `COMPLETED` | Transaction completed |
| `FAILED` | Transaction failed |
| `REVERSED` | Transaction reversed |

<CodeRail>

## Examples

<Tabs groupId="language">
  <TabItem value="curl" label="cURL" default>

```bash
# List wallet transactions
curl -X GET "https://api.zenpays.com/merchant/api/v1/wallet/{currency}/transactions?type=CREDIT&limit=50&sortOrder=desc" \
  -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"

# Get transaction detail
curl -X GET "https://api.zenpays.com/merchant/api/v1/wallet/{currency}/transactions/wtx_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"
```

  </TabItem>
  <TabItem value="sdk" label="SDK">

```javascript
// List transactions
const { data } = await zenpays.wallet.getTransactions({
  type: 'CREDIT',
  limit: 50,
  sortOrder: 'desc',
});

// Get transaction detail
const txn = await zenpays.wallet.getTransaction('wtx_xxxxx');
```

  </TabItem>
</Tabs>

</CodeRail>
