Invoice Sum for date range

In this example we show you how return the total value of all invoices for a given time period.

What you’ll learn

  • How to return the total value of your invoices for a data range.

The Query

query MyQuery {
	invoiceSummary(
		where: { 
		invoicePaidAt: { gt: "2020-10-10", lt: "2022-10-10" }
		sellerAccountType: { eq: retailer }  
		}
	) {
		invoiceValueSum
	}
}

The Response

{
	"data": {
		"invoiceSummary": [
			{
				"invoiceValueSum": 4195386.55
			}
		]
	}
}