In this tutorial, you’ll understand how to use Rye’s Sell Anything API to create a cart, add products to it, and submit it for checkout.
Initialize GQL client with your API key
Add external product to Rye inventory
Fetch product data from Rye inventory
requestAmazonProductByURL
mutation’s response.Create a cart
Use a fragment
Add more products to your cart
addCartItems
mutation.Fetch cart shipping methods and cost
Update buyer identity
Submit your cart
Display the results of the transaction
checkoutByCartID
endpoint, or listen for Rye’s order update webhooks. In some cases there may have been some errors during the submission of the cart, and these can be inspected on the result
object.Errors can occur on the Cart level and the Store level:result.errors
will provide an array of errors related to submitting the cart with appropriate error messages and codesresult.cart.stores[idx].errors
will provide an array of errors related to submitting the order to the store with appropriate error messages and codesCart management
updateCartItems
mutation.deleteCartItems
mutation.removeCart
mutation.requestAmazonProductByURL
in this guide, but requestShopifyProductByURL
and requestStoreByURL
can also be used to add products to our product data catalog.