Skip to main content

Order Workflow Tasks

Order tasks are used to create, update, and delete Orders.

Create Order

task: "Order/Create@1"
name: createOrder
inputs:
values:
billToContactId: "{{ billToContactId }}"
customValues: "{{ customValues }}"
divisionId: "{{ divisionId }}"
employeeContactId: "{{ employeeContactId }}"
entityTypeId: "{{ entityTypeId }}"
equipmentTypeId: "{{ equipmentTypeId }}"
lastOrderStatusModified: "{{ lastOrderStatusModified }}"
orderNumber: "{{ orderNumber }}"
orderStatusId: "{{ orderStatusId }}"
orderType: "{{ orderType }}"
salespersonContactId: "{{ salespersonContactId }}"
trackingNumber: "{{ trackingNumber }}"
outputs:
- name: order
mapping: "order"

Get Order

task: "Order/Get@1"
name: getOrder
inputs:
orderId: "123"

outputs:
- name: order
mapping: "order"

Update Order

task: "Order/Update@1"
name: updateOrder
inputs:
orderId: "123"
values:
billToContactId: "{{ billToContactId }}"
customValues: "{{ customValues }}"
divisionId: "{{ divisionId }}"
employeeContactId: "{{ employeeContactId }}"
entityTypeId: "{{ entityTypeId }}"
equipmentTypeId: "{{ equipmentTypeId }}"
lastOrderStatusModified: "{{ lastOrderStatusModified }}"
orderNumber: "{{ orderNumber }}"
orderStatusId: "{{ orderStatusId }}"
orderType: "{{ orderType }}"
salespersonContactId: "{{ salespersonContactId }}"
trackingNumber: "{{ trackingNumber }}"

Delete Order

task: "Order/Delete@1"
name: deleteOrder
inputs:
orderId: "123"

Copy Order

Creates a full copy of an existing order including entities, charges, commodities, and custom values. Tracking events are not copied.

Copy Options

OptionTypeRequiredDescription
orderIdintYesThe source order to copy
orderTypeOrderTypesNoOverride the order type on the copy. If not provided, keeps the original.
orderStatusIdintNoOverride the order status on the copy. If not provided, keeps the original.
trackingNumberstringNoSet the tracking number for the new order. If not provided, defaults to null.

Basic Copy

task: "Order/Copy@1"
name: copyOrder
inputs:
orderId: "{{ orderId }}"
outputs:
- name: newOrder
mapping: "order"

Copy with Overrides

task: "Order/Copy@1"
name: copyOrder
inputs:
orderId: "{{ orderId }}"
orderType: "Quote"
orderStatusId: "{{ newStatusId }}"
trackingNumber: "{{ trackingNumber }}"
outputs:
- name: newOrder
mapping: "order"

What the new order receives

  • New order number (auto-generated)
  • All OrderEntities (shipper, consignee, etc.)
  • All Charges copied with ChargeStatus.Open
  • All Commodities (full deep copy)
  • Custom values with copiedFromOrderId and copyOperationDate metadata

Split Order

Splits an order into two orders by distributing commodities based on quantity (pieces) or weight. The new order receives copies of the original order's entities, charges (set to Open status), and custom values. Tracking events are not copied.

Split Options

OptionTypeDescription
splitBystringHow to split: "Quantity" (by pieces) or "Weight" (by weight)
ratiodecimalProportional split (0-1 exclusive). Original keeps this fraction. Cannot be used with maxValue.
maxValuedecimalMaximum value for the original order. Overflow goes to the new order. Cannot be used with ratio.
maxValueWeightUnitstringWeight unit for maxValue when splitBy is "Weight". Required in that case. Values: "Kg" or "Lb". Commodity weights are converted to this unit for comparison.

Split by Ratio

task: "Order/Split@1"
name: splitOrder
inputs:
orderId: "{{ orderId }}"
options:
splitBy: "Quantity"
ratio: 0.5
outputs:
- name: newOrder
mapping: "order"

Split by Max Value

task: "Order/Split@1"
name: splitOrder
inputs:
orderId: "{{ orderId }}"
options:
splitBy: "Weight"
maxValue: 500
maxValueWeightUnit: "Kg"
outputs:
- name: newOrder
mapping: "order"

Behavior

  • By Quantity with Ratio: Each commodity's pieces are split proportionally. Original keeps ceil(pieces * ratio).
  • By Quantity with MaxValue: Original keeps commodities up to maxValue total pieces. Commodities at the boundary are split.
  • By Weight with Ratio: Multi-piece commodities split by pieces proportionally. Single-piece commodities split weight directly.
  • By Weight with MaxValue: Original keeps commodities up to maxValue total weight. Boundary commodities are split by pieces or weight.

