Inventory mutation

Hi there, we are trying to replace a location with other content and we’re getting this error “Invalid id” for the location after executing the following query:

mutation {
	inventory_replace(
		data: {
			customer_account_id: "67514",
			location_id: "02-B-M11-N6-B5-P1",
			quantity: 5,
			reason: "Reason for changing inventory",
			sku: "AMA-MIXCAM-12PZ",
			warehouse_id: "V2FyZWhvdXNlOjgyNTg1"
		}
	) {
		complexity
		warehouse_product {
			legacy_id
			on_hand
			inventory_bin
			inventory_overstock_bin
			allocated
		}
	}
}
{
	"errors": [
		{
			"message": "Invalid id 02-B-M11-N6-B5-P1",
			"operation": "inventory_replace",
			"field": "inventory_replace",
			"request_id": "62a8ab444cbf427953eac72b",
			"code": 3
		}
	],
	"data": {
		"inventory_replace": null
	}
}

I think we’re putting the name instead of the id:

query {
   location(name: "02-B-M11-N6-B5-P1") { 
		request_id
    complexity 
		data {id, name, pickable}
	}
}

Hello @Jose!

Yes, you’re right, that was the name you were sending in your first post.

The correct value is the ID you are querying in your second post.

Have a great day!
TomasFD

1 Like