stripe-automation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseStripe Automation via Rube MCP
通过Rube MCP实现Stripe自动化
Automate Stripe payment operations through Composio's Stripe toolkit via Rube MCP.
通过Composio的Stripe工具包,借助Rube MCP自动化Stripe支付操作。
Prerequisites
前提条件
- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)
- Active Stripe connection via with toolkit
RUBE_MANAGE_CONNECTIONSstripe - Always call first to get current tool schemas
RUBE_SEARCH_TOOLS
- 必须已连接Rube MCP(需提供RUBE_SEARCH_TOOLS)
- 通过激活Stripe连接,工具包为
RUBE_MANAGE_CONNECTIONSstripe - 请始终先调用以获取最新的工具架构
RUBE_SEARCH_TOOLS
Setup
设置步骤
Get Rube MCP: Add as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
https://rube.app/mcp- Verify Rube MCP is available by confirming responds
RUBE_SEARCH_TOOLS - Call with toolkit
RUBE_MANAGE_CONNECTIONSstripe - If connection is not ACTIVE, follow the returned auth link to complete Stripe connection
- Confirm connection status shows ACTIVE before running any workflows
获取Rube MCP:在客户端配置中添加作为MCP服务器。无需API密钥——只需添加端点即可使用。
https://rube.app/mcp- 确认可响应,以此验证Rube MCP是否可用
RUBE_SEARCH_TOOLS - 调用,指定工具包为
RUBE_MANAGE_CONNECTIONSstripe - 如果连接状态未显示为ACTIVE,请按照返回的授权链接完成Stripe连接
- 在运行任何工作流之前,确认连接状态为ACTIVE
Core Workflows
核心工作流
1. Manage Customers
1. 客户管理
When to use: User wants to create, update, search, or list Stripe customers
Tool sequence:
- - Search customers by email/name [Optional]
STRIPE_SEARCH_CUSTOMERS - - List all customers [Optional]
STRIPE_LIST_CUSTOMERS - - Create a new customer [Optional]
STRIPE_CREATE_CUSTOMER - - Update a customer [Optional]
STRIPE_POST_CUSTOMERS_CUSTOMER
Key parameters:
- : Customer email
email - : Customer name
name - : Customer description
description - : Key-value metadata pairs
metadata - : Customer ID for updates (e.g., 'cus_xxx')
customer
Pitfalls:
- Stripe allows duplicate customers with the same email; search first to avoid duplicates
- Customer IDs start with 'cus_'
适用场景:用户需要创建、更新、搜索或列出Stripe客户
工具序列:
- - 按邮箱/姓名搜索客户(可选)
STRIPE_SEARCH_CUSTOMERS - - 列出所有客户(可选)
STRIPE_LIST_CUSTOMERS - - 创建新客户(可选)
STRIPE_CREATE_CUSTOMER - - 更新客户信息(可选)
STRIPE_POST_CUSTOMERS_CUSTOMER
关键参数:
- :客户邮箱
email - :客户姓名
name - :客户描述
description - :键值对元数据
metadata - :用于更新的客户ID(例如:'cus_xxx')
customer
注意事项:
- Stripe允许存在相同邮箱的重复客户;请先搜索以避免重复
- 客户ID以开头
cus_
2. Manage Charges and Payments
2. 收费与支付管理
When to use: User wants to create charges, payment intents, or view charge history
Tool sequence:
- - List charges with filters [Optional]
STRIPE_LIST_CHARGES - - Create a payment intent [Optional]
STRIPE_CREATE_PAYMENT_INTENT - - Confirm a payment intent [Optional]
STRIPE_CONFIRM_PAYMENT_INTENT - - Create a direct charge [Optional]
STRIPE_POST_CHARGES - - Capture an authorized charge [Optional]
STRIPE_CAPTURE_CHARGE
Key parameters:
- : Amount in smallest currency unit (e.g., cents for USD)
amount - : Three-letter ISO currency code (e.g., 'usd')
currency - : Customer ID
customer - : Payment method ID
payment_method - : Charge description
description
Pitfalls:
- Amounts are in smallest currency unit (100 = $1.00 for USD)
- Currency codes must be lowercase (e.g., 'usd' not 'USD')
- Payment intents are the recommended flow over direct charges
适用场景:用户需要创建收费记录、支付意向或查看收费历史
工具序列:
- - 带筛选条件列出收费记录(可选)
STRIPE_LIST_CHARGES - - 创建支付意向(可选)
STRIPE_CREATE_PAYMENT_INTENT - - 确认支付意向(可选)
STRIPE_CONFIRM_PAYMENT_INTENT - - 创建直接收费记录(可选)
STRIPE_POST_CHARGES - - 捕获已授权的收费(可选)
STRIPE_CAPTURE_CHARGE
关键参数:
- :金额(以最小货币单位计,例如美元的美分)
amount - :三位ISO货币代码(例如:'usd')
currency - :客户ID
customer - :支付方式ID
payment_method - :收费描述
description
注意事项:
- 金额以最小货币单位计算(100 = 1.00美元)
- 货币代码必须为小写(例如:'usd'而非'USD')
- 推荐使用支付意向流程,而非直接收费
3. Manage Subscriptions
3. 订阅管理
When to use: User wants to create, list, update, or cancel subscriptions
Tool sequence:
- - List subscriptions [Optional]
STRIPE_LIST_SUBSCRIPTIONS - - Create subscription [Optional]
STRIPE_POST_CUSTOMERS_CUSTOMER_SUBSCRIPTIONS - - Get subscription details [Optional]
STRIPE_RETRIEVE_SUBSCRIPTION - - Modify subscription [Optional]
STRIPE_UPDATE_SUBSCRIPTION
Key parameters:
- : Customer ID
customer - : Array of price items (price_id and quantity)
items - : Subscription ID for retrieval/update (e.g., 'sub_xxx')
subscription
Pitfalls:
- Subscriptions require a valid customer with a payment method
- Price IDs (not product IDs) are used for subscription items
- Cancellation can be immediate or at period end
适用场景:用户需要创建、列出、更新或取消订阅
工具序列:
- - 列出订阅(可选)
STRIPE_LIST_SUBSCRIPTIONS - - 创建订阅(可选)
STRIPE_POST_CUSTOMERS_CUSTOMER_SUBSCRIPTIONS - - 获取订阅详情(可选)
STRIPE_RETRIEVE_SUBSCRIPTION - - 修改订阅信息(可选)
STRIPE_UPDATE_SUBSCRIPTION
关键参数:
- :客户ID
customer - :价格项数组(包含price_id和数量)
items - :用于查询/更新的订阅ID(例如:'sub_xxx')
subscription
注意事项:
- 订阅需要关联已添加支付方式的有效客户
- 订阅项使用价格ID(而非产品ID)
- 取消订阅可选择立即生效或在计费周期结束时生效
4. Manage Invoices
4. 发票管理
When to use: User wants to create, list, or search invoices
Tool sequence:
- - List invoices [Optional]
STRIPE_LIST_INVOICES - - Search invoices [Optional]
STRIPE_SEARCH_INVOICES - - Create an invoice [Optional]
STRIPE_CREATE_INVOICE
Key parameters:
- : Customer ID for invoice
customer - : 'charge_automatically' or 'send_invoice'
collection_method - : Days until invoice is due
days_until_due
Pitfalls:
- Invoices auto-finalize by default; use for draft invoices
auto_advance: false
适用场景:用户需要创建、列出或搜索发票
工具序列:
- - 列出发票(可选)
STRIPE_LIST_INVOICES - - 搜索发票(可选)
STRIPE_SEARCH_INVOICES - - 创建发票(可选)
STRIPE_CREATE_INVOICE
关键参数:
- :发票关联的客户ID
customer - :收费方式,可选'charge_automatically'或'send_invoice'
collection_method - :发票到期天数
days_until_due
注意事项:
- 发票默认自动定稿;若需草稿发票,请设置
auto_advance: false
5. Manage Products and Prices
5. 产品与价格管理
When to use: User wants to list or search products and their pricing
Tool sequence:
- - List products [Optional]
STRIPE_LIST_PRODUCTS - - Search products [Optional]
STRIPE_SEARCH_PRODUCTS - - List prices [Optional]
STRIPE_LIST_PRICES - - Search prices [Optional]
STRIPE_GET_PRICES_SEARCH
Key parameters:
- : Filter by active/inactive status
active - : Search query for search endpoints
query
Pitfalls:
- Products and prices are separate objects; a product can have multiple prices
- Price IDs (e.g., 'price_xxx') are used for subscriptions and checkout
适用场景:用户需要列出或搜索产品及其定价
工具序列:
- - 列出产品(可选)
STRIPE_LIST_PRODUCTS - - 搜索产品(可选)
STRIPE_SEARCH_PRODUCTS - - 列出价格(可选)
STRIPE_LIST_PRICES - - 搜索价格(可选)
STRIPE_GET_PRICES_SEARCH
关键参数:
- :按启用/禁用状态筛选
active - :搜索端点的查询语句
query
注意事项:
- 产品与价格是独立对象;一个产品可对应多个价格
- 订阅和结账使用价格ID(例如:'price_xxx')
6. Handle Refunds
6. 退款处理
When to use: User wants to issue refunds on charges
Tool sequence:
- - List refunds [Optional]
STRIPE_LIST_REFUNDS - - Create a refund [Optional]
STRIPE_POST_CHARGES_CHARGE_REFUNDS - - Create refund via payment intent [Optional]
STRIPE_CREATE_REFUND
Key parameters:
- : Charge ID for refund
charge - : Partial refund amount (omit for full refund)
amount - : Refund reason ('duplicate', 'fraudulent', 'requested_by_customer')
reason
Pitfalls:
- Refunds can take 5-10 business days to appear on customer statements
- Amount is in smallest currency unit
适用场景:用户需要对收费记录发起退款
工具序列:
- - 列出退款记录(可选)
STRIPE_LIST_REFUNDS - - 创建退款(可选)
STRIPE_POST_CHARGES_CHARGE_REFUNDS - - 通过支付意向创建退款(可选)
STRIPE_CREATE_REFUND
关键参数:
- :退款对应的收费ID
charge - :部分退款金额(留空则为全额退款)
amount - :退款原因(可选'duplicate'、'fraudulent'、'requested_by_customer')
reason
注意事项:
- 退款可能需要5-10个工作日才能显示在客户账单上
- 金额以最小货币单位计算
Common Patterns
通用模式
Amount Formatting
金额格式
Stripe uses smallest currency unit:
- USD: $10.50 = 1050 cents
- EUR: 10.50 = 1050 cents
- JPY: 1000 = 1000 (no decimals)
Stripe使用最小货币单位:
- 美元:$10.50 = 1050美分
- 欧元:10.50欧元 = 1050欧分
- 日元:1000日元 = 1000(无小数)
Pagination
分页处理
- Use parameter (max 100)
limit - Check in response
has_more - Pass with last object ID for next page
starting_after - Continue until is false
has_more
- 使用参数(最大值100)
limit - 检查响应中的字段
has_more - 传递参数,值为上一页最后一个对象的ID,以获取下一页数据
starting_after - 重复操作直到为false
has_more
Known Pitfalls
已知注意事项
Amount Units:
- Always use smallest currency unit (cents for USD/EUR)
- Zero-decimal currencies (JPY, KRW) use the amount directly
ID Prefixes:
- Customers: , Charges:
cus_, Subscriptions:ch_sub_ - Invoices: , Products:
in_, Prices:prod_price_ - Payment Intents: , Refunds:
pi_re_
金额单位:
- 始终使用最小货币单位(美元/欧元为分)
- 无小数货币(日元、韩元)直接使用金额数值
ID前缀:
- 客户:、收费:
cus_、订阅:ch_sub_ - 发票:、产品:
in_、价格:prod_price_ - 支付意向:、退款:
pi_re_
Quick Reference
快速参考
| Task | Tool Slug | Key Params |
|---|---|---|
| Create customer | STRIPE_CREATE_CUSTOMER | email, name |
| Search customers | STRIPE_SEARCH_CUSTOMERS | query |
| Update customer | STRIPE_POST_CUSTOMERS_CUSTOMER | customer, fields |
| List charges | STRIPE_LIST_CHARGES | customer, limit |
| Create payment intent | STRIPE_CREATE_PAYMENT_INTENT | amount, currency |
| Confirm payment | STRIPE_CONFIRM_PAYMENT_INTENT | payment_intent |
| List subscriptions | STRIPE_LIST_SUBSCRIPTIONS | customer |
| Create subscription | STRIPE_POST_CUSTOMERS_CUSTOMER_SUBSCRIPTIONS | customer, items |
| Update subscription | STRIPE_UPDATE_SUBSCRIPTION | subscription, fields |
| List invoices | STRIPE_LIST_INVOICES | customer |
| Create invoice | STRIPE_CREATE_INVOICE | customer |
| Search invoices | STRIPE_SEARCH_INVOICES | query |
| List products | STRIPE_LIST_PRODUCTS | active |
| Search products | STRIPE_SEARCH_PRODUCTS | query |
| List prices | STRIPE_LIST_PRICES | product |
| Search prices | STRIPE_GET_PRICES_SEARCH | query |
| List refunds | STRIPE_LIST_REFUNDS | charge |
| Create refund | STRIPE_CREATE_REFUND | charge, amount |
| Payment methods | STRIPE_LIST_CUSTOMER_PAYMENT_METHODS | customer |
| Checkout session | STRIPE_CREATE_CHECKOUT_SESSION | line_items |
| List payment intents | STRIPE_LIST_PAYMENT_INTENTS | customer |
| 任务 | 工具标识 | 关键参数 |
|---|---|---|
| 创建客户 | STRIPE_CREATE_CUSTOMER | email, name |
| 搜索客户 | STRIPE_SEARCH_CUSTOMERS | query |
| 更新客户 | STRIPE_POST_CUSTOMERS_CUSTOMER | customer, fields |
| 列出收费记录 | STRIPE_LIST_CHARGES | customer, limit |
| 创建支付意向 | STRIPE_CREATE_PAYMENT_INTENT | amount, currency |
| 确认支付 | STRIPE_CONFIRM_PAYMENT_INTENT | payment_intent |
| 列出订阅 | STRIPE_LIST_SUBSCRIPTIONS | customer |
| 创建订阅 | STRIPE_POST_CUSTOMERS_CUSTOMER_SUBSCRIPTIONS | customer, items |
| 更新订阅 | STRIPE_UPDATE_SUBSCRIPTION | subscription, fields |
| 列出发票 | STRIPE_LIST_INVOICES | customer |
| 创建发票 | STRIPE_CREATE_INVOICE | customer |
| 搜索发票 | STRIPE_SEARCH_INVOICES | query |
| 列出产品 | STRIPE_LIST_PRODUCTS | active |
| 搜索产品 | STRIPE_SEARCH_PRODUCTS | query |
| 列出价格 | STRIPE_LIST_PRICES | product |
| 搜索价格 | STRIPE_GET_PRICES_SEARCH | query |
| 列出退款记录 | STRIPE_LIST_REFUNDS | charge |
| 创建退款 | STRIPE_CREATE_REFUND | charge, amount |
| 支付方式管理 | STRIPE_LIST_CUSTOMER_PAYMENT_METHODS | customer |
| 创建结账会话 | STRIPE_CREATE_CHECKOUT_SESSION | line_items |
| 列出支付意向 | STRIPE_LIST_PAYMENT_INTENTS | customer |