# invoices

```graphql
query Invoices {
  invoices {
    data {
      id
      number
      status
      description
      amountDue
      amountPaid
      amountTotal
      appliedBalanceAmount
      prorationAmount
      recurringAmount
      currency
      issuedAt
      hostedInvoiceUrl
      pdfUrl
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
  }
}
```

List the issued invoices of an account, or with kind upcoming the previews and drafts of what it will be charged next; returns one page of invoices with amounts in minor currency units. Requires account.billing.read.

## Arguments

| Name              | Type             | Required | Description                                                                                                             |
| ----------------- | ---------------- | -------- | ----------------------------------------------------------------------------------------------------------------------- |
| `input`           | InvoiceListInput |          |                                                                                                                         |
| `input.kind`      | String           |          | issued (default) lists finalized invoices. upcoming lists the preview of each active subscription, then draft invoices. |
| `input.sortBy`    | String           |          | date, amount or status. Pages follow Stripe order, newest first; sorting orders the returned page only.                 |
| `input.sortOrder` | String           |          | asc or desc. Defaults to desc.                                                                                          |
| `input.limit`     | Int              |          | Maximum number of invoices to return, 1 to 100. Defaults to 20.                                                         |
| `input.cursor`    | String           |          | Opaque cursor pointing at the next page. Omit it to read the first page.                                                |

## Responses

| Status | Description                        |
| ------ | ---------------------------------- |
| 200    | The InvoicePage! in data.invoices. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "query Invoices {\n  invoices {\n    data {\n      id\n      number\n      status\n      description\n      amountDue\n      amountPaid\n      amountTotal\n      appliedBalanceAmount\n      prorationAmount\n      recurringAmount\n      currency\n      issuedAt\n      hostedInvoiceUrl\n      pdfUrl\n    }\n    pageInfo {\n      hasNextPage\n      hasPreviousPage\n      startCursor\n      endCursor\n    }\n  }\n}"
}'
```

## Example response

```json
{
  "data": {
    "invoices": {
      "data": [
        {
          "id": "string",
          "number": "string",
          "status": "string",
          "description": "string",
          "amountDue": 0,
          "amountPaid": 0,
          "amountTotal": 0,
          "appliedBalanceAmount": 0,
          "prorationAmount": 0,
          "recurringAmount": 0,
          "currency": "string",
          "issuedAt": "string",
          "hostedInvoiceUrl": "https://example.com",
          "pdfUrl": "https://example.com"
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "hasPreviousPage": false,
        "startCursor": "string",
        "endCursor": "string"
      }
    }
  }
}
```
