# Export Order Through API In Shiphero Getting Forbidden Issue

**URL:** <https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731>\
**Category:** Devs Needed & Available\
**Created:** [September 2, 2020, 2:20pm UTC](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731 "2020-09-02T14:20:24Z")\
**Posts on this page:** 20\
**Page:** 2

<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:** [September 16, 2020, 1:03pm UTC](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731/21 "2020-09-16T13:03:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bhautik](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bhautik](https://community.shiphero.com/u/bhautik)\
**Post date:** [September 16, 2020, 1:09pm UTC](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731/22 "2020-09-16T13:09:53Z")

</div>

Hi

Request ID : 5f620e8a01adc15b24b0f343

Thanks

---

<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:** [September 16, 2020, 1:45pm UTC](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731/23 "2020-09-16T13:45:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bhautik](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bhautik](https://community.shiphero.com/u/bhautik)\
**Post date:** [September 17, 2020, 6:37am UTC](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731/24 "2020-09-17T06:37:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bhautik](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bhautik](https://community.shiphero.com/u/bhautik)\
**Post date:** [September 17, 2020, 11:33am UTC](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731/25 "2020-09-17T11:33:52Z")

</div>

Hello @tomasw

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

---

<div class="post-metadata">

**Author:** ![bhautik](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bhautik](https://community.shiphero.com/u/bhautik)\
**Post date:** [September 17, 2020, 11:43am UTC](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731/26 "2020-09-17T11:43:31Z")

</div>

Hi @tomasw

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

Thanks

---

<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:** [September 17, 2020, 1:13pm UTC](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731/27 "2020-09-17T13:13:31Z")

</div>

Hi @bhautik!

As for:

> [@bhautik](#):
>
> 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…

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)

> [@bhautik](#):
>
> Is there any api to check shipment status Is Fulfilled or not Fulfilled ?

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](https://app.shiphero.com/dashboard/orders/manage) but we don’t have an ETA on when this will be available.

> [@bhautik](#):
>
> What is the meaning of Status:“valid” we get in Shipment Query ?

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

---

<div class="post-metadata">

**Author:** ![bhautik](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bhautik](https://community.shiphero.com/u/bhautik)\
**Post date:** [September 18, 2020, 10:40am UTC](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731/28 "2020-09-18T10:40:52Z")

</div>

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

---

<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:** [September 18, 2020, 12:51pm UTC](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731/29 "2020-09-18T12:51:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bhautik](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bhautik](https://community.shiphero.com/u/bhautik)\
**Post date:** [September 18, 2020, 12:54pm UTC](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731/30 "2020-09-18T12:54:22Z")

</div>

Hi @tomasw

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

Thanks

---

<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:** [September 18, 2020, 5:08pm UTC](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731/31 "2020-09-18T17:08:52Z")

</div>

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
            }
          }
        }
      }
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![bhautik](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bhautik](https://community.shiphero.com/u/bhautik)\
**Post date:** [September 19, 2020, 4:59am UTC](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731/32 "2020-09-19T04:59:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bhautik](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bhautik](https://community.shiphero.com/u/bhautik)\
**Post date:** [September 19, 2020, 5:00am UTC](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731/33 "2020-09-19T05:00:41Z")

</div>

Hi @tomasw

Order Number : W-614194 , W-611554

Thanks

---

<div class="post-metadata">

**Author:** ![bhautik](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bhautik](https://community.shiphero.com/u/bhautik)\
**Post date:** [September 19, 2020, 5:16am UTC](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731/34 "2020-09-19T05:16:08Z")

</div>

Hi @tomasw

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

Thanks

---

<div class="post-metadata">

**Author:** ![bhautik](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bhautik](https://community.shiphero.com/u/bhautik)\
**Post date:** [September 25, 2020, 7:20am UTC](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731/35 "2020-09-25T07:20:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bhautik](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bhautik](https://community.shiphero.com/u/bhautik)\
**Post date:** [September 25, 2020, 11:58am UTC](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731/36 "2020-09-25T11:58:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bhautik](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bhautik](https://community.shiphero.com/u/bhautik)\
**Post date:** [September 25, 2020, 12:02pm UTC](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731/37 "2020-09-25T12:02:48Z")

</div>

Hi @tomasw

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

Thanks

---

<div class="post-metadata">

**Author:** ![bhautik](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bhautik](https://community.shiphero.com/u/bhautik)\
**Post date:** [September 25, 2020, 2:08pm UTC](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731/38 "2020-09-25T14:08:10Z")

</div>

Hi @tomasw

Is It possible to get shipment store wise ?

Thanks

---

<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:** [September 25, 2020, 3:01pm UTC](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731/39 "2020-09-25T15:01:10Z")

</div>

Hi @bhautik!

> [@bhautik](#):
>
> 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

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
  }
}

```

> [@bhautik](#):
>
> 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}}\>\>\>\>\>\>

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?

> [@bhautik](#):
>
> Is It possible to we get the csv file of shipment between from and to date…

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

> [@bhautik](#):
>
> Is It possible to get shipment store wise ?

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
          }
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![bhautik](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bhautik](https://community.shiphero.com/u/bhautik)\
**Post date:** [September 26, 2020, 5:06am UTC](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731/40 "2020-09-26T05:06:14Z")

</div>

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

[Previous page](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731.md?page=1)

[Next page](https://community.shiphero.com/t/export-order-through-api-in-shiphero-getting-forbidden-issue/731.md?page=3)
