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.
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.
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 will be 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
Date on which the order was authorized by your organization.
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.
End Date
Type
date
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Date at which the order ends. Label is Order End Date.
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.
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.
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 the order will be 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.
TotalAmount
Type
currency
Properties
Filter, Sort
Description
The total amount for the order products associated with this order.
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 subsequently 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.

See Also