How to retrieve filtered invoice Via API
haythem
Member Posts: 2
Hi there,
I want to get the invoices from a certain date at the moment I have to get all of them is there a way to add a filter to the call?
this the query im using at the moment :
{"query" : "query { business(id: company_id) { name phone isPersonal invoices { edges { node { internalId createdAt modifiedAt memo customer { internalId firstName lastName email mobile phone fax address{ addressLine1 addressLine2 city postalCode }shippingDetails { name phone address{ addressLine1 addressLine2 city postalCode }} } items{ quantity } }}}}}"}
1
Comments
Hi @haythem,
To fetch the invoices that have a specific invoice date, you can use the
invoiceDateStart
andinvoiceDateEnd
arguments from theinvoices
field of aBusiness
type.invoiceDateStart
filters for invoices dated on or after the provided date.invoiceDateEnd
filters for invoices dated before or on the provided date. So used together, you can narrow it down to a single date. Be aware of pagination too.Query:
Variables:
Hope that helps
Hi @RobVG,
Thank you for your help,
It worked
Regards
Haythem