# Errors being received

**URL:** <https://community.shiphero.com/t/errors-being-received/128>\
**Category:** GraphQL API\
**Created:** [September 16, 2019, 3:40pm UTC](https://community.shiphero.com/t/errors-being-received/128 "2019-09-16T15:40:39Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![varun](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@varun](https://community.shiphero.com/u/varun)\
**Post date:** [September 16, 2019, 3:40pm UTC](https://community.shiphero.com/t/errors-being-received/128/1 "2019-09-16T15:40:39Z")

</div>

I’m trying to update orders through the API.  
[https://shipheropublic.docs.apiary.io/#reference/orders/update-order/update-order](https://shipheropublic.docs.apiary.io/#reference/orders/update-order/update-order)

However, every time I make a request to ShipHero api I receive an error.

{  
“order\_id”: 0,  
“message”: “Error updating order”,  
“code”: 200,  
“response”: “KeyError(‘order\_id’,)”  
}

This is the payload we are sending to update order endpoint.

{  
“token”: “{{shipHeroApiKey}}”,  
“order\_id”: “104430562”, //shiphero order id  
“shipping\_address”: {  
“province”: “United States”,  
“province\_code”: “US”,  
“city”: “Wilmington”,  
“first\_name”: “BenTEST”,  
“last\_name”: “Adams”,  
“zip”: “Delaware”,  
“country”: “DE”,  
“company”: “Advoc8”,  
“phone”: “817-549-8352”,  
“country\_code”: “19804”,  
“address1”: “1620 East Ayre Str”,  
“address2”: “SUITE #M5318394”  
}  
}

Also tried to send instead of `shiphero order id` =\> `shiphero order number` using rv\_ord\_BYE1Pft6bk365 but i still receive the same error.

Any ideas?

Also, regarding webhooks. We’ve registered two webhooks.

“Inventory Update” and “Shipment Update”

{  
“Message”: “success”,  
“code”: “200”,  
“webhooks”: [  
{  
“url”: “{host}/shiphero/inventory\_update”,  
“source”: “api”,  
“name”: “Inventory Update”  
},  
{  
“url”: “{host}/shiphero/shipment\_update”,  
“source”: “api”,  
“name”: “Shipment Update”  
}  
]  
}

However, when `account_id` (3pl account id) is added, on Order and product create (API) I’m receiving “Inventory Update” but with empty body if we don’t add it to the payload.

When are webhooks triggered? Any idea whats wrong here?

Help is REALLY appreciated.

---

<div class="post-metadata">

**Author:** ![yosef](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/yosef/32/9_2.png) [@yosef](https://community.shiphero.com/u/yosef)\
**Post date:** [September 16, 2019, 5:49pm UTC](https://community.shiphero.com/t/errors-being-received/128/2 "2019-09-16T17:49:41Z")

</div>

A few things:  
API calls in the legacy API need to be made from the client account. I see you only have a key associated with the 3pl account, that won’t work.

If you are using the ShipHero id, use shiphero\_id as the field name. Otherwise if you use the order\_id or order\_number (in this case, both are rv\_ord\_BYE1Pft6bk365) the shiop\_name of the order needs to match the Shop Name of the API key.

Webhooks need to be registered in the client account.

---

<div class="post-metadata">

**Author:** ![varun](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@varun](https://community.shiphero.com/u/varun)\
**Post date:** [September 18, 2019, 6:23pm UTC](https://community.shiphero.com/t/errors-being-received/128/3 "2019-09-18T18:23:52Z")

</div>

Thank you, will try that and get back.

---

<div class="post-metadata">

**Author:** ![varun](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@varun](https://community.shiphero.com/u/varun)\
**Post date:** [October 28, 2019, 9:58am UTC](https://community.shiphero.com/t/errors-being-received/128/4 "2019-10-28T09:58:10Z")

</div>

Hi @yosef,  
I generated a new API key in client account  
[https://nimb.ws/jaIoQr](https://nimb.ws/jaIoQr)  
I registered two webhooks with this key  
`Inventory Update` and `Shipment Update`  
[https://nimb.ws/DlmiTZ](https://nimb.ws/DlmiTZ)  
But I’m receiving an empty body webhook  
[https://nimb.ws/hjVruL](https://nimb.ws/hjVruL)

Did I registered webhooks right?  
Any idea whats wrong here?

Thanks.

---

<div class="post-metadata">

**Author:** ![varun](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@varun](https://community.shiphero.com/u/varun)\
**Post date:** [October 29, 2019, 8:54am UTC](https://community.shiphero.com/t/errors-being-received/128/6 "2019-10-29T08:54:46Z")

</div>

Hi @adam,  
Thank you for your quick reply.  
So, I’m trying to receive the webhooks mentioned above.  
Here is a video, of what I’m doing, and how I receive webhooks:  
1.`Inventory Update`[https://nimb.ws/wRD7rJ](https://nimb.ws/wRD7rJ)  
as you can see, when I change some product fields, shiphero sent an request but with empty body.

2.`Shipment Update` [https://nimb.ws/ULtERs](https://nimb.ws/ULtERs)  
same as `inventory update`, I receive an empty request, but its triggered only when we create label for order, is it right?  
[https://nimb.ws/5h9coE](https://nimb.ws/5h9coE)

Thanks.

---

<div class="post-metadata">

**Author:** ![yosef](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/yosef/32/9_2.png) [@yosef](https://community.shiphero.com/u/yosef)\
**Post date:** [October 29, 2019, 1:36pm UTC](https://community.shiphero.com/t/errors-being-received/128/7 "2019-10-29T13:36:05Z")

</div>

@varun For the shipment update, try shipping the order from Endeavour (click on the “Pick Pack & Ship” button on the upper right.

Do you have the actual request being received? I see you have a program running that is showing it, but I’d like to see the full request body along with the headers if possible. I’ve tested the webhooks and I’m seeing data.

---

<div class="post-metadata">

**Author:** ![varun](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@varun](https://community.shiphero.com/u/varun)\
**Post date:** [October 29, 2019, 2:38pm UTC](https://community.shiphero.com/t/errors-being-received/128/8 "2019-10-29T14:38:58Z")

</div>

Hi @yosef,  
At the beginning I tried to create orders through `Legacy API`  
The orders were created and I was able to see them in Endeavour dashboard.  
[https://nimb.ws/caSdzW](https://nimb.ws/caSdzW)

After I changed implementation to GraphQl, orders don’t appear anymore in Endeavour dashboard and I’m not really sure why.

If orders don’t appear in Endeavour dashboard does it mean I’m doing something wrong?

this is my Mutation for Order Create

```
mutation CreateOrder(){
  order_create(
    data: {
      customer_account_id: "QWNjb3VudDo0ODc2"
      order_number: "test-sku-32"
      shop_name: "Dashboard"
      fulfillment_status: "Default"
      order_date: "19-09-19"
      shipping_lines: {
        title: "UPS 3 Day Select"
        price: "0.0"
        method: "UPS"
        carrier: "USPS"
      }
      shipping_address: {
        first_name: "Ben"
        last_name: "Adams"
        address1: "1620 East Ayre Str"
        city: "Wilmington"
        state: "Delaware"
        state_code: "DE"
        zip: "19804"
        country: "United States"
        country_code: "US"
      }
      line_items:[
        {
        sku: "test-sku-3"
        partner_line_item_id: "rv_ord_BYE1Pft6bk3q8yVUr5kC1PQ1y2"
        quantity: 1
        price: "1.00"
        warehouse_id: "V2FyZWhvdXNlOjkxMDI="
      	}
      ]
      email: "smth@example.com"
    }
  ){
    order{
      id
      order_number
    }
  }
}

```

Not really sure what you meant by `the full request body`  
`Inventory update`  
Body: {}  
Header: `{ "host": "advoc-dev-917790355.us-east-1.elb.amazonaws.com", "accept": "*/*", "accept-encoding": "gzip, deflate", "user-agent": "python-requests/2.20.0", "x-forwarded-for": "54.158.254.66", "x-forwarded-port": "80", "x-forwarded-proto": "http", "content-length": "133", "connection": "keep-alive" }`

`Shipment update`  
Body: {}  
Header: `{ "host": "advoc-dev-917790355.us-east-1.elb.amazonaws.com", "accept": "*/*", "accept-encoding": "gzip, deflate", "user-agent": "python-requests/2.9.1", "x-forwarded-for": "54.158.254.66", "x-forwarded-port": "80", "x-forwarded-proto": "http", "content-length": "508", "connection": "keep-alive" }`

---

<div class="post-metadata">

**Author:** ![yosef](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/yosef/32/9_2.png) [@yosef](https://community.shiphero.com/u/yosef)\
**Post date:** [October 29, 2019, 4:18pm UTC](https://community.shiphero.com/t/errors-being-received/128/9 "2019-10-29T16:18:51Z")

</div>

I temporarily changed the webhook url and made an inventory change - see the request:  
[http://requestbin.net/r/1l64i8j1?inspect](http://requestbin.net/r/1l64i8j1?inspect)  
The body is being sent.

I’ve asked @tomasw to help out with the GraplQL question - he’s going to take a look and get back to you.

---

<div class="post-metadata">

**Author:** ![varun](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@varun](https://community.shiphero.com/u/varun)\
**Post date:** [October 30, 2019, 8:46am UTC](https://community.shiphero.com/t/errors-being-received/128/10 "2019-10-30T08:46:09Z")

</div>

Hi @yosef,  
Thank you very much for help, I finally understood what is the problem.  
Our Express application wasn’t setup to receive raw body request ((  
I didn’t thought about it until you sent requestbin url,  
I expected to receive `application/json`.  
I think this could be mentioned in documentation for `webhooks`

@tomasw  
I would be grateful for any 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:** [October 30, 2019, 11:35am UTC](https://community.shiphero.com/t/errors-being-received/128/11 "2019-10-30T11:35:39Z")

</div>

Hi @varun!  
The engineering team just did a fix for this, it should be working now.  
Keep in mind that the `partner_line_item_id` should be unique for each item.  
Please let me know if you are still experiencing any issues with it.  
Thanks!

---

<div class="post-metadata">

**Author:** ![varun](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@varun](https://community.shiphero.com/u/varun)\
**Post date:** [October 30, 2019, 12:29pm UTC](https://community.shiphero.com/t/errors-being-received/128/12 "2019-10-30T12:29:33Z")

</div>

Hi @tomasw  
Thank you for your quick reply.  
I still can’t see orders created with GraphQl in Endeavour dashboard.  
In order to test it I created a new order.  
I’ve used mutation above, just changed value for some fields

This is response form shiphero

```
{
  "data": {
    "order_create": {
      "request_id": "5db97e79bc4a30e1f12b5e6d",
      "order": {
        "id": "T3JkZXI6MTA3NTUzNjQw",
        "order_number": "test-sku-43"
      }
    }
  }
}

```

[https://nimb.ws/eVzXm6](https://nimb.ws/eVzXm6)  
As you can see this order is listed in shiphero orders page,  
but it’s not listed in `Endeavour dashboard`  
[https://nimb.ws/KRhiwu](https://nimb.ws/KRhiwu)

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:** [October 30, 2019, 7:31pm UTC](https://community.shiphero.com/t/errors-being-received/128/13 "2019-10-30T19:31:07Z")

</div>

Hi Varun!  
I apologize for that, we had to make another fix for it. I just tested and its working for me.  
You can try now and let me know if its still giving you trouble!  
Thanks again for the patience,  
Tom

---

<div class="post-metadata">

**Author:** ![varun](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@varun](https://community.shiphero.com/u/varun)\
**Post date:** [October 31, 2019, 11:01am UTC](https://community.shiphero.com/t/errors-being-received/128/14 "2019-10-31T11:01:40Z")

</div>

Hi @tomasw,  
Unfortunately, the orders I create not appear in `Endeavour dashboard`  
Does my mutation for creating orders is right? (the above one)  
Maybe I’m not sending some fields or maybe I’m sending some wrong values…  
Could you send your mutation for Order Create which worked for you?

Not sure why but when I created orders through the Legacy API  
I was able to click on product sku [https://nimb.ws/d54k1Y](https://nimb.ws/d54k1Y)  
For Orders created through GraphQL API, sku is not anymore a link  
[https://nimb.ws/48yEW0](https://nimb.ws/48yEW0) even if we have this product [https://nimb.ws/9x3KA6](https://nimb.ws/9x3KA6)  
Is it ok?

One more question is How many requests I can do through GraphQL in short period of time?

I’m trying to create multiple orders almost at the same time,  
even if I still have `credits` and I have a 5 seconds time out between requests I’m receiving this error

```
{
  "response": {
    "error": "{\"message\": \"Too Many Requests\"}",
    "status": 429
  },
  "request": {
    "query": "*order_create_mutation*"
  }
}

```

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:** [October 31, 2019, 2:11pm UTC](https://community.shiphero.com/t/errors-being-received/128/15 "2019-10-31T14:11:41Z")

</div>

I apologize for this back and forth @varun! We’ve been experiencing some issues lately.

You should be able to do it now, and the mutation should look something like this (this worked for me):

```
mutation {
  order_create(
    data: {
      order_number: "Order1234"
      order_date: "2019-10-31"
      shipping_address: {
    first_name: "Ben"
    last_name: "Adams"
    address1: "1620 East Ayre Str"
    city: "Wilmington"
    state: "Delaware"
    state_code: "DE"
    zip: "19804"
    country: "United States"
    country_code: "US"
  }
      line_items: [
        {
          sku: "SKU1234"
          product_name: "TEST-SKU"
          quantity: 1
          price: "0.00"
          partner_line_item_id: "50753951"
          fulfillment_status: "pending"
        }
      ]
      shipping_lines: {
        method: "Parcel Plus Expedited"
        carrier: "DHL eCommerce"
        price: "0.00"
        title: ""
      }
      profile: "Manual Orders"
      customer_account_id:"QWNjb3VudDoINTA0"
    }
  )
{
  request_id
  complexity
  order{
    id
    legacy_id
    order_number
    partner_order_id
    shop_name
    fulfillment_status
    order_date
    total_tax
    subtotal
    total_discounts
    total_price
    auto_print_return_label
    custom_invoice_url
    account_id
  }
}}

```

Let me know if you can create it successfully, and if not, send the order\_id created, and I’ll take another look at it.  
Thanks again for the patience!  
Tom

---

<div class="post-metadata">

**Author:** ![varun](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@varun](https://community.shiphero.com/u/varun)\
**Post date:** [October 31, 2019, 2:44pm UTC](https://community.shiphero.com/t/errors-being-received/128/16 "2019-10-31T14:44:14Z")

</div>

Hi @tomasw,  
I just tried the mutation, looks like It’s working now  
[https://nimb.ws/2MROQK](https://nimb.ws/2MROQK)  
Thank you very much!!!

What about SKU and `Too Many Requests` error (I asked about it above)?  
or It will be better to create a new topic for them?

---

<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:** [October 31, 2019, 2:53pm UTC](https://community.shiphero.com/t/errors-being-received/128/17 "2019-10-31T14:53:41Z")

</div>

Great! I’m glad it worked

That looks like an error from auth0, by any chance are you requesting tokens frequently on a loop or something like that?

---

<div class="post-metadata">

**Author:** ![varun](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@varun](https://community.shiphero.com/u/varun)\
**Post date:** [November 1, 2019, 11:00am UTC](https://community.shiphero.com/t/errors-being-received/128/18 "2019-11-01T11:00:26Z")

</div>

HI @yosef,  
Not sure if it’s a issue or not,  
When I Print Packing Slip & Label from `Endeavour dashboard`  
order become fulfilled but I don’t receive webhook.  
When I ship Order from app dashboard I receive it.  
[https://nimb.ws/HhzVcA](https://nimb.ws/HhzVcA)

---

<div class="post-metadata">

**Author:** ![Christophe](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@Christophe](https://community.shiphero.com/u/Christophe)\
**Post date:** [May 28, 2020, 6:15pm UTC](https://community.shiphero.com/t/errors-being-received/128/19 "2020-05-28T18:15:01Z")

</div>

HI,  
I’m a little bit late on the conversation but really interested in knowing a little bit more on how you fixed this issue. I have been having the same issue as @varun on the inventory update.

![image](https://us1.discourse-cdn.com/flex020/uploads/shiphero/original/1X/d0e5d28c8a2477b6d81ad13961c0e5c356f1592b.png)
