Newer Version Available

This content describes an older version of this product. View Latest

Order

Represents an order associated with a contract or an account.

Supported Calls

create(), delete(), describeLayout(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), search(), undelete(), update(), upsert()

Fields

Field Name Details
AccountId
Type
reference
Properties
Create, Filter, Nillable, Group, Sort, Update
Description
Required. ID of the Account associated with this order. Can only be updated when the order’s StatusCode value is Draft.
ActivatedById
Type
reference
Properties
Filter, Group, Nillable, Sort,Update
Description
ID of the User who activated this order.
ActivatedDate
Type
dateTime
Properties
Filter, Nillable, Sort, Update
Description
Date and time when the order was activated.
BillingCity
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
City for the billing address for this order. Maximum size is 40 characters.
BillingCountry
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Country for the billing address for this order. Maximum size is 80 characters.
BillingCountryCode (beta)
Type
picklist
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
ISO country code for the billing address for this order.
BillingEmailAddress
Type
email
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Email address for this order’s billing address.
To access Commerce Orders fields, your org must have a Salesforce Order Management license. Commerce Orders fields are available only in Lightning Experience.
This field is available in API v48.0 and later.
BillingLatitude
Type
double
Properties
Create, Filter, Nillable, Sort, Update
Description
Used with BillingLongitude to specify the precise geolocation of a billing address. Acceptable values are numbers between –90 and 90 with up to 15 decimal places.
BillingLongitude
Type
double
Properties
Create, Filter, Nillable, Sort, Update
Description
Used with BillingLatitude to specify the precise geolocation of a billing address. Acceptable values are numbers between –180 and 180 with up to 15 decimal places.
BillingPhoneNumber
Type
phone
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Phone number for this order’s billing address.
To access Commerce Orders fields, your org must have a Salesforce Order Management license. Commerce Orders fields are available only in Lightning Experience.
This field is available in API v48.0 and later.
BillingPostalCode
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Postal code for the billing address for this order. Maximum size is 20 characters.
BillingState
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
State for the billing address for this order. Maximum size is 80 characters.
BillingStateCode (beta)
Type
picklist
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
ISO state code for the order’s billing address.
BillingStreet
Type
textarea
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Street address for the billing address.
BillToContactId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
ID of the contact that the order is billed to.
CompanyAuthorizedById
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
ID of the user who authorized the account associated with the order.
CompanyAuthorizedDate
Type
date
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The date on which your organization authorized the order.
ContractId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
ID of the contract associated with this order. Can only be updated when the order’s StatusCode value is Draft.
CustomerAuthorizedById
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
ID of the contact who authorized the order.
CustomerAuthorizedDate
Type
date
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Date on which the contact authorized the order.
Description
Type
textarea
Properties
Create, Nillable, Update
Description
Description of the order.
EffectiveDate
Type
date
Properties
Create, Filter, Group, Sort, Update
Description
Date at which the order becomes effective. Label is Order Start Date.
EndDate
Type
date
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Date at which the order ends. Label is Order End Date.
GrandTotalAmount
Type
currency
Properties
Filter, Nillable, Sort
Description
Sum of OrderTotalAmount and OrderTotalTaxAmount.
To access Commerce Orders fields, your org must have a Salesforce Order Management license. Commerce Orders fields are available only in Lightning Experience.
This field is available in API v48.0 and later.
IsReductionOrder
Type
boolean
Properties
Create, Defaulted on create, Filter, Group, Sort
Description
Read-only. Determines whether an order is a reduction order. Label is Reduction Order.
LastReferencedDate
Type
dateTime
Properties
Filter, Nillable, Sort
Description
The timestamp for when the current user last viewed a record related to this record.
LastViewedDate
Type
dateTime
Properties
Filter, Nillable, Sort
Description
The timestamp for when the current user last viewed this record. If this value is null, this record might only have been referenced (LastReferencedDate) and not viewed.
Name
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Name for this order.
OpportunityId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
ID for the opportunity that’s associated with this order.
OrderedDate
Type
dateTime
Properties
Create, Filter, Nillable, Sort, Update
Description
The date and time that the order was placed.
To access Commerce Orders fields, your org must have a Salesforce Order Management license. Commerce Orders fields are available only in Lightning Experience.
This field is available in API v48.0 and later.
OrderNumber
Type
string
Properties
Autonumber, Defaulted on create, Filter, idLookup, Sort
Description
Order number assigned to this order (not the unique, system-generated ID assigned during creation). Maximum size is 30 characters.
OrderReferenceNumber
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Order reference number assigned to this order. Maximum size is 80 characters.
OriginalOrderId
Type
reference
Properties
Create, Defaulted on create, Filter, Group, Nillable, Sort
Description
Optional. ID of the original order that a reduction order is reducing, if the reduction order is reducing a single order. Label is Original Order.

