> 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.md).

# Concepts

Understanding these core concepts will help you build a robust integration with the Gameket Merchant API.

### Request Headers

All API requests follow a consistent header pattern.

#### Authentication Headers (All Protected Endpoints)

Required on every request to protected endpoints:

```bash
Authorization: Bearer {token}
x-merchant-api-key: {your_merchant_api_key}
```

Example:

```bash
curl -X GET https://api.gameket.io/merchant/orders \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "x-merchant-api-key: mapi_abc123def456"
```

#### Idempotency Headers (Write Operations Only)

For POST, PATCH, and PUT requests, include an `Idempotency-Key`:

```bash
Idempotency-Key: {unique-key-per-request}
```

Example:

```bash
curl -X POST https://api.gameket.io/merchant/products \
  -H "Authorization: Bearer ..." \
  -H "x-merchant-api-key: ..." \
  -H "Idempotency-Key: product-create-20260510-001" \
  -H "Content-Type: application/json" \
  -d '{"name": "Game Voucher", "price": 50}'
```

#### Content-Type Header

For JSON requests:

```bash
Content-Type: application/json
```

#### Standard Headers

These are automatically set by most HTTP clients:

```bash
Accept: application/json
Accept-Encoding: gzip, deflate
User-Agent: {your-app-name}/{version}
```
