Marketplace and merchant state machines interaction

Edit on GitHub

When viewed independently of each other, the Marketplace and Merchant State Machines workflows look like this:

Marketplace State Machine workflow: Marketplace state machine workflow

Merchant State Machine workflow: Merchant state machine workflow

In this article, we’ll look into the process of how Marketplace and merchant state machines interfere and check what statuses are displayed in the Back Office to a Marketplace administrator, in the Merchant Portal to a merchant, and on the Storefront to a buyer.

Order item’s status progress: New

The process starts when a customer places an order. The Marketplace order obtains state New. State: New

The following table provides an overview of the statuses that are displayed at this step:

ROLE APPLICATION STATUS
Marketplace administrator Back Office New
Merchant Merchant Portal N/A
Customer Storefront Confirmed / Accepted

Order item’s status progress: Paid

Once the Marketplace administrator receives the payment, the state of the marketplace order item becomes Paid. The event could be triggered automatically when the payment was made in the marketplace system, or the payment confirmation is uploaded with data importers or manually in other circumstances.

Order item’s status progress: Paid

The following table provides an overview of the statuses that are displayed at this step:

ROLE APPLICATION STATUS
Marketplace administrator Back Office Paid
Merchant Merchant Portal N/A
Customer Storefront In Progress

Order item’s status progress: Canceled

After the payment has been made, the customer can still cancel the order during the period outlined by the Marketplace policies. The Marketplace provides the customer with a button on the Storefront to carry out that action. When the customer cancels the order, the state of the marketplace order item becomes Canceled.

Note

The Marketplace administrator can also cancel the order under exceptional circumstances.

Order item’s status progress: Canceled

The following table provides an overview of the statuses that are displayed at this step:

ROLE APPLICATION STATUS
Marketplace administrator Back Office Canceled
Merchant Merchant Portal N/A
Customer Storefront Canceled

Order item’s status progress: Refunded

When the order is canceled after the payment has been made, the Marketplace administrator has to refund the payment for the canceled order to the customer in full or partially. Once the refund has been made, the state of the Marketplace order item becomes Refunded. After issuing the refund, the Marketplace policies set time to elapse before the state of the order is automatically transferred to Closed.

Order item’s status progress: Refunded

The following table provides an overview of the statuses that are displayed at this step:

ROLE APPLICATION STATUS
Marketplace administrator Back Office Refunded
Merchant Merchant Portal N/A
Customer Storefront Refunded

Order item’s status progress: Sent to Merchant

When the system has payment confirmation, it performs the operations to split the marketplace order into one or several merchant orders. The state of the marketplace order item becomes Sent to Merchant. The merchant orders are created, and each of the items that they contain shows a state according to each Merchant’s state machine. The first state is New.

Order item’s status progress: Sent to Merchant

The following table provides an overview of the statuses that are displayed at this step:

ROLE APPLICATION STATUS
Marketplace administrator Back Office Sent to Merchant
Merchant Merchant Portal New
Customer Storefront In Progress

Order item’s status progress: Canceled by Merchant

Merchant can cancel the order for various reasons. The state of the merchant order item, in this case, will change to Canceled by Merchant. The Marketplace administrator also sees the updated state in the Back Office.

Order item’s status progress: Canceled by Merchant

The following table provides an overview of the statuses that are displayed at this step:

ROLE APPLICATION STATUS
Marketplace administrator Back Office Canceled
Merchant Merchant Portal Canceled by Merchant
Customer Storefront Canceled

Order item’s status progress: Shipped by Merchant

The merchant ships the item to the customer’s address. To input this information on Merchant Portal, the merchant triggers the event manually (the Shipped action button) or by importing of the new state via a CSV file. The item’s state on the merchant state machine moves to Shipped. The Marketplace administrator also needs to make use of this info. They need to see that the item was also shipped in the Marketplace state machine.

Order Item’s Status Progress: Shipped by Merchant

The following table provides an overview of the statuses that are displayed at this step:

ROLE APPLICATION STATUS
Marketplace administrator Back Office Shipped by Merchant
Merchant Merchant Portal Shipped
Customer Storefront Shipped Expected by <date>

Order item’s status progress: Delivered

After the shipment, the merchant tracks the delivery with the shipment carrier. When the item is delivered, the carrier notifies the merchant. The merchant triggers the Deliver event manually (Delivered action button) or automatically by uploading a CSV with the new state to the Merchant Portal. The Marketplace administrator also needs to be aware of this information. The state is also updated on the Marketplace state machine.

Order item’s status progress: Delivered

The following table provides an overview of the statuses that are displayed at this step:

ROLE APPLICATION STATUS
Marketplace administrator Back Office Delivered
Merchant Merchant Portal Delivered
Customer Storefront Delivered on <date>

Order item’s status progress: Closed

Marketplace applies a series of policies that let customers return items during a given period of time. When that period expires, the marketplace order item gets the Closed state. The Merchant administrator must also be aware of that expiration, and the state closed is also used on the Merchant state machine for the item.

Order item’s status progress: Closed

The following table provides an overview of the statuses that are displayed at this step:

ROLE APPLICATION STATUS
Marketplace administrator Back Office Delivered
Merchant Merchant Portal Delivered
Customer Storefront Delivered on <date>