Editable only if isReductionOrder is true. If the reduction order is reducing more than one order, leave blank.

OwnerId
Type
reference
Properties
Create, Defaulted on create, Filter, Group, Sort, Update
Description
Required. ID of the User or queue that owns this order.
PoDate
Type
date
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Date of the purchase order.
PoNumber
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Number identifying the purchase order. Maximum is 80.
Pricebook2Id
Type
reference
Properties
Create, Defaulted on create, Filter, Group, Nillable, Sort, Update
Description
Required. ID of the price book associated with this order.
QuoteId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
ID of the quote that’s associated with this order.

If you set QuoteId to null, QuoteLineItemId on all of the order’s child order products is set to null.

RecordTypeId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
ID of the record type assigned to this order.
RelatedOrderId
Type
reference
Properties
Filter, Group, Nillable, Sort
Description
The original order that a change order was created from.
To access Commerce Orders fields, your org must have a Salesforce Order Management license. Commerce Orders fields are available only in Lightning Experience.
This field is available in API v48.0 and later.
SalesChannelId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Reference to a sales channel entity.
To access Commerce Orders fields, your org must have a Salesforce Order Management license. Commerce Orders fields are available only in Lightning Experience.
This field is available in API v48.0 and later.
ShippingAddress
Type
address
Properties
Filter, Nillable
Description
Shipping address for the order.
ShippingCity
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
City of the shipping address. Maximum size is 40 characters.
ShippingCountry
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Country of the shipping address. Maximum size is 80 characters.
ShippingCountryCode (beta)
Type
picklist
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
ISO country code for the order’s shipping address.
ShippingLatitude
Type
double
Properties
Create, Filter, Nillable, Sort, Update
Description
Used with ShippingLongitude to specify the precise geolocation of a shipping address. Acceptable values are numbers between –90 and 90 with up to 15 decimal places.
ShippingLongitude
Type
double
Properties
Create, Filter, Nillable, Sort, Update
Description
Used with ShippingLatitude to specify the precise geolocation of an address. Acceptable values are numbers between –180 and 180 with up to 15 decimal places.
ShippingPostalCode
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Postal code of the shipping address. Maximum size is 20 characters.
ShippingState
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
State of the shipping address. Maximum size is 80 characters.
ShippingStateCode (beta)
Type
picklist
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
ISO state code for the order’s shipping address.
ShippingStreet
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Street address of the shipping address. Maximum of 255 characters.
ShipToContactId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
ID of the contact that the order is shipped to.
Status
Type
picklist
Properties
Create, Filter, Group, Restricted picklist, Sort, Update
Description
Picklist of values that indicate order status. Each value is within one of two status categories defined in StatusCode. For example, the status picklist might contain Draft, Ready for Review, and Ready for Activation values with a StatusCode of Draft.
StatusCode
Type
picklist
Properties
Filter, Group, Restricted picklist, Sort, Update
Description
The status category for the order. An order can be either Draft or Activated. Label is Status Category.
TotalAdjustedDeliveryAmount
Type
currency
Properties
Filter, Nillable, Sort
Description
Sum of delivery line amounts and delivery line adjustments. Order products with null Type fields aren’t included.
To access Commerce Orders fields, your org must have a Salesforce Order Management license. Commerce Orders fields are available only in Lightning Experience.
This field is available in API v48.0 and later.
TotalAdjustedDeliveryTaxAmount
Type
currency
Properties
Filter, Nillable, Sort
Description
Sum of delivery line tax amounts and delivery line tax adjustments.
To access Commerce Orders fields, your org must have a Salesforce Order Management license. Commerce Orders fields are available only in Lightning Experience.
This field is available in API v48.0 and later.
TotalAdjustedProductAmount
Type
currency
Properties
Filter, Nillable, Sort
Description
Sum of product line amounts and line adjustments. Order products with null Type fields aren’t included.
To access Commerce Orders fields, your org must have a Salesforce Order Management license. Commerce Orders fields are available only in Lightning Experience.
This field is available in API v48.0 and later.
TotalAdjustedProductTaxAmount
Type
currency
Properties
Filter, Nillable, Sort
Description
Sum of line tax amounts and line tax adjustments. Order products with null Type fields aren’t included.
To access Commerce Orders fields, your org must have a Salesforce Order Management license. Commerce Orders fields are available only in Lightning Experience.
This field is available in API v48.0 and later.
TotalAmount
Type
currency
Properties
Filter, Sort
Description
The total amount for the order products associated with this order.
This field is available in API v48.0 and later.
TotalDeliveryAdjDistAmount
Type
currency
Properties
Filter, Nillable, Sort
Description
Roll-up of the order’s delivery adjustment distributed amounts. Used only when the Order Adjustment Group has a Type value of Header.
To access Commerce Orders fields, your org must have a Salesforce Order Management license. Commerce Orders fields are available only in Lightning Experience.
This field is available in API v48.0 and later.
TotalDeliveryAdjDistTaxAmount
Type
currency
Properties
Filter, Nillable, Sort
Description
Roll-up of the order’s delivery adjustment distributed tax amounts. Used only when the Order Adjustment Group has a Type value of Header.
To access Commerce Orders fields, your org must have a Salesforce Order Management license. Commerce Orders fields are available only in Lightning Experience.
This field is available in API v48.0 and later.
TotalProductAdjDistAmount
Type
currency
Properties
Filter, Nillable, Sort
Description
Roll-up of the order’s product adjustment distributed amounts. Order products with null Type fields aren’t included. Used only when the Order Adjustment Group has a Type value of Header.
To access Commerce Orders fields, your org must have a Salesforce Order Management license. Commerce Orders fields are available only in Lightning Experience.
This field is available in API v48.0 and later.
TotalProductAdjDistTaxAmount
Type
currency
Properties
Filter, Nillable, Sort
Description
Roll-up of the order’s product adjustment distributed tax amounts. Order products with null Type fields aren’t included. Used only when the Order Adjustment Group has a Type value of Header.
To access Commerce Orders fields, your org must have a Salesforce Order Management license. Commerce Orders fields are available only in Lightning Experience.
This field is available in API v48.0 and later.
TotalTaxAmount
Type
currency
Properties
Filter, Nillable, Sort
Description
Roll up of all tax on the order. Includes delivery taxes, price adjustment taxes, and product taxes.
To access Commerce Orders fields, your org must have a Salesforce Order Management license. Commerce Orders fields are available only in Lightning Experience.
This field is available in API v48.0 and later.
Type
Type
picklist
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The type of order.

Usage

The Status field specifies the current state of an order. Status strings represent its current state (Draft or Activated).

When a client application creates an order, the Status Code must be Draft and the Status must be any value that corresponds to a Status Code of Draft. The application can then activate an order by updating it and setting the value in its Status field to an Activated state; however, the Status field is the only field you can update when activating the order.

After an order is activated, your client application can change the Status back to the Draft state—but only if the order doesn’t have any child reduction order products. Your client application can delete orders when the Status is Draft but not when its Status is Activated.

Client applications can use the API to create, update, delete, and query any Attachment associated with an order.

Associated Objects

This object has the following associated objects. Unless noted, they are available in the same API version as this object.

OrderFeed (API version 29.0)
Feed tracking is available for the object.
OrderHistory
History is available for tracked fields of the object.
OrderOwnerSharingRule
Sharing rules are available for the object.