We are testing a referral integration in a Shopify development store with Admin GraphQL API 2026-07 and read_customers/read_orders access.
Before checkout, the customer’s numberOfOrders was “0” and orders was empty. After a successful Bogus Gateway checkout, the same customer returned numberOfOrders:“0” but orders contained exactly the newly paid order, with test:true and hasNextPage:false. Repeated reads showed the discrepancy. We subsequently fully refunded the test order; the discrepancy persisted. No referral credit was issued.
Minimal query (use a customer ID from your own test store):
query CountDiagnostic($friend: ID!) {
customer(id: $friend) {
numberOfOrders
orders(first: 2) {
nodes { id test createdAt displayFinancialStatus }
pageInfo { hasNextPage }
}
}
}
Observed structure, with identifiers omitted:
- numberOfOrders: “0”
- orders.nodes: exactly one order, test:true, initially PAID and later REFUNDED
- orders.pageInfo.hasNextPage: false
Questions:
- Does Admin Customer.numberOfOrders intentionally exclude test orders, and do cancelled/refunded orders affect it? Is there an official reference?
- Is this aggregate eventually consistent? What delay or reconciliation approach is supported?
- For first-ever-purchase eligibility, which supported evidence establishes lifetime history? We understand read_orders normally exposes only the last 60 days, so hasNextPage:false alone is not proof of complete lifetime history. How should imported/backdated/deleted orders be treated?
The Customer reference calls numberOfOrders a lifetime count, but does not explain this behavior. We have kept the eligibility safeguard unchanged rather than assuming that report exclusions also govern this API field.
References:
We can supply a request ID and exact resource IDs privately to Shopify staff if needed.