# Adding vendor when creating new product not working

**URL:** <https://community.shiphero.com/t/adding-vendor-when-creating-new-product-not-working/248>\
**Category:** GraphQL API\
**Created:** [November 28, 2019, 9:09pm UTC](https://community.shiphero.com/t/adding-vendor-when-creating-new-product-not-working/248 "2019-11-28T21:09:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![luispora](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/luispora/32/81_2.png) [@luispora](https://community.shiphero.com/u/luispora)\
**Post date:** [November 28, 2019, 9:09pm UTC](https://community.shiphero.com/t/adding-vendor-when-creating-new-product-not-working/248/1 "2019-11-28T21:09:47Z")

</div>

Hello,

I am adding a product with the following mutation:

mutation {  
product\_create(  
data: {  
name: “glass chair1”  
sku: “123glasschair22”  
warehouse\_products: {  
warehouse\_id: “V2FyZWhvdXNlOjEwNjkx”  
price: “43.00”  
on\_hand: 130  
inventory\_bin: “Bin A1”  
}  
dimensions: { weight: “12”, height: “25”, width: “10”, length: “25” }  
tags: “chair”  
vendors: [  
{  
vendor\_id: “VmVuZG9yOjE2Njc0Mw==”  
vendor\_sku: “SKUChair22”  
}  
]  
}  
) {  
request\_id  
complexity  
product {  
id  
legacy\_id  
account\_id  
name  
sku  
price  
value  
warehouse\_products {  
warehouse\_id  
price  
value  
on\_hand  
inventory\_bin  
reserve\_inventory  
replenishment\_level  
reorder\_level  
reorder\_amount  
custom  
}  
barcode  
country\_of\_manufacture  
dimensions {  
weight  
height  
width  
length  
}  
tariff\_code  
value\_currency  
kit  
kit\_build  
no\_air  
final\_sale  
customs\_value  
customs\_description  
not\_owned  
dropship  
vendors {  
vendor\_id  
}  
created\_at  
}  
}  
}

And I get the following response:

{  
“data”: {  
“product\_create”: {  
“request\_id”: “5de0350f5c79e0a7306a2c7c”,  
“complexity”: 10,  
“product”: {  
“id”: “UHJvZHVjdEluZm86MjY4NzM1OTUz”,  
“legacy\_id”: 268735953,  
“account\_id”: “QWNjb3VudDo1Njk3”,  
“name”: “glass chair1”,  
“sku”: “123glasschair22”,  
“price”: null,  
“value”: null,  
“warehouse\_products”: [  
{  
“warehouse\_id”: “V2FyZWhvdXNlOjEwNjkx”,  
“price”: “43.0000”,  
“value”: “0.0000”,  
“on\_hand”: 130,  
“inventory\_bin”: “Bin A1”,  
“reserve\_inventory”: 0,  
“replenishment\_level”: 0,  
“reorder\_level”: 0,  
“reorder\_amount”: 1,  
“custom”: false  
}  
],  
“barcode”: “270098925”,  
“country\_of\_manufacture”: “US”,  
“dimensions”: {  
“weight”: “12.0000 lb”,  
“height”: “25.00 inch”,  
“width”: “10.00 inch”,  
“length”: “25.00 inch”  
},  
“tariff\_code”: “0”,  
“value\_currency”: null,  
“kit”: false,  
“kit\_build”: false,  
“no\_air”: false,  
“final\_sale”: false,  
“customs\_value”: “0.0000”,  
“customs\_description”: null,  
“not\_owned”: false,  
“dropship”: false,  
“vendors”: [  
{  
“vendor\_id”: “VmVuZG9yUHJvZHVjdDoyOTIwNTI3MDU=”  
}  
],  
“created\_at”: “2019-11-28T20:58:56+00:00”  
}  
}  
}  
}

The first thing I notice is taht the vendor\_id on the response doesn’t match the one i sent on the mutation (it should be the same because i want to add the product to that vendor and that is the id of the vendor in my account).

Second,thing i notice in my dashboard there is no vendor assigned to that product and if i check my vendor it doesn’t have the product assigned.

On the other hand, if i assign the product to the vendor with this mutation (once both are created) it works:

mutation {  
vendor\_add\_product(  
data: {  
vendor\_id: “VmVuZG9yOjE2Njc0Mw==”,  
sku: “123glasschair22”,  
manufacturer\_sku: “manuskuthing”,  
price: “43.00”  
}  
) {  
request\_id  
complexity  
}  
}

So, it seems that we cannot add products to vendors when we create them. Is this the intended behaviour or there is something that I am missing?

---

<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:** [November 30, 2019, 2:10pm UTC](https://community.shiphero.com/t/adding-vendor-when-creating-new-product-not-working/248/2 "2019-11-30T14:10:11Z")

</div>

HI @luispora!  
It looks like in your account you have only one vendor created under “name”: “vendor1”  
And has the vendor\_id: “VmVuZG9yOjE2Njc0Mw==” .  
I couldn’t find any other vendors, so “vendor\_id”: “VmVuZG9yUHJvZHVjdDoyOTIwNTI3MDU=” is an invalid one, at least for that account.  
This mutation will not create a new vendor, it will only allow you to assign the product created to existing vendors.  
Hope this helps!, but let me know if I can assist you with anything else,  
Thanks!  
Tom

---

<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:** [November 30, 2019, 2:52pm UTC](https://community.shiphero.com/t/adding-vendor-when-creating-new-product-not-working/248/3 "2019-11-30T14:52:47Z")

</div>

@luispora  
I just realized I misunderstood your request, sorry about that.  
A fix for this will be implemented shortly. I will let you know as soon as this is solved.  
Thanks again!  
Tom

---

<div class="post-metadata">

**Author:** ![luispora](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/luispora/32/81_2.png) [@luispora](https://community.shiphero.com/u/luispora)\
**Post date:** [December 2, 2019, 4:42pm UTC](https://community.shiphero.com/t/adding-vendor-when-creating-new-product-not-working/248/4 "2019-12-02T16:42:36Z")

</div>

@tomasw Thank you, will be waiting for the fix 🙂

---

<div class="post-metadata">

**Author:** ![luispora](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/luispora/32/81_2.png) [@luispora](https://community.shiphero.com/u/luispora)\
**Post date:** [December 2, 2019, 6:08pm UTC](https://community.shiphero.com/t/adding-vendor-when-creating-new-product-not-working/248/5 "2019-12-02T18:08:20Z")

</div>

@tomasw also noticed something on the mutation fields for this situation;

On the CraeteProduct mutation we have this part:

.  
.  
.  
vendors: [  
{  
vendor\_id: “VmVuZG9yOjE2Njc0Mw==”  
vendor\_sku: “SKUChair22”  
}  
.  
.

We cannot add the price on this mutation, but we can add it on the vendor\_add\_product mutation

> [@luispora](#):
>
> mutation {  
> vendor\_add\_product(  
> data: {  
> vendor\_id: “VmVuZG9yOjE2Njc0Mw==”,  
> sku: “123glasschair22”,  
> manufacturer\_sku: “manuskuthing”,  
> price: “43.00”  
> }  
> ) {  
> request\_id  
> complexity  
> }  
> }

Can we have the price field on the create product too?

Also, shouldn’t manufacturer\_sku be renamed as vendor\_sku?

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:** [December 4, 2019, 6:05pm UTC](https://community.shiphero.com/t/adding-vendor-when-creating-new-product-not-working/248/6 "2019-12-04T18:05:55Z")

</div>

Hi @luispora !

The issue for sending the `vendor_id` on the `product_create` mutation should be resolved by now.  
Our engineers also added `price` there.

As for changing the `manufacturer_sku` to `vendor_sku` I’ll keep it in mind so we can change it shortly as well.

Let me know if there’s anything else I can help you with.  
Thanks!  
Tom

---

<div class="post-metadata">

**Author:** ![luispora](https://sea2.discourse-cdn.com/flex020/user_avatar/community.shiphero.com/luispora/32/81_2.png) [@luispora](https://community.shiphero.com/u/luispora)\
**Post date:** [December 12, 2019, 5:01pm UTC](https://community.shiphero.com/t/adding-vendor-when-creating-new-product-not-working/248/7 "2019-12-12T17:01:21Z")

</div>

Thanks @tomasw will keep in touch if something else pops up
