Add an Order to an Existing Account

Here’s an example of a POST request using the Create Order resource to create an order with order products for an existing account.

Example usage 

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

Example request body 

1{
2   "order": [
3   {
4      "attributes": {
5      "type": "Order"
6      },
7      "EffectiveDate": "2013-07-11",
8      "Status": "Draft",
9      "billingCity": "SFO-Inside-OrderEntity-1",
10      "accountId": "001D000000JRDAv",
11      "Pricebook2Id": "01sD0000000G2NjIAK",
12      "OrderItems": {
13         "records": [
14            {
15            "attributes": {
16               "type": "OrderItem"
17            },
18            "PricebookEntryId": "01uD0000001c5toIAA",
19            "quantity": "1",
20            "UnitPrice": "15.99"
21            }
22         ]
23      }
24   }
25   ]
26}

Example JSON response body 

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