> 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/examples/curl.md).

# cURL

Practical examples for integrating with the Gameket Merchant API in different languages and platforms.

### cURL

#### 1. Get Access Token

```bash
curl -X POST https://api.gameket.io/merchant/auth/check \
  -H "Content-Type: application/json" \
  -d '{
    "apiKey": "mapi_abc123def456",
    "secret": "your_merchant_secret"
  }'
```

**Save the token:**

```bash
TOKEN="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
API_KEY="mapi_abc123def456"
```

#### 2. Get Merchant Profile

```bash
curl -X GET https://api.gameket.io/merchant \
  -H "Authorization: Bearer $TOKEN" \
  -H "x-merchant-api-key: $API_KEY"
```

#### 3. List Orders

```bash
curl -X GET "https://api.gameket.io/merchant/orders?status=pending&page=1&limit=20" \
  -H "Authorization: Bearer $TOKEN" \
  -H "x-merchant-api-key: $API_KEY"
```

#### 4. Create Product

```bash
curl -X POST https://api.gameket.io/merchant/products \
  -H "Authorization: Bearer $TOKEN" \
  -H "x-merchant-api-key: $API_KEY" \
  -H "Idempotency-Key: product-fifa-coins" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "FIFA 2026 Coins",
    "description": "In-game currency",
    "type": "game-vouchers",
    "price": 50,
    "currency": "USD",
    "isApi": true
  }'
```

#### 5. Deliver Order Codes

```bash
curl -X POST "https://api.gameket.io/merchant/orders/codes?orderId=ord_abc123" \
  -H "Authorization: Bearer $TOKEN" \
  -H "x-merchant-api-key: $API_KEY" \
  -H "Idempotency-Key: deliver-codes-001" \
  -H "Content-Type: application/json" \
  -d '{
    "codes": ["FIFA26-ABC-XYZ-123", "FIFA26-DEF-UVW-456"]
  }'
```

#### 6. Refund Order

```bash
curl -X POST "https://api.gameket.io/merchant/orders/refund?orderId=ord_abc123" \
  -H "Authorization: Bearer $TOKEN" \
  -H "x-merchant-api-key: $API_KEY" \
  -H "Idempotency-Key: refund-001" \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "Customer requested refund",
    "amount": 50
  }'
```
