Adding vendor when creating new product not working

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?

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

@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

@tomasw Thank you, will be waiting for the fix :slight_smile:

@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

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

Also, shouldn’t manufacturer_sku be renamed as vendor_sku?

Thanks

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

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