MixR Agent API
v1Build intelligent shopping agents with MixR's comprehensive API
https://mixr.gg/server/api/v1/agentTry the MixR Agent
Test the Agent API with our interactive tool. Experiment with different checkout flows and see real-time responses.
Open Agent ToolOverview
The MixR Agent API enables developers to build intelligent shopping agents that can browse products, create checkout intents, and complete purchases on behalf of users. The API supports two checkout flows: Rye Universal Checkout for external retailers and Native Checkout for MixR catalog products.
Agent Capabilities
Get Agent Capabilities
Retrieve the current capabilities of the agent API. This endpoint provides information about supported payment methods, fulfillment types, and future capabilities.
/v1/agent/capabilitiesrequiresHumanPayment to determine if human payment authorization is needed. Check supportedPaymentAuthorizationTypes to see available payment methods.requiresHumanPayment- Whether human payment authorization is currently requiredsupportedPaymentAuthorizationTypes- Payment authorization types currently supportedsupportedFulfillmentTypes- Fulfillment types availablesupportedCheckoutTypes- Checkout types supportedfutureCapabilities- Capabilities planned for future releases
Quick Start Guide
Understanding walletAddress vs buyer Details
- User provides their
walletAddressto the agent - Agent includes
walletAddressin API requests - API automatically fetches buyer details (name, email, phone, address) from user's stored profile
- No need to collect or send buyer information - just send walletAddress
- User does not have a MixR account or wallet address
- Agent collects buyer details directly from user (via conversation/input)
- Agent includes complete
buyerobject in API requests - Must provide all required buyer fields (firstName, lastName, email, phone, address, etc.)
Choosing Your Checkout Flow
Rye Universal Checkout
Use when purchasing from external retailers (Amazon, Walmart, Target, etc.)
Flow: Browse → Get Product → Create Intent → Confirm Payment → Save Order
Native Checkout
Use when purchasing MixR catalog products with variant IDs
Flow: Browse → Create Cart → Prepare Checkout → Submit Payment
Essential Steps for Agents
For Rye Universal Checkout:
- Get product
urlfrom product response - Get buyer details:
- MixR Platform Users: Provide
walletAddressto auto-fill buyer details - External/Guest Users: Provide complete buyer information
- MixR Platform Users: Provide
- Create checkout intent with
productUrland buyer info (orwalletAddress) - Check
purchaseIntent.intentState- if"awaiting_payment", proceed - Confirm with payment authorization
- Save order details
For Native Checkout:
- Get
variantIdfrom product variants - Create cart:
- MixR Platform Users: Include
walletAddressto link cart to account - Anonymous/Guest Users: Omit
walletAddress, cart created as guest
- MixR Platform Users: Include
- Prepare checkout with buyer details:
- MixR Users with walletAddress: Details auto-filled, just use
autoSelectShipping: true - Anonymous Users: Provide complete buyer information with
autoSelectShipping: true
- MixR Users with walletAddress: Details auto-filled, just use
- Check
readyForCheckout- iftrue, proceed - Submit payment
purchaseIntent.intentState- Authoritative state for decision-makingpurchaseIntent.nextActionRequired- What action to take nextreadyForCheckout- Whether checkout is ready (Native only)
Product Browsing
List Products
Browse and search products available on MixR
/v1/agent/productskeyword- Search keywordcategory- Filter by categorypriceMin/priceMax- Price range in centspage/limit- Pagination
agentMetadata.isPurchasable to filter purchasable products. Extract url for Rye checkout or variants[].id for Native checkout.Get Single Product
Retrieve detailed information about a specific product
/v1/agent/products/:idCheckout (Rye Universal)
walletAddress Parameter - Complete Reference
The walletAddress parameter allows MixR platform users to automatically fetch their stored buyer details. Here's how it works across all endpoints:
| Endpoint | Method | walletAddress Location | Required? | Effect |
|---|---|---|---|---|
| /v1/agent/checkout | POST | Request Body | No (optional) | Auto-fills all buyer details from user profile |
| /v1/agent/checkout/:id | GET | Query Parameter | No (optional) | Includes buyer details in response |
| /v1/agent/checkout/:id/confirm | POST | Request Body | No (optional) | For tracking purposes (MixR users) |
| /v1/agent/native/cart | POST | Request Body | No (optional) | Links cart to user account |
| /v1/agent/native/checkout/prepare | POST | Request Body | No (optional) | Auto-fills all buyer details from user profile |
| /v1/agent/native/checkout/submit | POST | Request Body | No (optional) | For tracking purposes (MixR users) |
| /v1/agent/native/checkout/:id/status | GET | Query Parameter | No (optional) | For tracking purposes (MixR users) |
| /v1/agent/orders/save | POST | Request Body | No (optional) | Auto-fills all buyer details from user profile |
- POST endpoints: Include
walletAddressin the request body - GET endpoints: Include
walletAddressas a query parameter (e.g.,?walletAddress=0x...) - When provided: All buyer details are automatically filled from user's stored profile
- When omitted: Complete buyer information must be provided in the
buyerobject
How Agents Get Buyer Details
If the user is a MixR platform user with a wallet address, simply provide walletAddress in the request. All buyer details are automatically filled from the user's profile and default shipping address stored on MixR. No need to send buyer object - just send walletAddress and the API handles everything.
If the user is not a MixR user (external/guest checkout), collect buyer details directly from the user (via conversation/input). The agent then includes complete buyer information in the buyer object.
Create Checkout Intent
Creates a checkout intent with Rye Universal Checkout using a product URL
/v1/agent/checkoutproductUrl(required) - Product URL from supported retailerquantity(required) - Quantity to purchase (minimum: 1)walletAddress(optional) - Wallet address for MixR users (auto-fills buyer details)buyer(conditionally required) - Buyer information (required if walletAddress not provided)
{
"productUrl": "https://www.amazon.com/dp/B08N5WRWNW",
"quantity": 1,
"walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
}{
"productUrl": "https://www.amazon.com/dp/B08N5WRWNW",
"quantity": 1,
"buyer": {
"firstName": "John",
"lastName": "Doe",
"email": "john@example.com",
"phone": "+15551234567",
"address1": "123 Main Street",
"city": "San Francisco",
"province": "CA",
"country": "US",
"postalCode": "94102"
}
}purchaseIntent.intentState. If "awaiting_payment", proceed to confirm endpoint.Get Checkout Intent
Retrieves the current state of a checkout intent
/v1/agent/checkout/:checkoutIntentIdwalletAddress(optional) - If provided, buyer details are included in response (MixR users only)
GET /v1/agent/checkout/ci_abc123?walletAddress=0x742d35Cc...Confirm Checkout Intent
Confirms payment and completes the order
/v1/agent/checkout/:checkoutIntentId/confirmwalletAddress(optional) - Wallet address for tracking purposes (MixR users)paymentAuthorization(required) - Payment authorization object
{
"walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"paymentAuthorization": {
"type": "stripe_token",
"token": "tok_visa_4242424242424242"
}
}purchaseIntent.intentState after confirmation. If "completed", proceed to save order. If "processing", wait and check status. If "failed", handle error.Native Checkout
Key Advantages
- Optimized Flow: Combines address + shipping fetch + shipping selection in one call
- Auto-Selection: Option to automatically select first shipping method
- Reduced API Calls: Fewer round trips compared to Rye Universal Checkout
- Native Integration: Uses MixR's cart system directly
- Supports Both User Types: Works for both MixR platform users and anonymous/guest users
Create Native Cart
Creates a cart and adds items for native checkout
/v1/agent/native/cartitems(required) - Array of items with variantId and quantitywalletAddress(optional) - Links cart to user account (MixR users only)agentSessionId(optional) - Agent session identifier
{
"items": [
{
"variantId": "variant_123",
"quantity": 1
}
],
"walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
}cartId from response - required for all subsequent native checkout calls. walletAddress is optional - provide it for MixR users to link cart to their account (enables features like order history). For anonymous/guest users, omit walletAddress and provide buyer details in the prepare checkout step.Prepare Native Checkout
Combines multiple steps in one call: Adds shipping address, fetches shipping options, and optionally auto-selects shipping methods.
/v1/agent/native/checkout/preparecartId(required) - Cart ID from create cart responsewalletAddress(optional) - Auto-fills all buyer details from user profile (MixR users)buyer(conditionally required) - Required if walletAddress not providedautoSelectShipping(optional) - Auto-selects first shipping method (default: false)
{
"cartId": "42",
"walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"autoSelectShipping": true
}autoSelectShipping: true to automatically select first shipping method. Check readyForCheckout - if true, proceed to submit endpoint.walletAddress is provided (MixR users), the buyer object is completely optional. All buyer details are automatically fetched from the user's profile. For anonymous users, omit walletAddress and provide complete buyer details.Submit Native Checkout
Submits payment and completes the checkout
/v1/agent/native/checkout/submitcartId(required) - Cart IDwalletAddress(optional) - For tracking purposes (MixR users)payment(required) - Payment authorization objectagentSessionId(optional) - Agent session identifier
{
"cartId": "42",
"walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"payment": {
"type": "stripe_token",
"token": "tok_visa_4242424242424242"
}
}status field in response. If "SUCCEEDED", order is complete. If "PROCESSING", check status endpoint.Get Native Checkout Status
Retrieves the current status of a checkout
/v1/agent/native/checkout/:cartId/statuswalletAddress(optional) - Wallet address for tracking purposes (MixR users)
GET /v1/agent/native/checkout/42/status?walletAddress=0x742d35Cc...Order Management
Save Order
Saves order details to the database after successful checkout
/v1/agent/orders/savecheckoutIntentId(required) - Rye checkout intent IDwalletAddress(optional) - Auto-fills all buyer details from user profile (MixR users)buyer(conditionally required) - Required if walletAddress not providedproduct(required) - Product informationpricing(required) - Pricing structureorderState(required) - Must match purchaseIntent.intentState
orderState field must match the final purchaseIntent.intentState from the checkout intent. Mismatch will result in ORDER_STATE_MISMATCH error.walletAddress is provided (for MixR users), the buyer object is completely optional. All buyer details are automatically fetched from the user's profile stored on MixR platform.Error Handling
Error Response Format
{
"error": "Human-readable error message",
"errorCode": "MACHINE_READABLE_CODE",
"details": "Additional technical details (optional)"
}Common Error Codes
PAYMENT_REQUIREDPayment authorization is required
CHECKOUT_NOT_READYCheckout intent creation failed
INVALID_BUYER_INFOBuyer information is invalid or incomplete
INVALID_PAYMENT_AUTHORIZATIONPayment authorization format is invalid
PRODUCT_UNAVAILABLEProduct is not available for purchase
INVALID_PRODUCT_URLProduct URL is invalid or unsupported
ADDRESS_REQUIREDShipping address is required
SHIPPING_NOT_SELECTEDShipping method must be selected
CHECKOUT_FAILEDCheckout processing failed
INTENT_NOT_FOUNDCheckout intent not found
ORDER_STATE_MISMATCHOrder state does not match purchase intent
INTERNAL_ERRORInternal server error
VALIDATION_ERRORRequest validation failed
Important Notes for Agents
Wallet Address and Buyer Details
- From MixR User Wallet Address (Recommended for MixR Users):
- If the user is a MixR platform user, use their
walletAddress - Provide
walletAddressin request body (POST) or query parameter (GET) - The API automatically fetches buyer details from the user's profile and default shipping address stored on MixR platform
- This ensures data consistency and reduces the need to collect information from users
- If the user is a MixR platform user, use their
- Direct Collection from External/Guest Users:
- If the user is not a MixR user (external/guest checkout), collect buyer details directly from the user
- Ask the user for: name, email, phone, and shipping address
- Include complete buyer information in the request body
- The agent is responsible for data validation and formatting
- Just provide walletAddress - all buyer details are automatically fetched from user's profile and default shipping address on MixR platform
- No need to send buyer object - the API handles everything automatically
- Buyer object is completely optional when walletAddress is provided
- If you do provide buyer fields, they override the auto-filled data (useful for using a different address)
- If walletAddress is not provided, complete buyer information must be included in the buyer object
Decision-Making Fields
"created"→ Wait, system preparing"awaiting_payment"→ Ready for payment"processing"→ Payment processing, wait"completed"→ Success, proceed to save order"failed"→ Handle error
"awaiting_human_payment"→ Submit payment"awaiting_offer_preparation"→ Wait for system"processing_payment"→ Wait for processing"none"→ No action needed (completed)"retry_or_cancel"→ Handle failure
true→ Proceed to paymentfalse→ Shipping not selected (shouldn't happen with autoSelectShipping: true)
Optimization Tips
- Use walletAddress: For MixR users, use
walletAddressto reduce request payload size and ensure consistency - Native Checkout: Always use
autoSelectShipping: truein prepare step - Save IDs: Always save
checkoutIntentId(Rye) orcartId(Native) after creation - Check states: Always verify
purchaseIntent.intentStatebefore proceeding - Error Handling: Check
errorCodefield for programmatic error handling
Required Formats
- Phone: Exactly 12 characters, format
+1XXXXXXXXXX(e.g., +15551234567) - Country: Currently only
USsupported - Payment: Use
paymentAuthorizationformat - Wallet Address: String format (Ethereum address), provided in request body (POST) or query parameter (GET) for MixR users
Order State Validation
When saving orders (POST /orders/save), orderState must match purchaseIntent.intentState:
- If intent state is
"completed"→ UseorderState: "SUCCEEDED" - If intent state is
"failed"→ UseorderState: "FAILED" - If intent state is
"processing"→ UseorderState: "PROCESSING"
Mismatch will result in ORDER_STATE_MISMATCH error.
For questions or issues with the Agent API, please contact the MixR development team.
API Version: v1 • Last Updated: 2024-12-15