Skip to content

Actor Messages

Messages are how you interact with actors. Each actor type defines its own set of messages for mutations and queries; in addition, every actor accepts a small set of common messages (delete, getCheckpoints, rewind).

All messages are dispatched through a single HTTP endpoint:

http
POST /resources/actors/{type}/{externalId}

The request body is an array of messages, processed sequentially. Append ?preview to run them in a transient transaction without persisting changes. See the Actors overview for the conceptual model and the full Send message(s) to actor endpoint reference for the wire format.

Order Actor overview →

applyCommandsApplies a list of commands to an Order
capturePaymentsCaptures payments for all unpaid invoices on the Order.
createCreates an new Order.
queryQueries the order from the graph.

Payment Actor overview →

applyCommandsApplies a list of commands to a Payment
chargeRegisters a charge for a given amount. If the payment maps an external payment provider, this message should be called after the charge has been approved by the provider.
completeCaptureCompletes pending capture and assigns its amount to credit balance. This can be used to force a capture to complete even if there's no underlying charge. Note that this can cause a payment to get a negative credit amount.
createCreates a new Payment.
queryQueries the payment from the graph.
refundRegisters a refund for a given amount. If the payment maps an external payment provider, this message should be called after the refund has been approved by the provider.

SKU Actor overview →

applyCommandsApplies a list of commands to a Sku
calculateAvailableStockCalculates available stock
createCreates a new SKU.
queryQueries the SKU from the graph.

Asset Actor overview →

applyCommandsApplies a list of [Asset commands](/resources/actors/custom/asset/commands/) to a given `ASSET ID`. Commands are [batch processed](/resources/actors/#:~:text=Batch%20Processing%20of%20Commands,-Commands%20are%20always), which means that if one command fails, the entire message fails.
createCreates a new instance of an asset actor. You must specify an asset type. If not, you'll get an [INVALID_MESSAGE_BODY](/resources/actors/errors/#:~:text=INVALID_MESSAGE_BODY-,INVALID_MESSAGE_BODY) error.
queryQueries the asset from the graph.

Ticket Actor overview →

applyCommandsApplies a list of commands to a Ticket. You can send in several commands in one request for [batch processing](/resources/actors/#:~:text=Commands%20are%20always%20processed). However, if one command fails, the entire message fails.
completeCompletes a ticket
createCreates a new Ticket.
queryQueries the ticket from the graph.
rejectCloses a Ticket and marks it as `rejected`. It also updates its `closedAt` property.

Common (all actors) Actor

deleteDeletes the actor
getCheckpointsReturns available checkpoints for the actor, which can be used for rewind operations.
rewindRewinds the actor to a specific checkpoint. This operation appends a new mutation set that transforms the current state back to the checkpoint state. Activity logs are preserved with a rewind entry added.

© 2024 Hantera AB. All rights reserved.