Buy Anything
Purchase products from Amazon and Shopify stores through Rye checkout. Like having a personal shopper in your chat app.
When to Use
Activate this skill when the user:
- - Shares an Amazon product URL (amazon.com/dp/...)
- Shares a Shopify store product URL (any *.myshopify.com or custom-domain Shopify store)
- Says "buy", "order", or "purchase" with a product link
- Wants to buy something from an online store
IMPORTANT: How This Works
- - DO NOT try to fetch the product URL yourself with web_fetch or read tools
- The Rye API handles all product lookup - you just pass the URL
- You don't need to know product details before checkout
- Simply collect shipping address and set up the card, then call the API
- The Rye API validates the URL and returns product details — if the URL is unsupported or invalid, the API will return an error
Checkout Flow
- 1. User provides product URL - confirm you'll help them buy it
- Collect shipping address (or use saved address from memory)
- Set up card via BasisTheory (or use saved BT token from memory)
- Submit order to Rye API using bash (see Step 2)
- Show order confirmation from API response
- Save BT token/address to memory for future purchases (ask permission first)
Step 1: Secure Card Capture via BasisTheory
If the user does NOT have a saved BasisTheory token in memory, capture their card securely through the browser.
Try to open the card capture page in the user's browser:
CODEBLOCK0
If the command fails (e.g. unsupported platform), provide the URL as a clickable link instead: https://mcp.rye.com/bt-card-capture
Tell the user: "I've opened a secure card entry page in your browser. Please enter your card details there and click Submit. Your card info never touches this chat — it goes directly to BasisTheory's PCI-compliant vault. After submitting, copy the token shown on the page and paste it back here."
Wait for the user to paste the token (a UUID like d1ff0c32-...).
If the user already has a saved BT token in memory, skip this step entirely and use the saved token.
If a purchase fails with a CVC/CVV-related error (e.g. "Missing information", payment session issues), the saved token's CVC may have expired (BasisTheory clears CVC after 24 hours). Open the CVC refresh page:
CODEBLOCK1
If the command fails, provide the URL as a clickable link instead.
Tell the user: "Your saved card's security code has expired. I've opened a page to re-enter just your CVC — no need to re-enter the full card. Close the tab when done and I'll retry."
Then retry the purchase with the same saved token.
Step 2: Submit Order to Rye
The partner endpoint is authenticated by the partner path — no API key header is needed. Only requests to /partners/clawdbot/ are accepted.
CODEBLOCK2
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.
The POST response contains an id field (e.g. ci_abc123). Use this to poll for the order status.
Step 3: Poll for Order Status
After submitting the order, use the id from the POST response to poll for the final result:
CODEBLOCK3
Replace CHECKOUT_INTENT_ID with the actual ID (e.g. ci_abc123).
Poll every 5 seconds until the state is a terminal state. The response state will be one of:
- -
retrieving_offer — fetching product details and pricing (keep polling) - INLINECODE11 — order is being placed with the store (keep polling)
- INLINECODE12 — order placed successfully (stop polling)
- INLINECODE13 — order failed (stop polling)
When completed, show the user:
- - Product name from INLINECODE15
- Total from
offer.cost.total (format as dollars, value is in cents) - Order ID from
orderId (if present)
When failed, show failureReason.message to the user.
Pricing & Shipping
The API validates the store automatically. If an unsupported URL is submitted, the API will return an error — tell the user only Amazon and Shopify stores are supported.
- - Shopify stores: Standard store pricing — no markup from us
- Amazon: 3% fee to cover transaction costs
- Amazon orders under $15 have a $6.99 shipping charge
- Amazon orders $15 and above get free 2-day Prime shipping
- Amazon orders are processed through a 3rd party Amazon account (not the user's personal Amazon)
- User will receive an email with confirmation and order details
- For returns or refunds, direct the user to orders@rye.com
Example Conversation
CODEBLOCK4
Spending Limit
Before the first purchase, ask the user what their maximum purchase price is. Store this in memory.
- - If an order total (including any fees) exceeds the limit, warn the user and ask for confirmation
- User can say "no limit" to disable this check
Memory
Saved data is stored in Claude Code's local memory on the user's device only — it is never synced to the cloud, shared across devices, or accessible to other skills or agents.
After first successful purchase, only with explicit user permission:
- - Save the BasisTheory token ID to memory for future purchases (NOT raw card details — the token is an opaque ID that cannot be reversed into card numbers)
- Save shipping address to memory
- Save maximum purchase price to memory
- On subsequent purchases, reuse the saved BT token directly — no card entry needed
- Always confirm with the user before placing an order with a saved token — never place a purchase autonomously
Token revocation
- - Local deletion: If the user asks to remove their saved card, delete the token from memory immediately. This prevents future purchases through this skill.
- Vault revocation: To also revoke the token from BasisTheory's vault (so it cannot be used by any system), direct the user to contact orders@rye.com
- Users can delete all saved data at any time by asking to forget their card, address, and spending limit
购买任意商品
通过Rye结账系统从亚马逊和Shopify商店购买商品。就像在聊天应用中拥有一个私人购物助手。
使用时机
当用户出现以下情况时激活此技能:
- - 分享亚马逊商品链接(amazon.com/dp/...)
- 分享Shopify商店商品链接(任何*.myshopify.com或自定义域名的Shopify商店)
- 在提供商品链接时说出买、下单或购买
- 想从在线商店购买商品
重要提示:工作原理
- - 不要尝试使用web_fetch或读取工具自行获取商品链接
- Rye API处理所有商品查询——你只需传递链接即可
- 结账前无需了解商品详情
- 只需收集收货地址并设置卡片,然后调用API
- Rye API会验证链接并返回商品详情——如果链接不受支持或无效,API将返回错误
结账流程
- 1. 用户提供商品链接 - 确认你将帮助他们购买
- 收集收货地址(或使用记忆中保存的地址)
- 通过BasisTheory设置卡片(或使用记忆中保存的BT令牌)
- 使用bash向Rye API提交订单(参见步骤2)
- 显示API响应中的订单确认信息
- 将BT令牌/地址保存到记忆以供将来购买使用(先征得许可)
步骤1:通过BasisTheory安全获取卡片信息
如果用户记忆中未保存BasisTheory令牌,通过浏览器安全获取其卡片信息。
尝试在用户浏览器中打开卡片信息获取页面:
bash
open https://mcp.rye.com/bt-card-capture 2>/dev/null || xdg-open https://mcp.rye.com/bt-card-capture 2>/dev/null
如果命令失败(例如平台不支持),则提供可点击的链接:https://mcp.rye.com/bt-card-capture
告诉用户:我已在您的浏览器中打开了一个安全卡片信息输入页面。请在此页面输入您的卡片信息并点击提交。您的卡片信息不会经过此聊天——它将直接发送到BasisTheory符合PCI标准的保险库。提交后,请复制页面上显示的令牌并粘贴回此处。
等待用户粘贴令牌(UUID格式,如d1ff0c32-...)。
如果用户记忆中已保存BT令牌,则完全跳过此步骤,直接使用已保存的令牌。
如果购买因CVC/CVV相关错误失败(例如信息缺失、支付会话问题),已保存令牌的CVC可能已过期(BasisTheory在24小时后清除CVC)。打开CVC刷新页面:
bash
open https://mcp.rye.com/bt-cvc-refresh?tokenid=SAVEDTOKENID 2>/dev/null || xdg-open https://mcp.rye.com/bt-cvc-refresh?tokenid=SAVEDTOKENID 2>/dev/null
如果命令失败,则提供可点击的链接。
告诉用户:您已保存卡的安全码已过期。我已打开一个页面,您只需重新输入CVC——无需重新输入完整卡片信息。完成后关闭标签页,我将重试。
然后使用相同的已保存令牌重试购买。
步骤2:向Rye提交订单
合作伙伴端点通过合作伙伴路径进行身份验证——无需API密钥标头。仅接受对/partners/clawdbot/的请求。
bash
curl -s -X POST https://api.rye.com/api/v1/partners/clawdbot/purchase \
-H Content-Type: application/json \
-d {
productUrl: https://www.example-store.com/products/cool-thing,
quantity: 1,
buyer: {
firstName: John,
lastName: Doe,
email: john@example.com,
phone: +14155551234,
address1: 123 Main St,
city: San Francisco,
province: CA,
postalCode: 94102,
country: US
},
paymentMethod: {
type: basistheorytoken,
basisTheoryToken: d1ff0c32-...
},
constraints: {
maxTotalPrice: 50000
}
}
constraints.maxTotalPrice:用户的消费限额(以美分为单位,例如$500 = 50000)。如果总金额超过此限额,API将拒绝订单。如果用户说无限制,则完全省略constraints字段。
POST响应包含一个id字段(例如ci_abc123)。使用此ID轮询订单状态。
步骤3:轮询订单状态
提交订单后,使用POST响应中的id轮询最终结果:
bash
curl -s https://api.rye.com/api/v1/partners/clawdbot/purchase/CHECKOUTINTENTID
将CHECKOUTINTENTID替换为实际ID(例如ci_abc123)。
每5秒轮询一次,直到状态变为终态。响应中的state将为以下之一:
- - retrievingoffer — 正在获取商品详情和价格(继续轮询)
- placingorder — 正在向商店下单(继续轮询)
- completed — 订单已成功提交(停止轮询)
- failed — 订单失败(停止轮询)
当状态为completed时,向用户显示:
- - 商品名称(来自offer.product.title)
- 总金额(来自offer.cost.total,格式化为美元,值为美分)
- 订单ID(来自orderId,如果存在)
当状态为failed时,向用户显示failureReason.message。
定价与运费
API会自动验证商店。如果提交了不受支持的链接,API将返回错误——告知用户仅支持亚马逊和Shopify商店。
- - Shopify商店:标准商店定价——我们不加价
- 亚马逊:收取3%的费用以覆盖交易成本
- 亚马逊订单低于$15需支付$6.99运费
- 亚马逊订单$15及以上享受免费的两日达Prime配送
- 亚马逊订单通过第三方亚马逊账户处理(非用户个人亚马逊账户)
- 用户将收到包含确认信息和订单详情的电子邮件
- 如需退货或退款,引导用户联系orders@rye.com
示例对话
用户:帮我买这个 https://amazon.com/dp/B0DJLKV4N9
你:我来帮您购买!请问寄送到哪里?
(需要:姓名、地址、城市、州、邮编、邮箱、电话)
用户:John Doe, 123 Main St, San Francisco CA 94102, john@example.com, +14155551234
你:已记录!您的最高购买价格是多少?(如果订单超过此金额我会提醒您)
说无限制可跳过此设置。
用户:$500
你:最高限额设为$500。我现在在您的浏览器中打开一个安全卡片信息输入页面。
请在此页面输入您的卡片信息——您的卡片信息不会经过此聊天。
提交后,请复制页面上显示的令牌并粘贴回此处。
[打开 https://mcp.rye.com/bt-card-capture]
用户:d1ff0c32-a1b2-4c3d-8e4f-567890abcdef
你:已收到!正在提交您的订单...
[向购买API发送POST请求,附带BT令牌,收到ci_abc123]
你:订单已提交!正在等待确认...
[每5秒轮询GET /purchase/ci_abc123]
你:订单已确认!
商品:无线耳机Pro
总金额:$358.44(含3%服务费)
订单ID:RYE-ABC123
您希望我保存您的卡片令牌和地址,以便下次更快结账吗?
消费限额
在首次购买前,询问用户最高购买价格。将其存储在记忆中。
- - 如果订单总金额(含任何费用)超过限额,警告用户并请求确认
- 用户可以说无限制以禁用此检查
记忆
已保存的数据仅存储在用户设备上的Claude Code本地记忆中——永远不会同步到云端、跨设备共享或供其他技能或代理访问。
首次成功购买后,仅在获得用户明确许可的情况下:
- - 将BasisTheory令牌ID保存到记忆以供将来购买使用(不是原始卡片信息——令牌是一个不透明的ID,无法反向推导出卡号)
- 将收货地址保存到记忆
- 将最高购买价格保存到记忆
- 在后续购买中,直接重复使用已保存的BT令牌——无需再次输入卡片信息
- 使用已保存的令牌下单前,务必与用户确认——切勿自主执行购买
令牌撤销
- - 本地删除:如果用户要求删除已保存的卡片,立即从记忆中删除令牌。这将阻止通过此技能进行未来购买。
- 保险库撤销:如需同时从BasisTheory保险库撤销令牌(