Orders CSV and Line Items CSV, from GraphQL API

Hello,

Once or more per day we filter orders in the ShipHero dashboard to get all unfulfilled orders within a given date range, and we export the data as a CSV. We then filter line items in the ShipHero dashboard to get all unfulfilled line items within a given date range, and we export that data as a CSV as well. We then import those CSV’s elsewhere to analyze the data.

We’re working on automating this export/import process using the GraphQL API.

The process we’re developing involves getting all orders, and then looping through those to get all line items for orders that we’re interested in.

These two questions came up early in development:

  1. Is there a parameter that allows us to get all unfulfilled orders, or do we have to get either all orders or orders for a particular status?

  2. What are the updated_from and updated_to parameters for orders based upon? For example, if a line item is cancelled or quantity is adjusted, has the order been “updated”?

Thank you!

-Sid

1 Like

With the orders query, are we able to filter all unfulfilled orders using the fulfillment_status parameter or otherwise?

I may have muddled that question by talking about CSVs, that part is irrelevant really :slight_smile:

Hi @originsid
I apologize for the delay in my response!.
Unfortunately that is not available at the moment, you have to search for specific statuses.
But I already submitted a request for this to our engineering team so they can see if this si something we could build.
It was clear but thanks for clarifying it :slightly_smiling_face:
I will let you know as soon as I have an update.
Thanks!,
Tom

Thank You @tomasw !

The other thing that would help to make sure we’re only querying for necessary data is clarification on the updated_from and updated_to parameters.

We’ll likely test this in the sandbox account, but are we correct to assume that if there is an entry made in the order history then the latest entry is the “updated” time for the order?

Thank you again!

-Sid from Origin

Hi @originsid!
You’ll be right to asume that.
updated_from and updated_to are the values we store for latest updates done on the orders

Thank you again @tomasw!

1 Like

Hi @originsid!
We apologize for the delay about this, but in case it helps, now you should be able to filter orders using “unfulfilled” as a status

Example:

query {
  orders(fulfillment_status: "unfulfilled") {
    request_id
    complexity
    data(first: 100) {
      edges {
        node {
          id
          legacy_id
          order_number
          partner_order_id
          shop_name
          fulfillment_status
        }
      }
    }
  }
}

Thanks again for the patience while we implemented this!
Tom