Created by potrace 1.16, written by Peter Selinger 2001-2019

Miva Developer Docs


An order queue is a named list of orders. Workflows add and remove orders, and the admin and the JSON API can both read a queue. An order can be in any number of queues at once.

Use queues to hand work to people or systems. Examples:

  • A New & Updated Orders queue that an ERP pulls from, so it only downloads orders that are new or changed since its last pull.
  • A Next Day Air queue the warehouse works through first.
  • A Fraud Review queue for orders customer service checks before they ship.

Create a queue#

Add queues on the Order Workflow Queues tab. Each queue has:

Field Rules
Code Required, 50 characters or fewer, unique (codes are compared without regard to case). If the domain’s strict codes setting is on, use only letters, numbers, _ and -. Workflows and the JSON API refer to the queue by its code.
Name Required, 254 characters or fewer. Shown in the admin.

Deleting a queue

Deleting a queue removes every order from it. Miva doesn’t check whether a workflow still uses the queue, so any workflow action that names it fails from then on. Update or delete those workflows first.

Default queues and workflows#

Installing the Order Workflow module creates two queues:

Code Name
new_and_updated New & Updated Orders
successfully_retrieved_orders Successfully Retrieved Orders

It also creates four workflows that use them. All four are installed disabled. Turn on the set that matches how your integration works:

Workflow Trigger What it does
Process New & Updated Orders Order Created, Order Total Change, Order Item Created, Order Item Updated, Order Item Deleted Once the order has a payment (condition length(order:payments) GT 0, with Wait Until True every 5 minutes for up to 60), adds a note and adds the order to New & Updated Orders.
Process Retrieved Orders Order Retrieved Adds a note and adds the order to Successfully Retrieved Orders. The order stays in New & Updated Orders.
Process Retrieved Orders with Order Acknowledgement Order Retrieved Adds a note saying the order was retrieved but left in New & Updated Orders.
Process Order Acknowledgement Order Acknowledged Adds a note and moves the order to Successfully Retrieved Orders, which takes it out of every other queue.

For an integration that acknowledges orders, enable the first, third and fourth workflows. For one that doesn’t, enable the first two, and change the action in Process Retrieved Orders from Add to Queue to Move to Queue so retrieved orders leave New & Updated Orders. Retrieving orders from a queue explains both flows.

Work with queues in the admin#

To change one order’s queues, open the order and select the Order Workflows tab. It lists every queue with a checkbox; check or clear a box and save.

For many orders, use the orders batch list. Each queue is also an order custom field, so you can show it as a column and use it in Advanced Search. Save a search for each queue you work from.

Queue membership as a custom field#

The Order Workflow module exposes every queue as a checkbox custom field on the order, with the queue code as the field code. That’s how queue membership appears everywhere else:

  • In order JSON (OrderList_Load_Query, webhooks), under CustomField_Values:orderworkflow:<queue code>, with the value "1" when the order is in the queue and "" when it isn’t.
  • In conditions, as order:CustomField_Values:orderworkflow:<queue code>.
  • In search filters, where the queue field supports Yes (in the queue) and No (not in the queue).

Setting the field (for example with the Set Custom Field action, or OrderCustomFields_Update) adds or removes the order: a true value adds it and a false or empty value removes it.

The module also adds a read-only Audit Log order field (auditlog), which records payment and void actions.

Pull orders from a queue#

External systems read a queue with QueueOrderList_Load_Query and confirm receipt with OrderList_Acknowledge. See Retrieving orders from a queue.