Skip to content

Actor Commands

Commands are atomic mutations applied to a single actor. They are not dispatched directly — instead they are batched inside a message (most commonly applyCommands, but some other messages accept commands as well). All commands in a batch execute as one atomic operation: if any command fails, the entire batch is rejected and no changes are applied.

Commands only mutate state within the actor that receives them; they never have side effects on other actors. For cross-actor effects, use messages.

http
POST /resources/actors/order/ORD12345
Content-Type: application/json

[{
  "type": "applyCommands",
  "body": {
    "commands": [
      { "type": "addTag", "key": "blocked" }
    ]
  }
}]

See the Actors overview for the conceptual model.

Order Actor overview →

addActivityLogAdds an activity log to an Order
addDeliveryTagAdds a tag to a Delivery
addTagAdds a tag to an Order
cancelDeliveryCancels a delivery.
cancelInvoiceCancels an Invoice
completeDeliveryMarks a delivery as completed.
createDeliveryAdds a new Delivery to an Order
createOrderLineCreates a new Order Row
createPromotionCreates a promotion on an Order based on a component
createPromotionBySourceCreates a promotion on an Order with inline Filtrera source
createReturnCreates a Return for a specific Order Row
createStaticOrderDiscountCreates a static discount on an Order. An order discount value is distributed across all order lines and shipping fees proportionally to their value.
createStaticOrderLineDiscountCreates a static discount on an order line
createStaticShippingDiscountCreates a static discount on a shipping fee
deleteDiscountDeletes an existing Discount from an Order
deleteOrderLineDeletes an existing Order Row
deletePromotionDeletes a promotion from an Order
deleteReturnDeletes and existing Return
generateOrderNumberByPrefixGenerates an order number for an order based on the given prefix
invoiceInvoices all entities released for invoicing on the Order.
linkPaymentAssociates a Payment with an Order
moveOrderLineToDeliveryMoves an existing order line to a different delivery.
openDeliveryOpens a delivery that is currently in processing. Ensure there are no external dependencies such as warehouses actively working on the delivery.
releaseDeliveryReleases a delivery for fulfillment processing.
releaseOrderLineToInvoicingReleases an order line to be invoiced.
releaseShippingToInvoicingReleases a delivery's shipping fee to be invoiced.
removeDeliveryTagRemoves a tag from a Delivery
removeTagRemoves a tag from an Order
retractOrderLineFromInvoicingUnreleases an order line from invoicing.
retractShippingFromInvoicingUnreleases a delivery's shipping fee from invoicing.
setChannelKeySets the channel key of an order.
setCustomerNumberSets the customer number of an order.
setDeliveryAddressSets the Address of a Delivery
setDeliveryDynamicFieldsSets dynamic fields of a delivery. Non specified fields will be left unchanged. Set value to null to remove field.
setDeliveryInventorySets the inventory and inventory date of a Delivery. Stock reservations will be updated if there are any.
setDiscountDescriptionSets description of discount. Should be meaningful to the customer as it's used on invoices and customer communication.
setDiscountDynamicFieldsSets dynamic fields of a discount. Non specified fields will be left unchanged. Set value to null to remove field.
setInvoiceAddressSets the invoice address of an Order which will be used for new invoices
setLocaleSet the locale of the Order. Nothing else will be affected.
setNotesSet the notes of the Order.
setOrderDynamicFieldsSets dynamic fields of an order. Non specified fields will be left unchanged. Set value to null to remove field.
setOrderLineDynamicFieldsSets dynamic fields of an order line. Non specified fields will be left unchanged. Set value to null to remove field.
setOrderLineProductSets the product of an Order Line.
setOrderLineQuantitySets the quantity of an Order Line
setOrderLineSkusSets the required quantities of SKUs on an Order Line
setOrderLineTaxSets the tax of an Order Line, either by a fixed total (taxTotal) or a percentage (taxFactor).
setOrderLineUnitPriceSets the unit price of an Order Line.
setOrderStateSets the state of an Order
setPromotionDescriptionSets the description on a promotion
setPromotionDynamicFieldsSets dynamic fields on a promotion
setPromotionParametersSets parameters on a promotion
setReturnDynamicFieldsSets dynamic fields of a return. Non specified fields will be left unchanged. Set value to null to remove field.
setShippingPriceSets the shipping price of a Delivery.
setShippingProductSets the shipping product of a Delivery.
setShippingTaxSets the tax percentage factor of a a Delivery's shipping cost.
setStaticDiscountValueUpdates the value of an existing static discount
unsetDeliveryInventoryRemoves the inventory from a Delivery. Stock reservations will be updated if there are any.

Payment Actor overview →

addActivityLogAdds an activity log to a Payment
addTagAdds a tag to a Payment
createAuthorizationCreates a new Authorization.
generatePaymentNumberByPrefixGenerates a payment number for a payment based on the given prefix
removeTagRemoves a tag from a Payment
setAuthorizationAmountSets the amount of an Authorization.
setAuthorizationStateSets the state of an Authorization.
setDynamicFieldsSets dynamic fields of a payment. Non specified fields will be left unchanged. Set value to null to remove field.

SKU Actor overview →

reserveReserve stock. If not enough stock is available, a back order will automatically be created and it will be fulfilled once enough stock is available.
setAllocationCreates or updates a stock allocation of SKU for a given inventory.
setDynamicFieldsSets dynamic fields of a sku. Non specified fields will be left unchanged. Set value to null to remove field.
setIncomingStockCreates or updates incoming stock of SKU for a given inventory. Reference can be used to map incoming stock to an external entity.
setPhysicalStockSets the physical stock quantity of SKU for a given inventory. If there is no existing StockPosition for the SKU/inventory it will be created.
unreserveRemoves any reservation or back order of the specified order line

Asset Actor overview →

addActivityLogAdds an activity log to an Asset
addTagAdds a tag to an Asset
createItemAdds a new Asset Item to a Asset
createItemRelationAdds a new graph node relation to a Asset Item
createRelationAdds a new graph node relation to a Asset
deleteItemRemoves an Asset Item from an Asset
deleteItemRelationRemoves a graph node relation from a Asset Item
deleteRelationRemoves a graph node relation from a Asset
generateAssetNumberByPrefixGenerates an asset number for an Asset based on the given prefix
removeTagRemoves a tag from an Asset
setDynamicFieldsSets dynamic fields of an asset. Non specified fields will be left unchanged. Set value to null to remove field.
setItemDynamicFieldsSets dynamic fields of an asset item. Non specified fields will be left unchanged. Set value to null to remove field.

Ticket Actor overview →

addActivityLogAdds an activity log to a Ticket
addTagAdds a tag to a Ticket
createItemAdds a new Ticket Item to a Ticket
createItemRelationAdds a new graph node relation to a Ticket Item
createRelationAdds a new graph node relation to a Ticket
deleteItemRemoves a Ticket Item from a Ticket
deleteItemRelationRemoves a graph node relation from a Ticket Item
deleteRelationRemoves a graph node relation from a Ticket
generateTicketNumberByPrefixGenerates a ticket number for a Ticket based on the given prefix
removeTagRemoves a tag from a Ticket
setChannelKeySets the channel key of a ticket.
setDynamicFieldsSets dynamic fields of a ticket. Non specified fields will be left unchanged. Set value to null to remove field.
setItemDynamicFieldsSets dynamic fields of a ticket item. Non specified fields will be left unchanged. Set value to null to remove field.

© 2024 Hantera AB. All rights reserved.