How to add new line to existing sop_order ?

SOLVED

So from the Sage200 Extra documentation I can create a new SOP with an array of lines by submitting a POST request to {{URL}}/sop_orders . I can update existing lines using a PUT request to the url {{URL}}/sop_orders/id . I can delete a line by added "is_to_delete": True to the line object to an PUT request on the order.

https://developer.columbus.sage.com/docs#/uk/sage200extra/accounts/v1/sop_settings

I am totally stuck on how to add a new line to an existing SOP. If I do a PUT request to {{URL}}/sop_orders/id  with new element to the lines object with an empty id it fails.

https://developer.columbus.sage.com/docs#/uk/sage200extra/accounts/v1/sop_order_lines

The sop_order_lines request seems to only support GET not POST.

Is anybody able to point me in the right direction?

  • 0

    We are on the same boat. Does anyone know how to add a line item to an existing sop_order (not dispatched, not invoiced - still editable) please?

  • +1 in reply to Mehmet Sesen
    verified answer

    I got the below response from Sage Developer Services. It's not documented but you need to set the id to 0 for the news lines. 

    The following JSON shows what you need to add a line to an existing sales order. In essence the id field needs to be passed in but set to zero so it gets the next id for you :

     

    {

        "lines": [

            {

                "id": 0,

                "line_type": "EnumLineTypeFreeText",

                "description": "Some different text",

                "line_quantity": 2,

                "selling_unit_price": 10.00

            }

        ]

    }

  • 0 in reply to Gabriel Woodger

    Thank you for the prompt reply Gabriel. I have actually tried passing 0 as the "id" value for the new line item, but I keep getting the following response: 

    "Message": "SOPOrderReturnLine not found for Id: 0"

    I'll double check things on our end.