Hi, we have looked through the GraphQL documentation etc but do not see a way of searching for Purchase Order receipts between dates - the only thing we can see is to retrieve information on specific Purchase Orders.
Using a webhook is not an option for us so can you advise if there an option to query Purchase Order receipts between dates like there is with Order Shipments?
The only option we can currently see is having to check all open Purchase Orders multiple times per day but would prefer to avoid having to do this.
Hey @keithb,
Thanks for reaching out!
Would a query like this work for you:
{
purchase_orders(
created_from: "_____"
created_to: "_____"
) {
request_id
complexity
data(first: 10) {
pageInfo{
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges{
node{
id
legacy_id
warehouse_id
created_at
po_date
date_closed
}
}
}
}
}
This filters by the creation date of the PO. You can also filter by the date it was closed using the fields date_closed_from
and date_closed_to
. In addition to that you can also filter by the actual PO date as well using the respective fields: po_date_from
and po_date_to
Please let me know if you have any questions or concerns.
Best,
RayanP
Hi Rayan,
Thank you for the response.
This would work where a PO is fully received. However if a PO was only part received what could we check?
I have one other related question regarding order shipments - is it possible to only return dispatched shipments, we have tried using the ‘shipped_off_shiphero’ field as a filter along with a date range but it gets rejected, eg:
shipments(shipped_off_shiphero: true, date_from: “2022-09-08”, date_to: “2022-09-30”)
“message”: “Unknown argument "shipped_off_shiphero" on field "shipments" of type "Query".”,
Is there another way of only returning processed shipments?
Thanks,
Keith.
Hey @keithb,
Thanks for hanging in there!
The created_from
and created_to
field should work no matter the PO status.
I’m having a little trouble understanding, What do you mean by dispatched shipments? The only available ways to filter the shipments
query are:
order_id: "string"
date_from: "_____"
date_to: "_____"
order_date_from: "_____"
order_date_to: "_____"
tracking_number: "string"
Please let me know if you have any questions or concerns.
Best,
RayanP
Hi Rayan,
That’s fine on the order shipments, we’re satisfied we can get what we need via the dates & checking for tracking references etc.
On the purchase receipts though, if say a Purchase Order is received in full over 2 seperate deliveries (meaning 2 different receipts) how can we find the relevant receipt information for each individual delivery?
Thanks,
Keith.
Hi Rayan,
Any thoughts on this, we would really like to get it closed off?:
“On the purchase receipts though, if say a Purchase Order is received in full over 2 seperate deliveries (meaning 2 different receipts) how can we find the relevant receipt information for each individual delivery?”
Thanks,
Keith.
Hello @keithb!
The API does not expose each individual receipt. If I understood correctly, you are looking for something that could let you know on x date we received x amount of SKU a, y amount of SKU b, and z amount of SKU c, correct?
What you could do though if this helps, is add receipt attachments and query them using the API, as I do not know exactly how you display the info on the other end of the integration, I´m not 100% sure if this could solve you issue.
Kind regards,
TomasFD