Shipments Query By order date

Hello

I am trying to get shipment details and I executed following query

query {

      shipments(order_date_from: "2020-09-08", order_date_to: "2020-09-09") {

        request_id

        complexity

        data(first: 10) {

          pageInfo {

            hasNextPage

            hasPreviousPage

            startCursor

            endCursor

          }

          edges {

            node {

              id

              legacy_id

              order_id

              user_id

              warehouse_id

              pending_shipment_id

              address {

                name

                address1

                address2

                city

                state

                country

                zip

                phone

              }

              picked_up

              needs_refund

              refunded

              delivered

              shipped_off_shiphero

              dropshipment

              created_date

              line_items(first: 10) {

                edges {

                  node {

                    id

                    legacy_id

                    line_item_id

                    shipment_id

                    shipping_label_id

                    quantity

                  }

                }

              }

              shipping_labels {

                id

                legacy_id

                account_id

                shipment_id

                order_id

                box_id

                status

                tracking_number

                order_number

                carrier

                shipping_name

                shipping_method

                cost

                box_code

                address {

                  name

                  address1

                  address2

                  city

                  state

                  country

                  zip

                  phone

                }

                device_id

                delivered

                picked_up

                refunded

                needs_refund

                profile

                partner_fulfillment_id

                full_size_to_print

                packing_slip

                warehouse

                insurance_amount

                carrier_account_id

              }

            }

            cursor

          }

        }

      }

    }

and I’m getting response like

{

    "data": {

        "shipments": {

            "request_id": "5f5a27715bc1c2c8a3bc9822",

            "complexity": 101,

            "data": {

                "pageInfo": {

                    "hasNextPage": false,

                    "hasPreviousPage": false,

                    "startCursor": null,

                    "endCursor": null

                },

                "edges": []

            }

        }

    }

}

Can you pls review and explain why I am not getting any shipment details?

Hi @velvinayak

It seems either there are not shipments created yet from your response pageInfo .

One more suggestion: your user quota might be 1001 and your requestComplexity is 101, so you can fetch 9 orders per request.

I have orders in my account with shipment details, Do I missing something here?

Thanks for explanations in advance.!!!

Hi @velvinayak
I am successful able to fetch the shipment
here is my request
query {

shipments(date_from: “2020-08-09”, date_to: “2020-09-09”) {

request_id

complexity

data(first:2) {

  edges {

    node {

      id

      legacy_id

      order_id

      user_id

      warehouse_id

      pending_shipment_id

      address {

        name

        address1

        address2

        city

        state

        country

        zip

        phone

      }

      shipped_off_shiphero

      dropshipment

      created_date

      line_items(first: 10) {

        edges {

          node {

            line_item_id

            quantity

          }

        }

      }

      shipping_labels {

        id

        legacy_id

        account_id

        tracking_number

        carrier

        shipping_name

        shipping_method

        cost

        profile

        packing_slip

        warehouse

        insurance_amount

        carrier_account_id

        source

        created_date

      }

    }

  }

}

}

}

here is my response

