Query: List invoices by customer

For a specific business, fetches the first page of invoices for the specified customer.

This is an extension of the List Invoices example. See Query: List Invoices for further usage instructions.

Replace <BUSINESS_ID> with a real business id and <CUSTOMER_ID> with a real customer id.

Operation

query($businessId: ID!, $page: Int!, $pageSize: Int!, $customerId: ID!) {
  business(id: $businessId) {
    id
    isClassicInvoicing
    invoices(page: $page, pageSize: $pageSize, customerId: $customerId) {
      pageInfo {
        currentPage
        totalPages
        totalCount
      }
      edges {
        node {
          id
          createdAt
          modifiedAt
          pdfUrl
          viewUrl
          status
          title
          subhead
          invoiceNumber
          invoiceDate
          poNumber
          customer {
            id
            name
            # Can add additional customer fields here
          }
          currency {
            code
          }
          dueDate
          amountDue {
            value
            currency {
              symbol
            }
          }
          amountPaid {
            value
            currency {
              symbol
            }
          }
          taxTotal {
            value
            currency {
              symbol
            }
          }
          total {
            value
            currency {
              symbol
            }
          }
          exchangeRate
          footer
          memo
          disableCreditCardPayments
          disableBankPayments
          itemTitle
          unitTitle
          priceTitle
          amountTitle
          hideName
          hideDescription
          hideUnit
          hidePrice
          hideAmount
          items {
            product {
              id
              name
              # Can add additional product fields here
            }
            description
            quantity
            price
            subtotal {
              value
              currency {
                symbol
              }
            }
            total {
              value
              currency {
                symbol
              }
            }
            account {
              id
              name
              subtype {
                name
                value
              }
              # Can add additional account fields here
            }
            taxes {
              amount {
                value
              }
              salesTax {
                id
                name
                # Can add additional sales tax fields here
              }
            }
          }
          lastSentAt
          lastSentVia
          lastViewedAt
        }
      }
    }
  }
}
    
Operation Variables

{
  "businessId": "<BUSINESS_ID>",
  "page": 1,
  "pageSize": 20,
  "customerId": "<CUSTOMER_ID>"
}
    
Updated: