> For the complete documentation index, see [llms.txt](https://docs.gameket.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gameket.io/introduction/concepts/query-parameters.md).

# Query Parameters

API endpoints accept query parameters for filtering, pagination, and search.

#### Pagination Parameters

**Supported on all list endpoints:**

| Parameter | Type    | Default | Max | Description             |
| --------- | ------- | ------- | --- | ----------------------- |
| `page`    | integer | 1       | —   | Page number (1-indexed) |
| `limit`   | integer | 20      | 100 | Results per page        |

**Example:**

```bash
# Get page 2 with 50 results per page
GET /merchant/orders?page=2&limit=50
```

**Response includes pagination metadata:**

```json
{
  "success": true,
  "data": [...],
  "pagination": {
    "page": 2,
    "limit": 50,
    "total": 250,
    "pages": 5
  }
}
```

#### Filter Parameters

**Orders endpoint:**

```bash
GET /merchant/orders?status=pending&type=game-vouchers&page=1&limit=20

Parameters:
- status: pending | billed | codes-delivered | completed | refunded | cancelled | disputed
- type: direct-top-up | game-vouchers | gift-cards | prepaid | social-media-entertainment
- orderId: specific order ID
- from: ISO date (e.g., 2026-05-01)
- to: ISO date (e.g., 2026-05-31)
```

**Products endpoint:**

```bash
GET /merchant/products?type=game-vouchers&isActive=true&search=fifa&page=1&limit=20

Parameters:
- productId: specific product ID
- type: product category
- isApi: true | false
- isActive: true | false
- search: free text search on product name
```

#### Query Parameter Encoding

Always URL-encode special characters:

```javascript
// Bad: spaces and special characters not encoded
GET /merchant/products?search=fifa 2024

// Good: properly URL-encoded
GET /merchant/products?search=fifa%202024

// Using URLSearchParams (JavaScript)
const params = new URLSearchParams({
  search: 'fifa 2024',
  page: 1,
  limit: 20
});
const url = `https://api.gameket.io/merchant/products?${params.toString()}`;
```
