Orders Total - Unique

In this example we show you how to return the total number of unique orders

What you’ll learn

  • How to return the total number of unique orders for a given date range

The Query

query {
	invoiceSummary(
		where: { invoicePaidAt: { gt: "2020-10-10", lt: "2022-10-10" } }
	) {
		orderIdDistinctcount
	}
}

The Response

{
	"data": {
		"invoiceSummary": [
			{
				"orderIdDistinctcount": 46264
			}
		]
	}
}