Purchase products from Amazon through conversational checkout. Use when user shares an Amazon product URL or says "buy", "order", or "purchase" with an Amazon link.
Purchase products from Amazon through Rye checkout. Like having Alexa in your chat app.
Activate this skill when the user:
Before placing an order, tokenize the card with Stripe:
curl -s -X POST https://api.stripe.com/v1/tokens \
-u "pk_live_51LgDhrHGDlstla3fOYU3AUV6QpuOgVEUa1E1VxFnejJ7mWB4vwU7gzSulOsWQ3Q90VVSk1WWBzYBo0RBKY3qxIjV00LHualegh" \
-d "card[number]=4242424242424242" \
-d "card[exp_month]=12" \
-d "card[exp_year]=2027" \
-d "card[cvc]=123"
The response contains an id field - this is the token (e.g., tok_xxx). Use this token in Step 2.
curl -s -X POST https://api.rye.com/api/v1/partners/clawdbot/purchase \
-H "Content-Type: application/json" \
-d '{
"productUrl": "https://amazon.com/dp/B0xxx",
"quantity": 1,
"buyer": {
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]",
"phone": "+14155551234",
"address1": "123 Main St",
"city": "San Francisco",
"province": "CA",
"postalCode": "94102",
"country": "US"
},
"paymentMethod": {
"type": "STRIPE_TOKEN",
"token": "tok_xxx"
},
"constraints": {
"maxTotalPrice": 50000
}
}'
constraints.maxTotalPrice: The user's spending limit in cents (e.g. $500 = 50000). The API will reject the order if the total exceeds this. If the user said "no limit", omit the constraints field entirely.
User: Buy this for me https://amazon.com/dp/B0DJLKV4N9
You: I'll help you buy that Amazon item! Where should I ship it?
(Need: name, address, city, state, zip, email, phone)
User: John Doe, 123 Main St, San Francisco CA 94102, [email protected], +14155551234
You: Got it! What's your maximum purchase price? (I'll warn you if an order exceeds this)
Say "no limit" to skip this.
User: $500
You: Max set to $500. Now I need your card details.
Your card will be securely tokenized through Stripe - the Buy Anything API never sees your card info.
(Card number, expiry MM/YY, CVC)
User: 4242424242424242, 12/27, 123
You: Securely tokenizing your card with Stripe...
[Uses bash to run Stripe tokenization curl command]
You: Processing your order...
[Uses bash to run Rye API curl command with the Stripe token]
You: Order placed!
Total: $361.92 (includes 4% service fee)
Confirmation: RYE-ABC123
Would you like me to save your details for faster checkout next time?
Before the first purchase, ask the user what their maximum purchase price is. Store this in memory.
After first successful purchase (with user permission):