Order placement
Learn how Rye submits orders to merchants
A single Rye cart can contain products from multiple different stores. When you submit a cart using the submitCart
mutation Rye is responsible for splitting the cart into separate orders for each store and managing the lifecycle of each child order.
Order submission
When you submit an order using submitCart
, Rye will break up the cart into separate orders for each store and submit each one separately.
The Cart
object exposes a stores
field which contains a list of stores that the cart contains products from. You can use this to determine which stores will receive orders when you submit the cart.
Here are some scenarios to illustrate this more concretely. In this scenarios, we are assuming that the shoppers are submitting their cart using the Rye Pay library, but the same principles apply if you are using backend ordering.
Jack is buying a pair of shoes from his favorite influencer. The influencer runs a Shopify store that has been integrated with Rye via the Sync API. The shoes cost $50.
If a developer inspected the cart
, they would see only a single entry inside stores
. This indicates that the cart contains products from a single store.
When Jack submits his cart, Rye will charge Jack’s card $50 and place an order with the influencer’s Shopify store for $50. The order will be fulfilled by the influencer, and Jack will receive a single delivery.
Charges
For each store in the cart, Rye will create separate charge for each store. Rye’s charges will show up with the following format on the card statement:
Developer
Rye handles routing payments and tracking delivery updates for each order and combines the information into a single Checkout
resource. Developers are able to inspect the status of individual child orders by querying the orders
field on a Checkout
.
Additionally, Rye will also send out webhooks when child orders change their status. This allows developers to integrate with Rye’s order lifecycle and keep their own systems in sync with Rye.
Note that because submitting a single cart can involve multiple different merchants, submitting a cart is an asynchronous operation. While a Checkout
object will be immediately returned, it may not mean the underlying orders have successfully been placed. You should always inspect the orders
field on a Checkout
to determine the status of each child order.
Was this page helpful?