# receiptAdvices query


`receiptAdvices` is a GraphQL query of the Chameleoon MAX API. Send it as `POST https://max-api.chameleoon.sk/api/v1/graphql` with your API key, see [Chameleoon MAX](/chameleoon-max).

Returns a page of receipt advices that match a filter, newest first by `advisedAt`, then by
id. Use it to find the deliveries a warehouse expects.

- Requires the `advice.read` permission.
- Drafts that users build in MAX are listed too, with the status `DRAFT` and no number.
- Advices outside your API key's warehouse, legal-entity or partner scope are left out.

A connection, paged with `first`/`after` or `last`/`before`, at most 250 a page. Pass exactly
one of `first` or `last`, from 1 to 250. `first` (with `after`) pages forward; `last` (with
`before`) pages backward. `last` alone returns the last page.

A page costs 2 + first (or last) × the cost of one node.

## Arguments

- `filter`: [`ReceiptAdviceFilter`](/chameleoon-max/type/receipt-advice-filter)
- `first`: `Int`
- `after`: `String`
- `last`: `Int`
- `before`: `String`

## Returns

[`ReceiptAdviceConnection!`](/chameleoon-max/type/receipt-advice-connection): a page of [`ReceiptAdvice`](/chameleoon-max/type/receipt-advice).

## Example

**Query**

```graphql
query receiptAdvices($first: Int) {
  receiptAdvices(first: $first) {
    edges {
      cursor
    }
    nodes {
      id
      number
      kind
      status
      state
      supplierId
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
  }
}
```

**Variables**

```json
{
  "first": 10
}
```

**Response**

```json
{
  "data": {
    "receiptAdvices": {
      "edges": [
        {
          "cursor": "example"
        }
      ],
      "nodes": [
        {
          "id": "00000000-0000-4000-8000-000000000001",
          "number": "example",
          "kind": "DELIVERY_NOTE",
          "status": "DRAFT",
          "state": "DRAFT",
          "supplierId": "00000000-0000-4000-8000-000000000001"
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "hasPreviousPage": true,
        "startCursor": "example",
        "endCursor": "example"
      }
    }
  }
}
```

Values are illustrative: replace IDs and codes with your own before you send the call.
