Create Order

With this resource, you can create a new order with order products and custom objects.

Syntax 

If you don’t want to add the order to a contract, you can add it directly to an account. You can only create one new order per call. The request body must have either an account or a contract as its parent record, and it must have a reference to a price book.

URI

1/services/data/API_VERSION/commerce/sale/order

Where API_VERSION is a variable.

Available since release

30.0

Formats

JSON

HTTP methods

POST

Request body 

PropertyTypeDescriptionSince Version
attributesAttributesType and URL of the new order.30.0
OrderItemsOrder Products[]Child order products of the new order.30.0
CUSTOM_OBJECT__rCustom Objects[]Child custom object records of the new order.30.0

Attributes 

PropertyTypeDescriptionSince Version
typeStringFormat of the resource.30.0
urlStringResource URL.30.0

Order Products 

PropertyTypeDescriptionSince Version
attributesAttributesType and URL of the order product.30.0
PricebookEntryIdStringUnique record identifier for the associated price book entry.30.0
quantityNumberNumber of units of the order product.30.0
UnitPriceCurrencyThe unit price for the order product.30.0
IdStringUnique order product identifier.30.0

Custom Objects 

PropertyTypeDescriptionSince Version
attributesAttributesType and URL of the custom object.30.0
IdStringUnique custom object identifier.30.0

Request parameters 

None

Response Body 

PropertyTypeDescription
totalSizeNumberTotal number of records retrieved.
doneBooleanWhen true, the operation was successful.
recordsRecords[]Attributes and ID of contract record.

Records 

PropertyTypeDescription
attributesAttributesType and URL of the record.
IdStringUnique contract identifier.

Attributes 

PropertyTypeDescription
typeStringFormat of the resource.
urlStringResource URL.

Example 

See Add an Order to an Existing Account.