# Historic data via GraphQL

Where as it is possible to get some data from our API for historic Customers, Cards or Transactions - its not always optimal due to the volume / Throttling limits. Typically we would recommend using data exports to get historic data and then enabling real time web hooks to keep the data in sync going forward.

### Get Transactions

You can get a list of historic orders, and narrow down by created\_at. This will return all orders on a specific day

This call also supports [pagination](https://developers.usetoggle.com/graphql/pagination-throttling), so you can easily chunk up the requests as needed.

```graphql
{
  Orders(
    page: 1
    limit: 10
    created_at: "2025-02-03 00:00:00"
  ) {
    data {
      LineItems {
        id
        created_at
        Transaction {
            merchant_transaction_reference
        }
        Card {
            card_reference
            balance
            expiry_time
        }
      }
    }
  }
}
```

### Get Orders

You can get all historic orders from the API. The limitations to this request is that you cannot specific a date, and the results are sorted by 'Card ID' - so new transactions can appear at any page within the results rather than at the end.

```graphql
{
  LineItems(
    page: 1
    limit: 10
  ) {
    data {
        id,
        created_at,
        value,
        LineItemType
        {
            name,
        }
        Transaction{
            merchant_transaction_reference,
            Merchant
            {
                name
            }
            Unit
            {
                name
                id
            }
        }
        Card
        {
            id,
            Account{
                name,
                id
            }
            card_reference,
            pin,
            balance,
            expiry_time,
            card_alias_card_reference
            product_name
        }
    }
  }
}
```
