> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rye.com/llms.txt
> Use this file to discover all available pages before exploring further.
# Rye API: Enable Your Users to Buy Any Product
> Turn any product URL into a completed checkout. Rye handles pricing, tax, shipping, and order placement across thousands of merchants.
Turn any product URL into a completed checkout. Instantly retrieve price, tax, and shipping for any product, and let users buy without ever leaving your native AI experience.
## See Rye in Action
Watch a complete order flow β from product URL to purchase confirmation β all without leaving your app.
## How Universal Checkout Works
Under the hood, Rye validates product data, handles shipping and tax, and submits the order to the merchant. This diagram shows the steps we automate for you.
## The Challenge
Building commerce into AI apps isnβt just about linking to a product page. Each merchant has different rules and systems for:
* π Resolving the correct product URL
* π° Retrieving accurate pricing & availability
* π Selecting shipping methods
* π§Ύ Calculating taxes
* π Processing checkout securely
* π¦ Handling order tracking and latency
Without Rye, every one of these steps requires custom code and brittle integrations.
## The Rye Solution
With Ryeβs **Universal Checkout API**, you only provide:
* The **product URL** from any merchant
* The **buyer identity**
Rye handles the rest:
* β
Validate product data
* β
Manage shipping and tax calculations
* β
Submit the order to the merchant
* β
Relay order status back to you
This lets you focus on building the user experience, while we handle the messy ecommerce details.
## Cost Optimization
Rye also helps you reduce checkout costs automatically:
* **Automatic Promo Code Discovery** β Rye scans for and applies valid promo codes at checkout, lowering the final price without any extra work on your side. [Learn more β](/api-v2/promo-codes)
* **Price Constraints** β Set maximum-price thresholds so orders are only placed when they fall within your budget. [Learn more β](/api-v2/example-flows/single-step-checkout)
## Your First API Call
Hereβs how simple it is to create a Checkout Intent:
```bash curl theme={null}
curl --request POST \
--url https://staging.api.rye.com/api/v1/checkout-intents \
--header "Authorization: Basic $RYE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"buyer": {
"postalCode": "10001",
"country": "US",
"province": "NY",
"city": "New York",
"address2": "Apt 1",
"address1": "123 Main St",
"phone": "212-333-2121",
"email": "john.doe@example.com",
"lastName": "Doe",
"firstName": "John"
},
"productUrl": "https://flybyjing.com/collections/shop/products/the-big-boi",
"quantity": "1"
}'
```
```javascript TypeScript SDK theme={null}
import CheckoutIntents from 'checkout-intents';
const client = new CheckoutIntents({
apiKey: process.env['RYE_API_KEY'],
});
const checkoutIntent = await client.checkoutIntents.create({
buyer: {
address1: '123 Main St',
city: 'New York',
country: 'United States',
email: 'john.doe@example.com',
firstName: 'John',
lastName: 'Doe',
phone: '212-333-2121',
postalCode: '10001',
province: 'NY',
},
productUrl: 'https://flybyjing.com/collections/shop/products/the-big-boi',
quantity: 1,
});
```
```python Python SDK theme={null}
import os
from checkout_intents import CheckoutIntents
api_key = os.environ["RYE_API_KEY"]
client = CheckoutIntents(api_key)
checkout_intent = client.checkout_intents.create(
buyer={
"address1": "123 Main St",
"city": "New York",
"country": "US",
"email": "john.doe@example.com",
"first_name": "John",
"last_name": "Doe",
"phone": "212-333-2121",
"postal_code": "10001",
"province": "NY",
},
product_url="https://flybyjing.com/collections/shop/products/the-big-boi",
quantity=1,
)
```
Rye abstracts all the complexity. You send a URL and buyer info, we handle shipping, taxes, and order placement.
To dive into a working example, see the [Quickstart guide](/api-v2/example-flows/simple-checkout).
## Next Steps
Get your API key and place your first order.
Explore the Universal Checkout API