Hi dear community,
I am trying to add a warehouse product (for an existing product) with the property onHand
= 0, but the API keeps returning an error.
Why does the ShipHero system forbid to provision a product to a warehouse without inventory (onHand
= 0) via the method product_add_to_warehouse
whereas this very same provision is allowed via the method product_create
?
product_add_to_warehouse Query:
mutation {
product_add_to_warehouse(data: {
sku: "CHAIR12348"
warehouse_id: "V2FyZWhvdXNlOjExMzk3"
on_hand: 0
}) {
request_id
complexity
warehouse_product {
id
warehouse_id
warehouse_identifier
}
}
}
product_add_to_warehouse Response:
{
"errors": [
{
"message": "Unexpected Error",
"operation": "product_add_to_warehouse",
"field": "product_add_to_warehouse",
"request_id": "5e187ba578a1a03de0211c17",
"code": 22
}
],
"data": {
"product_add_to_warehouse": null
}
}
product_create Query:
mutation {
product_create(
data: {
name: "wood chair"
sku: "CHAIR12350"
price: "25.00"
warehouse_products: {
warehouse_id: "V2FyZWhvdXNlOjExMjg4"
on_hand: 0
inventory_bin: "Bin A1"
reserve_inventory: 0
replenishment_level: 1
reorder_level: 1
reorder_amount: 20
custom: false
}
value: "15.00"
barcode: "2233443356chair"
country_of_manufacture: "US"
dimensions: { weight: "12", height: "25", width: "10", length: "25" }
kit: false
kit_build: false
no_air: false
final_sale: false
customs_value: "1.00"
not_owned: true
dropship: false
}
)
{
request_id
complexity
product {
id
sku
}
}
}
product_create Response:
{
"data": {
"product_create": {
"request_id": "5e187e72ac5c3f6a80cf9652",
"complexity": 10,
"product": {
"id": "UHJvZHVjdEluZm86MjY5MTY4NjA5",
"sku": "CHAIR12350"
}
}
}
}