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
With this resource, you can add one or more new orders to an existing contract, as well as order products and custom object records for each order, or you can retrieve data for a specific contract.
If available, GET method retrieves the contract’s child orders and order products, as well as custom objects under the contract and orders.
URI
1/services/data/API_VERSION/commerce/sale/CONTRACT_IDWhere API_VERSION and CONTRACT_ID are variables.
For retrieving filtered data:
1/services/data/API_VERSION/commerce/sale/CONTRACT_ID?contract.orders.FIELD_NAME=VALUEWhere API_VERSION, CONTRACT_ID, FIELD_NAME and VALUE are variables.
Available since release
30.0
Formats
JSON
HTTP methods
PATCH, GET
| Property | Type | Description | Since Version |
|---|---|---|---|
attributes | Attributes | Type of the contract. | 30.0 |
Id | String | Unique contract identifier. | 30.0 |
Orders | Orders[] | Child orders of the contract. | 30.0 |
| Property | Type | Description | Since Version |
|---|---|---|---|
type | String | Format of the resource. | 30.0 |
| Property | Type | Description | Since Version |
|---|---|---|---|
attributes | Attributes | Type of the order record. | 30.0 |
Status | String | Status of the order. | 30.0 |
contractId | String | Unique record identifier for the parent contract. | 30.0 |
pricebook2Id | String | Unique record identifier for the associated price book. | 30.0 |
OrderItems | Order Products[] | Child order products of the order. | 30.0 |
CUSTOM_OBJECT__r | Custom Objects[] | Child custom object records of the order. | 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 |
| 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:
contract.orders.Status='Activated','Draft'.>, >=, < and <=OR condition| Parameters | Description | Since Version |
|---|---|---|
contract | The object name of the record being filtered. In this resource, this is always contract. | 30.0 |
orders | The relationship name of the field that the order’s data will be filtered by. In this resource, this is always orders. | 30.0 |
| field name | The field whose value to filter by. For example, if you want to only retrieve orders with a status category, the field name is StatusCode. | 30.0 |
| value | The value to filter by. For example, if you want to only retrieve orders with a status category of Activated, the value is Activated. | 30.0 |
| Property | Type | Description |
|---|---|---|
totalSize | Number | Total number of records retrieved. |
done | Boolean | When true, the operation was successful. |
records | Records[] | Attributes and ID of contract record. |
| Property | Type | Description |
|---|---|---|
attributes | Attributes | Type and URL of the record. |
Id | String | Unique contract identifier. |
| Property | Type | Description |
|---|---|---|
type | String | Format of the resource. |
url | String | Resource URL. |