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 →
| applyCommands | Applies a list of commands to an Order |
| capturePayments | Captures payments for all unpaid invoices on the Order. |
| create | Creates an new Order. |
| query | Queries the order from the graph. |
Payment Actor overview →
| applyCommands | Applies a list of commands to a Payment |
| charge | Registers 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. |
| completeCapture | Completes 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. |
| create | Creates a new Payment. |
| query | Queries the payment from the graph. |
| refund | Registers 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 →
| applyCommands | Applies a list of commands to a Sku |
| calculateAvailableStock | Calculates available stock |
| create | Creates a new SKU. |
| query | Queries the SKU from the graph. |
Asset Actor overview →
| applyCommands | Applies 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. |
| create | Creates 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. |
| query | Queries the asset from the graph. |
Ticket Actor overview →
| applyCommands | Applies 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. |
| complete | Completes a ticket |
| create | Creates a new Ticket. |
| query | Queries the ticket from the graph. |
| reject | Closes a Ticket and marks it as `rejected`. It also updates its `closedAt` property. |
Common (all actors) Actor
| delete | Deletes the actor |
| getCheckpoints | Returns available checkpoints for the actor, which can be used for rewind operations. |
| rewind | Rewinds 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. |