Newer Version Available

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

OrderStatusChangedEvent

Notifies subscribers of changes to the status of an order record. Use this event to trigger flows and processes in your order workflow. This object is available in API version 51.0 and later.

Supported Calls

describeSObjects()

Supported Subscribers

Subscriber Supported?
Apex Triggers Yes
Flows Yes
Processes Yes
Pub/Sub API Yes
Streaming API (CometD) Yes

Subscription Channel

/event/OrderStatusChangedEvent

Event Delivery Allocation Enforced

Yes

Fields

Field Details
EventUuid
Type
string
Properties
Nillable
Description
A universally unique identifier (UUID) that identifies a platform event message. This field is available in API version 52.0 and later.
NewStatus
Type
picklist
Properties
Restricted picklist
Description
The order's status after the status change.
Possible values are:
  • Activated
  • Draft
NewStatusCode
Type
picklist
Properties
Restricted picklist
Description
The order StatusCode after the status change.
Possible values are:
  • Activated
  • Canceled
  • Draft
  • Expired
OldStatus
Type
picklist
Properties
Restricted picklist
Description
The order's status before the status change.
Possible values are:
  • Activated
  • Draft
OldStatusCode
Type
picklist
Properties
Restricted picklist
Description
The order StatusCode before the status change.
Possible values are:
  • Activated
  • Canceled
  • Draft
  • Expired
OrderId
Type
reference
Properties
Nillable
Description
ID of the order whose status was changed. Used only if the order is an Original Order.
RelatedOrderId
Type
reference
Properties
Nillable
Description
ID of the order whose status was changed. Used only if the order isn't an Original Order.
RelatedOrderType
Type
picklist
Properties
Nillable, Restricted picklist
Description
The type of related order. Shown only if the order with the changed status isn't an OriginalOrder.
Possible values are:
  • Change Order
  • Reduction Order
ReplayId
Type
string
Properties
Nillable
Description
Represents an ID value that is populated by the system and refers to the position of the event in the event stream. Replay ID values aren���t guaranteed to be contiguous for consecutive events. A subscriber can store a replay ID value and use it on resubscription to retrieve missed events that are within the retention window.

Usage

To use OrderStatusChangedEvent, Enable Order Events must be enabled in the Order Settings page.

When an order is created and activated in one transaction, OldStatus is Draft and NewStatus is Activated.

When an order's status is updated multiple times in one transaction, OldStatus is the status at the beginning of the transaction before any changes. NewStatus is the final status after all updates.