Overview
Rye’s API allows you to place Amazon orders entirely through backend TypeScript code. By offloading order processing to Rye, you can easily submit Amazon purchases for fulfillment via API calls. This guide covers the key steps in the process. For a complete TypeScript code example, check out our demo. Python documentation coming soon.Key Steps
- Create a Rye cart with the Amazon items (
createCart
mutation) - Collect payment from the customer based on the cart’s cost field
- Submit the Amazon order with the
submitCart
mutation
Pre-reqs:
- Make sure to replace
<Authorization>
,<Shopper-IP>
andPRODUCTION_PAYMENT_GATEWAY_HEADERS
with your actual values from the Rye Console. - Modify the product details, buyer identity, and credit card information as needed to suit your specific use case.
How to run:
To run this example, you’ll need to install the necessary dependencies using Yarn:index.ts
file contains the main logic for creating an order. It creates a new cart with an Amazon product, and submits the cart to create an order. The order submission status and response are logged to the console.