Customer Statements Queries

Returns a customer's outstanding balance statement, grouped by currency, with aging and the underlying open documents.

CustomerStatement — Returns the outstanding statement for a customer

Parameters:

ParameterTypeDescription
customer_idID!ID of the customer.

Example Query:

query GetCustomerStatement($customerId: ID!) {
  CustomerStatement(customer_id: $customerId) {
    customer_id
    as_of
    exposure
    exposure_currency
    currencies {
      currency
      invoices_due
      credits_available
      net_due
      prepaid_deposits
      aging {
        not_due
        days_1_30
        days_31_60
        days_61_90
        days_over_90
      }
      lines {
        document_type
        document_id
        label
        currency
        dated_at
        due_at
        total
        settled
        remaining
        days_overdue
        affects_net
        order_id
        order_label
      }
    }
  }
}
{
  "customerId": 100001
}

CustomerStatement type

FieldTypeDescription
customer_idID!Customer ID.
as_ofString!Date of the statement.
exposureFloat!Net exposure in the company currency.
exposure_currencyString!Currency code used for exposure.
currencies[CustomerStatementCurrency!]Per-currency breakdown.

CustomerStatementCurrency type

FieldTypeDescription
currencyString!Currency code.
invoices_dueFloat!Outstanding invoice amount.
credits_availableFloat!Available credits.
net_dueFloat!Net amount due.
prepaid_depositsFloat!Prepaid deposits.
agingCustomerStatementAging!Aging buckets.
lines[CustomerStatementLine!]Open documents.

CustomerStatementAging type

FieldTypeDescription
not_dueFloat!Amount not yet due.
days_1_30Float!Amount overdue by 1 to 30 days.
days_31_60Float!Amount overdue by 31 to 60 days.
days_61_90Float!Amount overdue by 61 to 90 days.
days_over_90Float!Amount overdue by more than 90 days.

CustomerStatementLine type

FieldTypeDescription
document_typeString!Document type.
document_idID!Document ID.
labelString!Document number.
currencyString!Document currency.
dated_atStringDocument date.
due_atStringDue date.
totalFloat!Document total.
settledFloat!Settled amount.
remainingFloat!Remaining amount.
days_overdueIntNumber of days overdue.
affects_netBoolean!Whether the line affects the net amount due.
order_idIDLinked order ID.
order_labelStringLinked order number.