# invoice query


`invoice` 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 one invoice, by its MAX `id` or by its `source` and `externalId`. Use it to read back
an invoice you synced.

- Requires the `invoice.read` permission.
- Returns null when the invoice does not exist or your API key cannot see it.

## Arguments

- `ref`: [`InvoiceRefInput!`](/chameleoon-max/type/invoice-ref-input) · required

## Returns

[`Invoice`](/chameleoon-max/type/invoice)

## Example

**Query**

```graphql
query invoice($ref: InvoiceRefInput!) {
  invoice(ref: $ref) {
    id
    direction
    kind
    status
    failureReason
    source
    sourceDocumentType
    sourceChangedAt
    syncedAt
    cancelled
    number
    variableSymbol
    constantSymbol
    specificSymbol
    supplierNumber
    orderNumber
    issueDate
    taxPointDate
    dueDate
    receivedDate
    vatClaimDate
    legalEntityId
    legalEntityMatch
    partnerId
    partnerMatch
    partnerEditable
    seller {
      name
      street
      city
      postalCode
      countryCode
      registrationId
    }
    buyer {
      name
      street
      city
      postalCode
      countryCode
      registrationId
    }
    delivery {
      name
      street
      city
      postalCode
      countryCode
      registrationId
    }
    paymentMethod
    paymentMethodName
    bankAccountNumber
    bankCode
    bankName
    iban
    swift
    currencyCode
    exchangeRate
    exchangeRateAmount
    homeCurrencyCode
    textBeforeItems
    textAfterItems
    printedNote
    vatNote
    reverseCharge
    oss
    totalNet
    totalVat
    totalGross
    rounding
    advancesDeducted
    amountDue
    totalNetHome
    totalVatHome
    totalGrossHome
    paymentStatus
    paidAmount
    remainingAmount
    paidAt
    correctsInvoiceId
    correctedNumber
    correctedIssueDate
    correctedTaxPointDate
    correctionReason
    internalNote
    lines(first: 10) {
      totalCount
    }
    vatSummary(first: 10) {
      totalCount
    }
    settlements(first: 10) {
      totalCount
    }
    links(first: 10) {
      totalCount
    }
    documents(first: 10) {
      totalCount
    }
    createdAt
    updatedAt
  }
}
```

**Variables**

```json
{
  "ref": {
    "id": "00000000-0000-4000-8000-000000000001"
  }
}
```

**Response**

```json
{
  "data": {
    "invoice": {
      "id": "00000000-0000-4000-8000-000000000001",
      "direction": "ISSUED",
      "kind": "INVOICE",
      "status": "PENDING",
      "failureReason": "example",
      "source": "example",
      "sourceDocumentType": "example",
      "sourceChangedAt": "2026-01-01T00:00:00Z",
      "syncedAt": "2026-01-01T00:00:00Z",
      "cancelled": true,
      "number": "example",
      "variableSymbol": "example",
      "constantSymbol": "example",
      "specificSymbol": "example",
      "supplierNumber": "example",
      "orderNumber": "example",
      "issueDate": "2026-01-01T00:00:00Z",
      "taxPointDate": "2026-01-01T00:00:00Z",
      "dueDate": "2026-01-01T00:00:00Z",
      "receivedDate": "2026-01-01T00:00:00Z",
      "vatClaimDate": "2026-01-01T00:00:00Z",
      "legalEntityId": "00000000-0000-4000-8000-000000000001",
      "legalEntityMatch": "EXPLICIT",
      "partnerId": "00000000-0000-4000-8000-000000000001",
      "partnerMatch": "EXPLICIT",
      "partnerEditable": true,
      "seller": {
        "name": "example",
        "street": "example",
        "city": "example",
        "postalCode": "example",
        "countryCode": "example",
        "registrationId": "example"
      },
      "buyer": {
        "name": "example",
        "street": "example",
        "city": "example",
        "postalCode": "example",
        "countryCode": "example",
        "registrationId": "example"
      },
      "delivery": {
        "name": "example",
        "street": "example",
        "city": "example",
        "postalCode": "example",
        "countryCode": "example",
        "registrationId": "example"
      },
      "paymentMethod": "BANK_TRANSFER",
      "paymentMethodName": "example",
      "bankAccountNumber": "example",
      "bankCode": "example",
      "bankName": "example",
      "iban": "example",
      "swift": "example",
      "currencyCode": "example",
      "exchangeRate": "10.00",
      "exchangeRateAmount": 1,
      "homeCurrencyCode": "example",
      "textBeforeItems": "example",
      "textAfterItems": "example",
      "printedNote": "example",
      "vatNote": "example",
      "reverseCharge": true,
      "oss": true,
      "totalNet": "10.00",
      "totalVat": "10.00",
      "totalGross": "10.00",
      "rounding": "10.00",
      "advancesDeducted": "10.00",
      "amountDue": "10.00",
      "totalNetHome": "10.00",
      "totalVatHome": "10.00",
      "totalGrossHome": "10.00",
      "paymentStatus": "UNPAID",
      "paidAmount": "10.00",
      "remainingAmount": "10.00",
      "paidAt": "2026-01-01T00:00:00Z",
      "correctsInvoiceId": "00000000-0000-4000-8000-000000000001",
      "correctedNumber": "example",
      "correctedIssueDate": "2026-01-01T00:00:00Z",
      "correctedTaxPointDate": "2026-01-01T00:00:00Z",
      "correctionReason": "example",
      "internalNote": "example",
      "lines": {
        "totalCount": 1
      },
      "vatSummary": {
        "totalCount": 1
      },
      "settlements": {
        "totalCount": 1
      },
      "links": {
        "totalCount": 1
      },
      "documents": {
        "totalCount": 1
      },
      "createdAt": "2026-01-01T00:00:00Z",
      "updatedAt": "2026-01-01T00:00:00Z"
    }
  }
}
```

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