> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oneclickdz.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Orders

> Get paginated list of gift card orders

## Overview

Returns paginated list of all gift card and digital product orders with optional date filtering.

## Query Parameters

<ParamField query="page" type="integer" default={1}>
  Page number (minimum: 1)
</ParamField>

<ParamField query="pageSize" type="integer" default={20}>
  Items per page (minimum: 1, maximum: 100)
</ParamField>

<ParamField query="from" type="string">
  Start date (ISO 8601)
</ParamField>

<ParamField query="to" type="string">
  End date (ISO 8601)
</ParamField>

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.oneclickdz.com/v3/gift-cards/list?page=1&pageSize=20" \
    -H "X-Access-Token: YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    "https://api.oneclickdz.com/v3/gift-cards/list?page=1&pageSize=20",
    { headers: { "X-Access-Token": "YOUR_API_KEY" } }
  );
  const { data } = await response.json();
  ```

  ```python Python theme={null}
  response = requests.get(
      'https://api.oneclickdz.com/v3/gift-cards/list',
      headers={'X-Access-Token': 'YOUR_API_KEY'},
      params={'page': 1, 'pageSize': 20}
  )
  data = response.json()['data']
  orders = data['items']
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init();
  $url = 'https://api.oneclickdz.com/v3/gift-cards/list?page=1&pageSize=20';
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-Access-Token: YOUR_API_KEY']);
  $response = curl_exec($ch);
  $data = json_decode($response, true);
  $orders = $data['data']['items'];
  ?>
  ```
</CodeGroup>

### Response Example

```json theme={null}
{
  "success": true,
  "data": {
    "items": [
      {
        "_id": "69001dc60c7d0ff0c542d96f",
        "quantity": 1,
        "price_per_card": 0,
        "time": "2025-10-28T01:35:02.224Z",
        "fulfilled_quantity": 1,
        "fulfilled_amount": 0,
        "cards": [
          {
            "value": "SANDBOX-CARD-1",
            "serial": "SANDBOX-1"
          }
        ],
        "status": "FULFILLED",
        "product": "string",
        "type": "string"
      },
      {
        "_id": "68fcdd7cd712569c624e05ee",
        "quantity": 1,
        "price_per_card": 2000,
        "time": "2025-10-25T14:23:56.515Z",
        "fulfilled_quantity": 0,
        "fulfilled_amount": 0,
        "cards": [],
        "status": "REFUNDED",
        "product": "6126393c6f57860f925a1983",
        "type": "6126393c6f57860f925a1984"
      }
    ],
    "pagination": {
      "page": 1,
      "pageSize": 5,
      "totalPages": 11,
      "totalResults": 55
    }
  },
  "meta": {
    "timestamp": "2025-10-29T00:36:53.030Z"
  }
}
```

## Filtering

### By Date Range

```bash theme={null}
curl "https://api.oneclickdz.com/v3/gift-cards/list?from=2025-10-01T00:00:00Z&to=2025-10-31T23:59:59Z" \
  -H "X-Access-Token: YOUR_API_KEY"
```

### Client-Side Filtering

```javascript theme={null}
// Filter by status
const fulfilled = orders.filter((o) => o.status === "FULFILLED");
const refunded = orders.filter((o) => o.status === "REFUNDED");

// Calculate totals
const totalRevenue = orders
  .filter((o) => o.status === "FULFILLED")
  .reduce((sum, o) => sum + o.fulfilled_amount, 0);
```

## Related

<CardGroup cols={2}>
  <Card title="Place Order" icon="cart-shopping" href="/en/api-reference/gift-cards/place-order">
    Create new order
  </Card>

  <Card title="Check Order" icon="magnifying-glass" href="/en/api-reference/gift-cards/check-order">
    View specific order
  </Card>
</CardGroup>
