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 create a new contract with orders and order products, as well as custom object records on the contract or order level.
URI
1/services/data/API_VERSION/commerce/saleWhere API_VERSION is a variable.
Available since release
30.0
Formats
JSON
HTTP methods
POST
| Property | Type | Description | Since Version |
|---|---|---|---|
attributes | Attributes | Type and URL of the new contract. | 30.0 |
AccountId | String | Unique record identifier for the parent account. | 30.0 |
Status | String | Status of the contract. | 30.0 |
Orders | Orders[] | Child orders of the new contract. | 30.0 |
CUSTOM_OBJECT__r | Custom Objects[] | Child custom object records of the new contract. | 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 new order record. | 30.0 |
Status | String | Status of the order. | 30.0 |
Pricebook2Id | String | Unique record identifier for the associated price book. | 30.0 |
OrderItems | Order Products[] | Child order products of the new order. | 30.0 |
CUSTOM_OBJECT__r | Custom Objects[] | Child custom object records of the new order. | 30.0 |
| Property | Type | Description | Since Version |
|---|---|---|---|
attributes | Attributes | Type and URL of the custom object record. | 30.0 |
Id | String | Unique record identifier. | 30.0 |
| Property | Type | Description | Since Version |
|---|---|---|---|
attributes | Attributes | Type and URL of the order product record. | 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 |
None
| Property | Type | Description |
|---|---|---|
totalSize | Number | Total number of records added. |
done | Boolean | When true, the operation was successful. |
records | Records[] | Attributes and IDs of records. |
| Property | Type | Description |
|---|---|---|
attributes | Attributes | Type and URL for the new record. |
Id | String | Unique identifier for the new record. |
| Property | Type | Description |
|---|---|---|
type | String | Format of the resource. |
url | String | Resource URL. |
See Add a Contract and Orders to an Existing Account.
You can only create one contract at a time. You can’t POST new orders onto an existing contract. For that, see the Contract-based Orders resource.