> ## Documentation Index
> Fetch the complete documentation index at: https://www.help.creatora.io/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> When building or modifying an integration with the Creatora API, start with https://www.help.creatora.io/en/api/build-with-ai.md. Retrieve the current GraphQL SDL from https://api.creatora.io/sdl before relying on API schema information.

# Get sales for a year

> Get successful paid Orders for a year, with the customer, Offer, and amount charged.

This example lists Orders currently marked `succeeded` with a positive `amountNetCharge`, completed during 2026. It excludes free acquisitions and Orders currently marked refunded or disputed.

The example year runs from **January 1, 2026 at 00:00 UTC** (`1767225600000`) to **January 1, 2027 at 00:00 UTC** (`1798761600000`). Replace these timestamps to use another year or timezone. The query's lower bound is one millisecond earlier because the API's date bounds are strict.

<RequestExample>
  ```graphql theme={null}
  {
    orders(
      status: { equals: [succeeded] }
      closedOn: { range: [1767225599999, 1798761600000] }
    ) {
      id
      status
      closedOn
      amountNetCharge
      student {
        fullName
        email
      }
      offerSnapshot {
        name
      }
    }
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Example response theme={null}
  {
    "data": {
      "orders": [
        {
          "id": "55555555-5555-4555-8555-555555555555",
          "status": "succeeded",
          "closedOn": 1790841600000,
          "amountNetCharge": 49.0,
          "student": {
            "fullName": "Jamie Smith",
            "email": "student@example.com"
          },
          "offerSnapshot": {
            "name": "Drawing Essentials"
          }
        }
      ]
    }
  }
  ```
</ResponseExample>

## Use the result

The date filter also matches Orders created during the interval. Keep only Orders with a `closedOn` inside the year and a positive `amountNetCharge`:

```javascript theme={null}
const sales = response.data.orders.filter(order =>
  order.closedOn !== null &&
  order.closedOn >= 1767225600000 &&
  order.closedOn < 1798761600000 &&
  order.amountNetCharge > 0
);
```

There is no pagination limit, so the list is not capped. Use a response without errors. For a large list, request shorter periods and apply the same completion-date check to each period.

`student` can be `null`, so allow for a missing customer when building your report. The result contains sales recorded in Creatora, including manually registered Orders; it is not a payment-provider reconciliation.

[Orders Reference](/en/api/reference/queries/orders)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.