Skip to main content
Answer

REST saving multiple PackageContents in single PUT call

  • July 17, 2025
  • 6 replies
  • 98 views

Forum|alt.badge.img

I want to be able to save multiple PackageContents for an SOShipment in a single API call, but I’m getting odd results.

 

I have the following Body for my PUT REST API request

{
"Packages": [
{
"PackageContents": [
{
"ShipmentSplitLineNbr": {
"value": 11
},
"Canister": {
"value": 8
},
"Position": {
"value": "Bottom"
}
},
{
"ShipmentSplitLineNbr": {
"value": 17
},
"Canister": {
"value": 8
},
"Position": {
"value": "Bottom"
}
},
{
"ShipmentSplitLineNbr": {
"value": 19
},
"Canister": {
"value": 8
},
"Position": {
"value": "Bottom"
}
}
],
"LineNbr": {
"value": 1
}
}
],
"ShipmentNbr": {
"value": "000054188"
}
}

 

For some reason, this saves ShipmentSplitLineNbr 11 and 17, but does not save 19.  However, if I re-order the nodes so that 19, 11, 17 then it saves 19, but does not save 11 and 17.

Is it possible to save multiple PackageContents in a single REST API call?

Best answer by VidhyaHari

@sclassing Based on my understanding and testing, by default, this should work. But, I do see some custom fields being sent as part of the request. So, I suspect that some customization might be doing something. It would be helpful if you can provide more details about the same or create a Support case to investigate this further. Thanks for understanding. 

6 replies

Tony Lanzer
Pro III
Forum|alt.badge.img+2
  • Pro III
  • July 18, 2025

Any errors in the response?


Forum|alt.badge.img
  • Author
  • Freshman II
  • July 18, 2025

No, no errors.  Can you confirm that Acumatica is designed to pack multiple PackageContents at a time?  Am I just trying something that’s not supported?


Tony Lanzer
Pro III
Forum|alt.badge.img+2
  • Pro III
  • July 18, 2025

A collection being sent in a request is supported in general. If you don’t get an error response, what does the response look like?  If you’re doing an insert or update, make sure you are passing the appropriate key fields and values. Make sure you can perform the same insert/update with the same values from the UI.


Forum|alt.badge.img
  • Author
  • Freshman II
  • July 21, 2025

Thanks, Tony.  This seems to be something deeper.  The response appears normal, just missing the unpacked line items with no errors indicated.  I’ve double-checked and the keys being passed are correct as well.

I just tried and I am able to perform the operation via the UI - entering all 3 Package Contents and then saving works correctly.

This seems to be something only related to the REST API.  We are capturing the SOShipLineSplitPackage inside SOShipmentEntryExt.

protected void _(Events.RowPersisting<SOShipLineSplitPackage> e, PXRowPersisting del)

Setting a breakpoint there, we are seeing that RowPersisting only gets called 1 time with the one line item that will be packed.  We would expect this to be called 3 times, one for each of the PackageContents, but it’s only called for the single line item being packed.

It seems like something in the plumbing is dropping or skipping some of the PackageContents.  They are in the JSON, but by the time they get to RowPersisting, they are gone.


Forum|alt.badge.img+1
  • Acumatica Moderator
  • Answer
  • September 10, 2025

@sclassing Based on my understanding and testing, by default, this should work. But, I do see some custom fields being sent as part of the request. So, I suspect that some customization might be doing something. It would be helpful if you can provide more details about the same or create a Support case to investigate this further. Thanks for understanding. 


Forum|alt.badge.img
  • Author
  • Freshman II
  • September 10, 2025

Hi ​@VidhyaHari - thanks so much for the reply.  You are indeed correct - the issue involved some logic within some of our custom fields.  We’ve figured it out - and I guess I should have marked this as answered!  Thanks again for your response.