Place Order REST API Developer Guide
Requirements and Limitations
Authorization Through External Client Apps or Connected Apps and OAuth 2.0
Create Contract-based Orders
Contract-based Orders
Create Order
Order
Previous Versions
Use this resource to add one or more new order products and custom object records to an existing order or to retrieve data for a specific order.
You can only PATCH one order at a time.
If available, GET method retrieves the orders’ child order products and custom objects under the order or order products.
URI
1/services/data/API_VERSION/commerce/sale/order/ORDER_IDWhere API_VERSION and ORDER_ID are variables.
For retrieving filtered data:
1/services/data/API_VERSION/commerce/sale/order/ORDER_ID?order.orderItems.FIELD_NAME=VALUEWhere API_VERSION, ORDER_ID, FIELD_NAME and VALUE are variables.
Available since release
30.0
Formats
JSON
HTTP methods
POST
| Property | Type | Description | Since Version |
|---|---|---|---|
attributes | Attributes | Type and URL of the order. | 30.0 |
OrderItems | Order Products | Child order products of the new order. | 30.0 |
CUSTOM_OBJECT__r | Custom Object | Child custom object records of the new order. | 30.0 |
| Property | Type | Description | Since Version |
|---|---|---|---|
type | String | Format of the resource. | 30.0 |
| Property | Type | Description | Since Version |
|---|---|---|---|
attributes | Attributes | Type and URL of the order product. | 30.0 |
PricebookEntryId | String | Unique record identifier for the associated price book entry. | 30.0 |
quantity | Number | Number of units of the order product. | 30.0 |
UnitPrice | Currency | The unit price for the order product. | 30.0 |
orderId | String | Unique record identifier for the parent order. | 30.0 |
Id | String | Unique order product identifier. | 30.0 |
| Property | Type | Description | Since Version |
|---|---|---|---|
attributes | Attributes | Type and URL of the custom object. | 30.0 |
Id | String | Unique custom object identifier. | 30.0 |
You can use parameters for all standard and custom fields on contracts, orders, order products, and any custom objects directly related to these objects.
The parameters must be fully qualified. For example: OBJECT_NAME.RELATIONSHIP_NAME.FIELD_NAME=VALUE.
YYYY-MM-DD format.You can use multiple parameter fields, separated by ”&”, to make more detailed filters. For example:
1/services/data/v30.0/commerce/sale/CONTRACT_ID?contract.status='Activated'
2&contract.Orders.status='Draft'&contract.Orders.OrderItems.unitprice=300Where CONTRACT_ID is a variable.
The following aren’t supported.
order.orderItems.effectiveDate=2013–01–01,2013–01–02.>, >=, < and <=OR condition| Parameters | Description |
|---|---|
order | The object name of the record being filtered. In this resource, this is always order. |
orderItems | The relationship name of the field that the order’s data will be filtered by. In this resource, this is always orderItems. |
| field name | The field whose value to filter by. For example, if you want to only retrieve order products with a certain start date, the field name is effectivedate. |
| value | The value to filter by. For example, if you want to only retrieve order products that started on January 1, 2013, the value is 2013–01–01. |
| Property | Type | Description |
|---|---|---|
totalSize | Number | Total number of records listed. |
records | Records[] | Attributes and IDs of the new records. |
| Property | Type | Description |
|---|---|---|
attributes | Attributes | Type and URL for the record. |
Id | String | Unique record identifier. |
| Property | Type | Description |
|---|---|---|
type | String | Format of the resource. |
url | URI | Resource URL. |