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?