{

"data": {

    "shipments": {

        "request_id": "5f5a2f0a64d38b0059ab37a4",

        "complexity": 21,

        "data": {

            "edges": [

                {

                    "node": {

                        "id": "U2hpcG1lbnQ6OTQ2OTY4Njc=",

                        "legacy_id": 94696867,

                        "order_id": "T3JkZXI6MTQyMzc5NjY5",

                        "user_id": null,

                        "warehouse_id": "V2FyZWhvdXNlOjExNTU3",

                        "pending_shipment_id": null,

                        "address": null,

                        "shipped_off_shiphero": false,

                        "dropshipment": false,

                        "created_date": "2020-08-17T12:50:43+00:00",

                        "line_items": {

                            "edges": [

                                {

                                    "node": {

                                        "line_item_id": "TGluZUl0ZW06NDA2MzUzNjUx",

                                        "quantity": 1

                                    }

                                },

                                {

                                    "node": {

                                        "line_item_id": "TGluZUl0ZW06NDA2MzUzNjUw",

                                        "quantity": 1

                                    }

                                }

                            ]

                        },

                        "shipping_labels": [

                            {

                                "id": "U2hpcHBpbmdMYWJlbDo2ODIyOTQ5MQ==",

                                "legacy_id": 68229491,

                                "account_id": "QWNjb3VudDo1NDcyNg==",

                                "tracking_number": null,

                                "carrier": "Manually Fulfilled",

                                "shipping_name": null,

                                "shipping_method": null,

                                "cost": null,

                                "profile": null,

                                "packing_slip": null,

                                "warehouse": "Primary",

                                "insurance_amount": "0.00",

                                "carrier_account_id": null,

                                "source": null,

                                "created_date": "2020-08-17T12:50:43+00:00"

                            }

                        ]

                    }

                },

                {

                    "node": {

                        "id": "U2hpcG1lbnQ6OTU4MzY2MTk=",

                        "legacy_id": 95836619,

                        "order_id": "T3JkZXI6MTQyMzc5NjY5",

                        "user_id": null,

                        "warehouse_id": "V2FyZWhvdXNlOjExNTU3",

                        "pending_shipment_id": "UGVuZGluZ1NoaXBtZW50OjA=",

                        "address": null,

                        "shipped_off_shiphero": false,

                        "dropshipment": false,

                        "created_date": "2020-08-24T14:15:58+00:00",

                        "line_items": {

                            "edges": []

                        },

                        "shipping_labels": []

                    }

                }

            ]

        }

    }

}

}

Verify the dates and make sure the shipments happedn between those dates :slight_smile:

@khungersumit Thanks for reply.

I executed same query but I got response like:

{

    "data": {

        "shipments": {

            "request_id": "5f5a333cb17de5fc4fdc405b",

            "complexity": 21,

            "data": {

                "edges": []

            }

        }

    }

}

@velvinayak

did you verify the shipments which you are looking for lies in between the date filter which you are applying in the request?

Please verify it :slight_smile:

Hi @velvinayak!
I believe @khungersumit is right about this, it doesn’t seem o be any shipments on that account.
Try by going into https://shipping.shiphero.com/orders and shipping a couple of test orders with a generic label (or the label you want), then you should get some data on the query (including today in the date range)
Let me know if that still doesn’t help!
Thanks in advance
Tom

Thanks for reply @khungersumit @tomasw

@tomasw
I am at first stage of understanding graphql and shiphero flows.
So thanks for being patience to my questions.

I visited given link and I saw following orders.

How can we add label or they needed?
Because I added carrier infos already.

It will be helpful if you give some explanations.Thanks!!!

@velvinayak

Other way could be create shipment of an order. just edit your order info and then try to fetch it, it should work after that.

https://developer.shiphero.com/examples-mutation/#mutationshipment

@khungersumit Thank you very much. It worked.

It will be more helpful, if I get explanations about warehouse_id.

I used below one to get warehouses

query {

  account {

    request_id

    complexity

    data {

      id

      legacy_id

      email

      username

      warehouses {

        id

        legacy_id

        account_id

        identifier

        profile

      }

    }

  }

}

I got only one warehouse_id.

Real purpose of warehouse_id?
Because, it is required in product export to shiphero, but it is optional for order export to shiphero.

are there any logic behind them? like
CA = V2FyZWhvdXNlOjU5NzA=
NY = N2FyZWhvdXNlOjU5789=

thanks for guidance. :smiley:

Hi

Can you guys provide some brief info on this Shipments Query By order date about warehouse_id?

So It will be more helpful for me to move forward.

Thanks.!!!

Hi @velvinayak!
That is the ID of the warehouse the shipments were made from

In case it helps we have a section about how to make shipments through Public API: https://developer.shiphero.com/order-fulfillment/

Thanks again!
Tom