Methods to retrieve order details and convert the cart to an order.

When a cart is submitted, the newly created order will be returned. However, you can use this method if you need to get the order information separately. You can also retrieve an order with a checkout_id, allowing you to display order details from an email containing a link like https://my-store.com/order/{checkout_id}.

Returns order with the passed ID, or if no parameters are passed, the last order placed in the current session.

Get order details
await swell.cart.getOrder('878663b2fb4175b128e40de428cd7b0c')

When a customer has entered all the information needed to finalize their order, call this method to process their payment and convert the cart to an order.

Returns the newly created order.

Submit an order
await swell.cart.submitOrder()