capabilities.work

Storefront Add Item and Submit Order

A 3-step recipe with Swell. We can help you get access.

Recipe · 3 steps

Storefront Add Item and Submit Order

with Swell

Resolve a product, add it to the cart, then submit the order.

  1. Retrieve the product by slug to resolve its id.
  2. Add the resolved product to the session cart with the given quantity.
  3. Submit the current cart, converting it into an order.
What you'll need to have ready
  • publicKey: Public storefront key, prefixed with pk_.
  • slug: Product slug or id to add to the cart.
  • quantity: Quantity of the product to add.
For your developer

Arazzo workflow swell-io:storefront-add-item-and-submit-order, 3 operations: frontendGetProduct → frontendAddCartItem → frontendSubmitOrder. Specs on APIs.io.