Export Order Through API In Shiphero Getting Forbidden Issue

Hi @bhautik!
Do you happen to have an example of the query you are running? (or the request_id would be better)
That way I can check if it has the first filters and analyze if we can do something to make it more efficient and consume fewer credits.
Also, what are you looking to achieve with the query?

Thanks again!
Tom

Hi

Request ID : 5f620e8a01adc15b24b0f343

Thanks

Thanks for that @bhautik!
In that case you could add a first:3 on the shipments, something like this:

query {
  shipments(order_id: "147128028" analyze:true) {
    request_id
    complexity
    data(first:5) {
      edges {
        node {
          id
          legacy_id
          order_id
          user_id
          warehouse_id
          pending_shipment_id
          address {
            name
            address1
            address2
            city
            state
            country
            zip
            phone
          }
          line_items(first: 10) {
            edges {
              node {
                line_item_id
                quantity
                line_item {
                  product_name
                  sku
                }
              }
            }
          }
          shipping_labels {
            id
            tracking_number
            carrier
            shipping_name
            shipping_method
            cost
          }
        }
      }
    }
  }
} 

You could even send it to first:1. If you don’t add this filter, it will try to get the first:100 and getting to expensive.

On the other hand, if you need to get many orders/shipments at once you could use the date filter, something like this:

query {
  shipments(date_from:"2020-09-12" date_to:"2020-09-13") {
    request_id
    complexity
    data {
    .....

This way you could navigate through all shipments made between those dates

Let me know if that doesn’t help or I could explain better.
Thanks again!
Tom

Hi @tomasw

can you please check it this request id 5f6302aba6bafb762f7490e3…It takes 31 complexity to fetch one product data. can you please tell me how we can decrease the complexity…

Thanks

Hello @tomasw

Is there any api to check shipment status Is Fulfilled or not Fulfilled ?

Hi @tomasw

What is the meaning of Status:“valid” we get in Shipment Query ?

Thanks

Hi @bhautik!

As for:

This is because you are including the available field which has an extra complexity because it is calculated based on Sell Ahead from purchase orders, reserved amounts and takes everything into consideration (it might not match the available number you see in the UI)

Not at the moment, but we are working on making a filter that will allow you to get al “Unfulfilled” orders, just like the one we have at https://app.shiphero.com/dashboard/orders/manage but we don’t have an ETA on when this will be available.

This is for the shipping label? something like this:

shipping_labels {
            id
            tracking_number
            carrier
            shipping_name
            shipping_method
            cost
            status
          }

In that case it makes reference to the label being valid as opposite to voided.

Let me know if that helps clarify or if there is anything else I could help with.
Thanks again!
Tom

Hi @tomasw

We used old api now we moved on the new api. In the old api order number format is different then new api…so how we can findout the old orders because we need to process the old shipment…

Thanks

Hey @bhautik!
Do you mean the order ID? the order_number should be the same as the one seen on the Rest API or on the UI
Thanks again!
Tom

Hi @tomasw

Yes I am talking about the order ID ? and how we add the order number parameter in get shipment api.

Thanks

In that case you will have to use the ShipHero order ID (to Query for shipments)
Or you could also use the Orders Query, filter by order number and have the shipments connection in there, something like this:

query {
  orders(order_number: "MO176", shop_name: "Manual Order") {
    request_id
    complexity
    data(first: 1) {
      edges {
        node {
          shipments {
            id
            legacy_id
            order_id
            user_id
            warehouse_id
            pending_shipment_id
            address {
              name
              address1
              address2
              city
              state
              country
              zip
              phone
            }
            line_items(first: 10) {
              edges {
                node {
                  line_item_id
                  quantity
                  line_item {
                    product_name
                    sku
                  }
                }
              }
            }
            shipping_labels {
              id
              tracking_number
              carrier
              shipping_name
              shipping_method
              cost
            }
          }
        }
      }
    }
  }
}

Hi

can you please look into this Request : 5f658ee5693a8d7fed97c535

If you can see first or second order In each order three to four line items but we get only one line Items on Shipping labels. can you please tell me what was the wrong.

Thanks in Advance

Hi @tomasw

Order Number : W-614194 , W-611554

Thanks

Hi @tomasw

I found the issue …so no need to check…above query

Thanks

1 Like

Hi @tomasw

I want to update order so we need to pass the same partner line item id which we have used while create order…

can you please provide one example of order_update with line item

Thanks

Hi @tomasw

Everyday we have around one thousand order and we fetch the shipment using from date and to date but after we get the time out error…

200 Response Data : {‘errors’: [{‘code’: 30, ‘message’: ‘There are not enough credits to perfom the requested operation, which requires 1001 credits, but the are only 405 left. In 40 seconds you will have enough credits to perform the operation’, ‘operation’: ‘shipments’, ‘request_id’: ‘5f6dd7f35e80eb5fcf2147cb’, ‘required_credits’: 1001, ‘remaining_credits’: 405, ‘time_remaining’: ‘40 seconds’}], ‘data’: {‘shipments’: None}}>>>>>>

We have get lot’s of pages

can you pls give me best solution to fetch shipment…

Thanks

Hi @tomasw

Is It possible to we get the csv file of shipment between from and to date…

Thanks

Hi @tomasw

Is It possible to get shipment store wise ?

Thanks

Hi @bhautik!

You can get the id’s using this query:

query {
  order(id: "117384888") {
    request_id
    complexity
    data {
      line_items(first: 5) {
        edges {
          node {
            id
          }
        }
      }
    }
  }
}

And then update using the id like this:

mutation {
  order_update_line_items(
    data: {
      order_id: "148853049"
      line_items: { id: "TGluZUl0ZW06NDIyNTg1MTM4", customs_value: "1.00" }
    }
  ) {
    request_id
    complexity
  }
}

You might be missing first filters, but just to be sure, is there any chance you could send a request_id for the Query you are using?

This should be available on the app actually, on the shipment report section https://shipping.shiphero.com/shipments-report

You could use the orders and shop & status filter, something like this:

query {
  orders(shop_name:"yourStoreExample.com	" fulfillment_status:"fulfilled") {
    request_id
    complexity
    data(first: 1) {
      edges {
        node {
          id
          shipments{
            id
          }
        }
      }
    }
  }
}

Hi @tomasw

If we have pass Order Date From, Order Date To, Shop name and fulfillment status on get orders query…

for ex : From Date : 24/09/2020
To Date : 25/09/2020
Fullfillment Status : fullfilled

On 24/09 to 25/09 we have Exported 1000 Orders… But FullFilled only 100 orders so we get 100 order while run query. on 29/09 others orders are fullfilled.

My Question is
how we know that all orders are Fullfilled From 24 to 25…because we need to check Every day any order fullfilled which is order date 24 to 25…

Is It possible to Update your Query add more parameters on Shipments api like we filter shipment shop wise, status and shipment date.

Thanks