What the new order receives

  • New order number (auto-generated)
  • All OrderEntities (shipper, consignee, etc.)
  • All Charges copied with ChargeStatus.Open
  • Split commodity portions
  • Custom values with splitFromOrderId and splitOperationDate metadata

Example Order Workflow

workflow:
name: "Order / Create Order Example Workflow"
description: "Create Order Example Workflow"
version: "1.0"
executionMode: "Sync"

inputs:
- name: "billToContactId"
type: "Contact"
displayName: "Bill to contact id"
description: "Bill to contact id"
multiple: false
required: false
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.billToContactId"
- name: "customValues"
type: "string,string"
displayName: "Custom values"
description: "Custom values"
multiple: false
required: false
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.customValues"
- name: "divisionId"
type: "Division"
displayName: "Division id"
description: "Division id"
multiple: false
required: true
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.divisionId"
- name: "employeeContactId"
type: "Contact"
displayName: "Employee contact id"
description: "Employee contact id"
multiple: false
required: false
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.employeeContactId"
- name: "entityTypeId"
type: "EntityType"
displayName: "Entity type id"
description: "Entity type id"
multiple: false
required: false
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.entityTypeId"
- name: "equipmentTypeId"
type: "EquipmentType"
displayName: "Equipment type id"
description: "Equipment type id"
multiple: false
required: false
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.equipmentTypeId"
- name: "lastOrderStatusModified"
type: "Date"
displayName: "Last order status modified"
description: "Last order status modified"
multiple: false
required: false
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.lastOrderStatusModified"
- name: "orderNumber"
type: "string"
displayName: "Order number"
description: "Order number"
multiple: false
required: true
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.orderNumber"
- name: "orderStatusId"
type: "OrderStatus"
displayName: "Order status id"
description: "Order status id"
multiple: false
required: true
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.orderStatusId"
- name: "orderType"
type: "OrderTypes"
displayName: "Order type"
description: "Order type"
multiple: false
required: true
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.orderType"
- name: "salespersonContactId"
type: "Contact"
displayName: "Salesperson contact id"
description: "Salesperson contact id"
multiple: false
required: false
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.salespersonContactId"
- name: "trackingNumber"
type: "string"
displayName: "Tracking number"
description: "Tracking number"
multiple: false
required: false
defaultValue: ""
additionalProperties:
visible: true
mapping: "order.trackingNumber"

outputs:
- name: order
mapping: "createOrderActivity.createOrder.order"

activities:
- name: "createOrderActivity"
description: "Create Order"
steps:
- task: "Order/Create@1"
name: createOrder
inputs:
order:
billToContactId: "{{ billToContactId }}"
customValues: "{{ customValues }}"
divisionId: "{{ divisionId }}"
employeeContactId: "{{ employeeContactId }}"
entityTypeId: "{{ entityTypeId }}"
equipmentTypeId: "{{ equipmentTypeId }}"
lastOrderStatusModified: "{{ lastOrderStatusModified }}"
orderNumber: "{{ orderNumber }}"
orderStatusId: "{{ orderStatusId }}"
orderType: "{{ orderType }}"
salespersonContactId: "{{ salespersonContactId }}"
trackingNumber: "{{ trackingNumber }}"
outputs:
- name: order
mapping: "order"
- name: "getOrderActivity"
description: "Get Order"
steps:
- task: "Order/Get@1"
name: getOrder
inputs:
orderId: "{{ createOrderActivity.createOrder.order.orderId }}"
outputs:
- name: orderFromGet
mapping: "order"
- name: "updateOrderActivity"
description: "Update Order"
steps:
- task: "Order/Update@1"
name: updateOrder
inputs:
orderId: "{{ getOrderActivity.getOrder.order.orderId }}"
order:
billToContactId: "{{ billToContactId }}"
customValues: "{{ customValues }}"
divisionId: "{{ divisionId }}"
employeeContactId: "{{ employeeContactId }}"
entityTypeId: "{{ entityTypeId }}"
equipmentTypeId: "{{ equipmentTypeId }}"
lastOrderStatusModified: "{{ lastOrderStatusModified }}"
orderNumber: "{{ orderNumber }}"
orderStatusId: "{{ orderStatusId }}"
orderType: "{{ orderType }}"
salespersonContactId: "{{ salespersonContactId }}"
trackingNumber: "{{ trackingNumber }}"
- name: "deleteOrderActivity"
description: "Delete Order"
steps:
- task: "Order/Delete@1"
name: deleteOrder
inputs:
orderId: "{{ getOrderActivity.getOrder.order.orderId }}"