# Purchase Orders filters

**URL:** https://community.shiphero.com/t/purchase-orders-filters/303
**Category:** GraphQL API
**Created:** [January 21, 2020, 5:37pm UTC](https://community.shiphero.com/t/purchase-orders-filters/303 "2020-01-21T17:37:35Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![statonjm](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@statonjm](https://community.shiphero.com/u/statonjm)
#### Post date: [January 21, 2020, 5:37pm UTC](https://community.shiphero.com/t/purchase-orders-filters/303/1 "2020-01-21T17:37:35Z")

</div>

I am trying to create an inventory feed integration. My current goal is to find out how much of each item is “inbound”, where we have created a Shipping Plan for the item but the Item has not yet been received. I was planning on grabbing all POs which were created or updated the day before.

I am wondering if there are plans to include date filters for the Purchase Orders (similar to Orders having an order\_date\_from and order\_date\_to). If we have these filters for Purchase Orders then I could grab just yesterday’s POs. Or perhaps there is an alternative that would work to find out what inventory is inbound?

Inventory changes is the change in on\_hand, so this would not cover the gap I’m looking to fill, correct?

Thanks in advance!

---

<div class="post-metadata">

### Author: ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)
#### Post date: [January 22, 2020, 1:06pm UTC](https://community.shiphero.com/t/purchase-orders-filters/303/2 "2020-01-22T13:06:40Z")

</div>

Hi @statonjm !  
For the filter of POs you need, it would be for the date you _ **expect the PO** _, and not the date it was _ **created** _, Did I get that right?

As for` inventory_changes` query, it should show you changes on the **on\_hand** but only for the items that have already been received from the POs.

Thanks!  
Tom

---

<div class="post-metadata">

### Author: ![statonjm](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@statonjm](https://community.shiphero.com/u/statonjm)
#### Post date: [January 22, 2020, 3:48pm UTC](https://community.shiphero.com/t/purchase-orders-filters/303/3 "2020-01-22T15:48:22Z")

</div>

Hey @tomasw, thanks for the quick reply!

Regarding the PO dates, I am really looking for the equivalent of both the created and updated dates. That way, I can send in 2 requests to get all the info I need:

1. all POs created yesterday
2. all POs updated yesterday

This would enable me to always have up to date information on the status of all POs.

Perhaps I am not sure what the meaning of “expect the PO” is! But it sounds like it is an estimate for when the inventory will be received. My issue with using that as a field would be if the inventory is received before or after that expected date, then it will throw off my inventory counts!

Thanks for confirming about the inventory\_changes request. Appreciate the help!

---

<div class="post-metadata">

### Author: ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)
#### Post date: [January 23, 2020, 2:30pm UTC](https://community.shiphero.com/t/purchase-orders-filters/303/4 "2020-01-23T14:30:15Z")

</div>

Hi @statonjm !  
For **updated\_at** we don’t have that info for PO’s, its only available for the line items inside those PO’s.  
Would a filter for **created\_at** for PO’s work for you?

You are right about po\_dat, it’s an estimate for when the inventory will be received

---

<div class="post-metadata">

### Author: ![statonjm](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@statonjm](https://community.shiphero.com/u/statonjm)
#### Post date: [January 23, 2020, 4:58pm UTC](https://community.shiphero.com/t/purchase-orders-filters/303/5 "2020-01-23T16:58:45Z")

</div>

@tomasw thanks for the reply!  
Thanks for the tip about updated\_at being available for the lines within the PO, as well as confirming my assumption for po\_date. I think the created\_at date would be a useful filter, as I would then be able to create one workflow which grabs POs that were created yesterday, then another workflow that can lookup information using the purchase\_order query.

Once a PO is closed (indicated by date\_closed field + fulfillment\_status), then all inventory has been accounted for, correct? In other words, I wouldn’t expect any changes to inventory being received.

Also, have you all considered using an update field for POs? Myself and others would definitely have less of a footprint if we could filter by this field! Right now I would have to query all open POs everyday until they close, vs. using the filter to just grab the relevant POs!

---

<div class="post-metadata">

### Author: ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)
#### Post date: [January 24, 2020, 12:10pm UTC](https://community.shiphero.com/t/purchase-orders-filters/303/6 "2020-01-24T12:10:24Z")

</div>

Hi @statonjm !

Great!, I’ll already submit a request for that filter (created\_at). I’ll let you know as soon as I have an update on that.

You are right about the **date\_closed** , the idea is that after that date you shouldn’t expect any changes to inventory being received, as it has already been closed.

As for the **updated\_at** we don’t currently store that, but I’ll also ask if this is possible and let you know.  
Thanks again!  
Tom

---

<div class="post-metadata">

### Author: ![statonjm](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@statonjm](https://community.shiphero.com/u/statonjm)
#### Post date: [January 24, 2020, 4:11pm UTC](https://community.shiphero.com/t/purchase-orders-filters/303/7 "2020-01-24T16:11:08Z")

</div>

Awesome @tomasw , thanks for the help, glad to see that you all are open to hear requests and implement! Very cool.

---

<div class="post-metadata">

### Author: ![rubix3](https://avatars.discourse-cdn.com/v4/letter/r/ecccb3/32.png) [@rubix3](https://community.shiphero.com/u/rubix3)
#### Post date: [February 20, 2020, 12:36pm UTC](https://community.shiphero.com/t/purchase-orders-filters/303/8 "2020-02-20T12:36:21Z")

</div>

Wanted to comment on this area as well. I am in agreeance that if we can get an updated at field that we can filter on that would be a huge win. Or at least an area to pull in purchase order history and then we can have the opportunity to create a job that will update that information for each time something is changed would be great.

@tomasw - any update on this type of request being implemented?

Thanks,  
rubix3

---

<div class="post-metadata">

### Author: ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)
#### Post date: [February 22, 2020, 1:16pm UTC](https://community.shiphero.com/t/purchase-orders-filters/303/9 "2020-02-22T13:16:00Z")

</div>

Hi @rubix3 !  
So far I don’t have any update, but can say that the request has already been assigned to an Engineer.  
I’ll be talking to him on Monday to see if this can be expedited or if I can provide a better ETA.  
I also asked about the **updated\_at** & **purchase\_order\_history** , to see if thats something possible to have.  
I appreciate your patience and I will let you know as soon as I get a response on that.  
Thanks!,  
Tom

---

<div class="post-metadata">

### Author: ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)
#### Post date: [February 28, 2020, 12:20pm UTC](https://community.shiphero.com/t/purchase-orders-filters/303/10 "2020-02-28T12:20:49Z")

</div>

Hi @rubix3 & @statonjm

This should be available now.  
A query like this one should work for the created\_at:

```
query{
  purchase_orders(created_from: "2020-02-14", created_to: "2020-02-15"){
    request_id
    complexity
    data(first:10){
      edges{
        node{
           id
    legacy_id
    po_number
    account_id
          created_at
        }
      }
    }
  }
}

```

And this should return purchase orders with a **created\_at** date between **2020-02-14** and **2020-02-15**.  
I will let you know as soon as I get a response about the **purchase\_order\_history** request ( **updated\_at** will not be implemented unfortunately)  
Thanks for the patience on this!  
Tom

---

<div class="post-metadata">

### Author: ![rubix3](https://avatars.discourse-cdn.com/v4/letter/r/ecccb3/32.png) [@rubix3](https://community.shiphero.com/u/rubix3)
#### Post date: [March 2, 2020, 11:48am UTC](https://community.shiphero.com/t/purchase-orders-filters/303/11 "2020-03-02T11:48:45Z")

</div>

Hello @tomasw -

Thank you for the update! I am very appreciative of the addition of a created\_at date that will allow me to pull in new purchase orders more efficiently. I do hope that the team considers adding in the updated\_at field because of it’s more universal approach. Essentially, if that field was available you wouldn’t necessarily need the created\_at field because for new PO’s they should essentially be the same or at the very least would be within the window you are looking for when bringing in information. Given that there are only 700 credits to spare, the amount of time it will take to bring in this information will grow as a business grows making it harder for us to scale out our product to bring in information.

Is there another solution available that we can leverage to pull this information? (Specifically for purchase order history and only pulling in updated purchase order lines)

Thanks,  
-Nick

---

<div class="post-metadata">

### Author: ![tomasw](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/tomasw/32/248_2.png) [@tomasw](https://community.shiphero.com/u/tomasw)
#### Post date: [March 6, 2020, 3:42pm UTC](https://community.shiphero.com/t/purchase-orders-filters/303/12 "2020-03-06T15:42:35Z")

</div>

Hi @rubix3  
I apologize for keeping you waiting on this.  
Unfortunately, my request has been turned down, for the time being, we will only have **created\_at** and **closed\_at** as filters. Either **updated\_at** or **purchase\_order\_history** will not be developed at the time.  
What I think it might be helpful is a webhook for this, we currently have this one that might be helpful:

[https://shipheropublic.docs.apiary.io/#reference/webhooks/order-canceled-webhook-url/purchase-order-update-webhook-url](https://shipheropublic.docs.apiary.io/#reference/webhooks/order-canceled-webhook-url/purchase-order-update-webhook-url)

Please let me know if there’s anything else I can assist you with.  
Thanks!,  
Tom
