I am having trouble updating and adding allocations on a shipment detail. For simple cases, everything is working fine. I am building an integration to a warehouse system, so I am trying to update the shipment with details from the warehouse system about shipped quantities and packages.
I have a detail line that is a kit, so it already has the 3 components connected to it for allocations. If everything shipped in 1 package, then I can update those 3 allocations with the quantity shipped for each, no problem. However, when a line like that is shipped in multiple packages, I need to expand the allocation entries to have 1 for each combination of SKU and package, with the quantity shipped in that specific package.
When I attempt this, the response I get back has more allocation entries in it than what I sent in. If originally there was 3 allocation entries, and I try to update those 3 and add 5 more (total of 8), I get back a response with 11 allocation entries and an error that “the quantity shipped is greater than the quantity allocated”.
I have tried sending in the 8 entries multiple ways:
- without any ids for the allocations
- with ids for the original 3, and no ids for the new 5
- with ids for the original 3 (put those), and then a separate put with the new 5
I am always sending in the InventoryID (SKU), LotSerialNbr, Qty, and UOM. What is the proper way to send complex allocations like this, so that it will update the appropriate allocations, and add the rest? See below for the body sent.
Jim
{
"Details": [
{
"id": "fa94770e-d434-f011-8426-120e4ffdb993",
"Allocations": [
{
"id": "5ab8ad81-a6bf-4302-b0e7-60f53421ffd0",
"InventoryID": {
"value": "SL-10-10"
},
"LotSerialNbr": {
},
"Qty": {
"value": 1
},
"UOM": {
"value": "EA"
}
},
{
"InventoryID": {
"value": "SL-10-10"
},
"LotSerialNbr": {
},
"Qty": {
"value": 2
},
"UOM": {
"value": "EA"
}
},
{
"id": "522db2bd-2ccd-4d88-8698-e338fffc5ebf",
"InventoryID": {
"value": "SL-20-10"
},
"LotSerialNbr": {
},
"Qty": {
"value": 1
},
"UOM": {
"value": "EA"
}
},
{
"InventoryID": {
"value": "SL-20-10"
},
"LotSerialNbr": {
},
"Qty": {
"value": 1
},
"UOM": {
"value": "EA"
}
},
{
"InventoryID": {
"value": "SL-20-10"
},
"LotSerialNbr": {
},
"Qty": {
"value": 1
},
"UOM": {
"value": "EA"
}
},
{
"id": "a91d1de5-fa6b-4638-beae-682f47947419",
"InventoryID": {
"value": "SL-10-20-HT"
},
"LotSerialNbr": {
},
"Qty": {
"value": 2
},
"UOM": {
"value": "EA"
}
},
{
"InventoryID": {
"value": "SL-10-20-HT"
},
"LotSerialNbr": {
},
"Qty": {
"value": 2
},
"UOM": {
"value": "EA"
}
},
{
"InventoryID": {
"value": "SL-10-20-HT"
},
"LotSerialNbr": {
},
"Qty": {
"value": 2
},
"UOM": {
"value": "EA"
}
}
]
}
],
"ShipmentNbr": {
"value": "025477"
}
}
