0 votes
in REST API basic functionality by (120 points)

I have a requirement to add a container delivery job via API to an existing customer. The customer has a Site Order. I have tried a PUT request to the existing order with a new entry in the containers array

{

"Containers": [
    {
        "ContainerTypeListItem": {
            "Description": "240 Litre Bin",
            "Guid": "025737b5-c589-e811-80c2-00155d0aac58"
        },
        "ContainerStateListItem": {
            "Description": "Active",
            "Guid": "766271f1-1401-e811-80c2-00155d8d0455"
        }
    }]

}

This produces an error because the new container entry does not supply a GUID. It seems that the container entity must be created first and then added to the array.

In that case, what entity should I POST to create the Site Order Item (SiteOrder.Containers[] is a list of site order items).

Note: I tried POSTing to /containers but that requires a value to be supplied for a Tag (RFID tag I assume), which would not exist at the time of creating a container delivery job.

Can someone let me know how container jobs should be created via API calls?

1 Answer

0 votes
by (580 points)

This was investigated in the following spike: https://dev.azure.com/amcsgroup/Platform/_workitems/edit/211722
It's not currently possible to add SiteOrderItems to an existing SiteOrder i.e. add a new object to the Containers[] on POST +GUID to integrator/erp/transport/orders/

If you want to allow site order items to be inserted against an existing site order, then raise a change request via NetSuite

Welcome to AMCS PLATFORM REST API Q&A, where you can ask questions and receive answers from other members of the community.
...