# Get Transactions

Retrieve a paginated, filterable list of transactions for your outlet.

**GET** `/api/paylater/merchant-portal/v2/web-checkout/transactions`

- Sandbox: `https://connect.uat.paylaterapp.com/api/paylater/merchant-portal/v2/web-checkout/transactions`
- Production: `https://connect.paylaterapp.com/api/paylater/merchant-portal/v2/web-checkout/transactions`

> **Info: Authentication**
>
> All requests require a bearer token from the [OAuth 2.0 token endpoint](https://docs.paylaterapp.com/authentication.html). Pass it as `Authorization: Bearer <ACCESS_TOKEN>`.

## Request

#### Headers

| Header | Value |
| --- | --- |
| `Authorization` | `Bearer <ACCESS_TOKEN>` |

**Query parameters**

- `size` (Int, required): Records per page.
- `page` (Int, required): Page number.
- `search_text` (String, optional): Search by customer name / ID.
- `start_date` (Date, optional): Start date filter (YYYY-MM-DD).
- `end_date` (Date, optional): End date filter (YYYY-MM-DD).
- `status` (String, optional): Transaction status filter.

### Example request

**cURL**

```bash
curl --location 'https://connect.uat.paylaterapp.com/api/paylater/merchant-portal/v2/web-checkout/transactions?size=20&page=0' \
  --header 'Authorization: Bearer <ACCESS_TOKEN>'
```

**Node.js**

```javascript
const res = await fetch(
  'https://connect.uat.paylaterapp.com/api/paylater/merchant-portal/v2/web-checkout/transactions?size=20&page=0',
  {
    method: 'GET',
    headers: {
      Authorization: `Bearer ${accessToken}`,
    },
  },
);

const transactions = await res.json();
```

**Python**

```python
import requests

resp = requests.get(
    "https://connect.uat.paylaterapp.com/api/paylater/merchant-portal/v2/web-checkout/transactions",
    headers={
        "Authorization": f"Bearer {access_token}",
    },
    params={
        "size": 20,
        "page": 0,
    },
)

transactions = resp.json()
```

**PHP**

```php
$ch = curl_init('https://connect.uat.paylaterapp.com/api/paylater/merchant-portal/v2/web-checkout/transactions?size=20&page=0');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . $accessToken,
    ],
]);

$response = json_decode(curl_exec($ch), true);
```

## Response

Returns a paginated list of transactions, each with customer, loan, and status details (see [Get Transaction by Order ID](https://docs.paylaterapp.com/get-transaction-by-order-id.html) for the per-item shape).

## Errors

```json
{
  "error": "Invalid API Key"
}
```
