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 }}"
commodities:
- description: "{{ commodityDescription }}"
pieces: "{{ pieces }}"
billToContactId: "{{ commodityBillToContactId }}"
outputs:
- name: order
mapping: "order"
When creating an order with nested commodities, each commodity may include billToContactId. The create handler applies it to the commodity so multi-customer charge filtering works immediately after order creation.
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
| Option | Type | Required | Description |
|---|---|---|---|
orderId | int | Yes | The source order to copy |
orderType | OrderTypes | No | Override the order type on the copy. If not provided, keeps the original. |
orderStatusId | int | No | Override the order status on the copy. If not provided, keeps the original. |
trackingNumber | string | No | Set 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
copiedFromOrderIdandcopyOperationDatemetadata
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
| Option | Type | Description |
|---|---|---|
splitBy | string | How to split: "Quantity" (by pieces) or "Weight" (by weight) |
ratio | decimal | Proportional split (0-1 exclusive). Original keeps this fraction. Cannot be used with maxValue. |
maxValue | decimal | Maximum value for the original order. Overflow goes to the new order. Cannot be used with ratio. |
maxValueWeightUnit | string | Weight 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
maxValuetotal 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
maxValuetotal 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
splitFromOrderIdandsplitOperationDatemetadata