Sales & CRMQu Query

customerAccountSummary

Topics: Commerce

Fetch a customer account summary with orders, estimates, invoices and financial totals. Requires customer:read.

Returns

CustomerAccountSummaryPayload!

Arguments

TypeID of the customer to summarise (cus_01K…). Must belong to the caller's tenant; otherwise the payload comes back empty with a customerId: customer not found error.

Inclusive start of the window, as an ISO-8601 date-time with fractional seconds (e.g. "2026-01-01T00:00:00.000Z"). Filters orders by orderDate and estimates/invoices by issueDate. Omit for no lower bound; an unparseable value is ignored, not rejected.

toDate

StringOptional

Exclusive end of the window, in the same ISO-8601 date-time format as fromDate. Omit for no upper bound; an unparseable value is ignored, not rejected.

Examples

Read Commerce Customer Account

query ReadCommerceCustomerAccount($customerId: CustomerID!) {
  customerAccountSummary(customerId: $customerId) {
    customer { id name }
    orders { id orderNumber totalAmount currency }
    estimates { id estimateNumber totalAmount currency }
    invoices { id invoiceNumber totalAmount paidAmount currency }
    totalInvoiced totalPaid totalOutstanding
    errors { path message }
  }
}

Variables

{
  "customerId": "cus_01h455vb4pex5vsknk084sn02q"
}
Exact field SDL
"""
Fetch a customer account summary with orders, estimates, invoices and financial totals. Requires customer:read.
"""
customerAccountSummary(
  """
  TypeID of the customer to summarise (`cus_01K…`). Must belong to the caller's tenant; otherwise the payload comes back empty with a `customerId: customer not found` error.
  """
  customerId: CustomerID!
  """
  Inclusive start of the window, as an ISO-8601 date-time with fractional seconds (e.g. "2026-01-01T00:00:00.000Z"). Filters orders by orderDate and estimates/invoices by issueDate. Omit for no lower bound; an unparseable value is ignored, not rejected.
  """
  fromDate: String
  """
  Exclusive end of the window, in the same ISO-8601 date-time format as `fromDate`. Omit for no upper bound; an unparseable value is ignored, not rejected.
  """
  toDate: String
): CustomerAccountSummaryPayload! @topic(names: ["commerce"]) @topic_example(names: ["commerce.customer-account"])

Declared on Query. Access is checked by the platform for each operation.