Add Order Products to an Existing Order

Here’s an example of a PATCH request using the Order resource to add order products to an existing order.

Example usage 

1/services/data/v30.0/commerce/sale/order/801D0000000Frh8

Example request body 

1{
2    "order": [
3        {
4            "attributes": {
5                "type": "Order"
6            },
7            "Id":"801D0000000Frh8",
8            "OrderItems": {
9                "records": [
10                    {
11                        "attributes": {
12                            "type": "OrderItem"
13                        },
14                        "PricebookEntryId": "01uD0000001cCd1",
15                        "quantity": "1",
16                        "UnitPrice": "100",
17                        "orderId": "801D0000000Frh8"
18                    },
19                    {
20                        "attributes": {
21                            "type": "OrderItem"
22                        },
23                        "PricebookEntryId": "01uD0000001cCd1",
24                        "quantity": "2",
25                        "UnitPrice": "200",
26                        "orderId": "801D0000000Frh8"
27                    }
28                ]
29            }
30        }
31    ]
32}

Example JSON response body 

1{
2  "totalSize" : 1,
3  "done" : true,
4  "records" : [ {
5    "attributes" : {
6      "type" : "Order"
7    },
8    "OrderItems" : {
9      "totalSize" : 2,
10      "done" : true,
11      "records" : [ {
12        "attributes" : {
13          "type" : "OrderItem",
14          "url" : "/services/data/v30.0/sobjects/OrderItem/802D0000000CJtMIAW"
15        },
16        "Id" : "802D0000000CJtMIAW"
17      }, {
18        "attributes" : {
19          "type" : "OrderItem",
20          "url" : "/services/data/v30.0/sobjects/OrderItem/802D0000000CJtNIAW"
21        },
22        "Id" : "802D0000000CJtNIAW"
23      } ]
24    }
25  } ]
26}