stripe-automation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Stripe 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
    RUBE_MANAGE_CONNECTIONS
    with toolkit
    stripe
  • Always call
    RUBE_SEARCH_TOOLS
    first to get current tool schemas
  • 必须已连接Rube MCP(需提供RUBE_SEARCH_TOOLS)
  • 通过
    RUBE_MANAGE_CONNECTIONS
    激活Stripe连接,工具包为
    stripe
  • 请始终先调用
    RUBE_SEARCH_TOOLS
    以获取最新的工具架构

Setup

设置步骤

Get Rube MCP: Add
https://rube.app/mcp
as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
  1. Verify Rube MCP is available by confirming
    RUBE_SEARCH_TOOLS
    responds
  2. Call
    RUBE_MANAGE_CONNECTIONS
    with toolkit
    stripe
  3. If connection is not ACTIVE, follow the returned auth link to complete Stripe connection
  4. Confirm connection status shows ACTIVE before running any workflows
获取Rube MCP:在客户端配置中添加
https://rube.app/mcp
作为MCP服务器。无需API密钥——只需添加端点即可使用。
  1. 确认
    RUBE_SEARCH_TOOLS
    可响应,以此验证Rube MCP是否可用
  2. 调用
    RUBE_MANAGE_CONNECTIONS
    ,指定工具包为
    stripe
  3. 如果连接状态未显示为ACTIVE,请按照返回的授权链接完成Stripe连接
  4. 在运行任何工作流之前,确认连接状态为ACTIVE

Core Workflows

核心工作流

1. Manage Customers

1. 客户管理

When to use: User wants to create, update, search, or list Stripe customers
Tool sequence:
  1. STRIPE_SEARCH_CUSTOMERS
    - Search customers by email/name [Optional]
  2. STRIPE_LIST_CUSTOMERS
    - List all customers [Optional]
  3. STRIPE_CREATE_CUSTOMER
    - Create a new customer [Optional]
  4. STRIPE_POST_CUSTOMERS_CUSTOMER
    - Update a customer [Optional]
Key parameters:
  • email
    : Customer email
  • name
    : Customer name
  • description
    : Customer description
  • metadata
    : Key-value metadata pairs
  • customer
    : Customer ID for updates (e.g., 'cus_xxx')
Pitfalls:
  • Stripe allows duplicate customers with the same email; search first to avoid duplicates
  • Customer IDs start with 'cus_'
适用场景:用户需要创建、更新、搜索或列出Stripe客户
工具序列
  1. STRIPE_SEARCH_CUSTOMERS
    - 按邮箱/姓名搜索客户(可选)
  2. STRIPE_LIST_CUSTOMERS
    - 列出所有客户(可选)
  3. STRIPE_CREATE_CUSTOMER
    - 创建新客户(可选)
  4. STRIPE_POST_CUSTOMERS_CUSTOMER
    - 更新客户信息(可选)
关键参数
  • email
    :客户邮箱
  • name
    :客户姓名
  • description
    :客户描述
  • metadata
    :键值对元数据
  • customer
    :用于更新的客户ID(例如:'cus_xxx')
注意事项
  • 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:
  1. STRIPE_LIST_CHARGES
    - List charges with filters [Optional]
  2. STRIPE_CREATE_PAYMENT_INTENT
    - Create a payment intent [Optional]
  3. STRIPE_CONFIRM_PAYMENT_INTENT
    - Confirm a payment intent [Optional]
  4. STRIPE_POST_CHARGES
    - Create a direct charge [Optional]
  5. STRIPE_CAPTURE_CHARGE
    - Capture an authorized charge [Optional]
Key parameters:
  • amount
    : Amount in smallest currency unit (e.g., cents for USD)
  • currency
    : Three-letter ISO currency code (e.g., 'usd')
  • customer
    : Customer ID
  • payment_method
    : Payment method ID
  • description
    : Charge 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
适用场景:用户需要创建收费记录、支付意向或查看收费历史
工具序列
  1. STRIPE_LIST_CHARGES
    - 带筛选条件列出收费记录(可选)
  2. STRIPE_CREATE_PAYMENT_INTENT
    - 创建支付意向(可选)
  3. STRIPE_CONFIRM_PAYMENT_INTENT
    - 确认支付意向(可选)
  4. STRIPE_POST_CHARGES
    - 创建直接收费记录(可选)
  5. STRIPE_CAPTURE_CHARGE
    - 捕获已授权的收费(可选)
关键参数
  • amount
    :金额(以最小货币单位计,例如美元的美分)
  • currency
    :三位ISO货币代码(例如:'usd')
  • customer
    :客户ID
  • payment_method
    :支付方式ID
  • description
    :收费描述
注意事项
  • 金额以最小货币单位计算(100 = 1.00美元)
  • 货币代码必须为小写(例如:'usd'而非'USD')
  • 推荐使用支付意向流程,而非直接收费

3. Manage Subscriptions

3. 订阅管理

When to use: User wants to create, list, update, or cancel subscriptions
Tool sequence:
  1. STRIPE_LIST_SUBSCRIPTIONS
    - List subscriptions [Optional]
  2. STRIPE_POST_CUSTOMERS_CUSTOMER_SUBSCRIPTIONS
    - Create subscription [Optional]
  3. STRIPE_RETRIEVE_SUBSCRIPTION
    - Get subscription details [Optional]
  4. STRIPE_UPDATE_SUBSCRIPTION
    - Modify subscription [Optional]
Key parameters:
  • customer
    : Customer ID
  • items
    : Array of price items (price_id and quantity)
  • subscription
    : Subscription ID for retrieval/update (e.g., 'sub_xxx')
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
适用场景:用户需要创建、列出、更新或取消订阅
工具序列
  1. STRIPE_LIST_SUBSCRIPTIONS
    - 列出订阅(可选)
  2. STRIPE_POST_CUSTOMERS_CUSTOMER_SUBSCRIPTIONS
    - 创建订阅(可选)
  3. STRIPE_RETRIEVE_SUBSCRIPTION
    - 获取订阅详情(可选)
  4. STRIPE_UPDATE_SUBSCRIPTION
    - 修改订阅信息(可选)
关键参数
  • customer
    :客户ID
  • items
    :价格项数组(包含price_id和数量)
  • subscription
    :用于查询/更新的订阅ID(例如:'sub_xxx')
注意事项
  • 订阅需要关联已添加支付方式的有效客户
  • 订阅项使用价格ID(而非产品ID)
  • 取消订阅可选择立即生效或在计费周期结束时生效

4. Manage Invoices

4. 发票管理

When to use: User wants to create, list, or search invoices
Tool sequence:
  1. STRIPE_LIST_INVOICES
    - List invoices [Optional]
  2. STRIPE_SEARCH_INVOICES
    - Search invoices [Optional]
  3. STRIPE_CREATE_INVOICE
    - Create an invoice [Optional]
Key parameters:
  • customer
    : Customer ID for invoice
  • collection_method
    : 'charge_automatically' or 'send_invoice'
  • days_until_due
    : Days until invoice is due
Pitfalls:
  • Invoices auto-finalize by default; use
    auto_advance: false
    for draft invoices
适用场景:用户需要创建、列出或搜索发票
工具序列
  1. STRIPE_LIST_INVOICES
    - 列出发票(可选)
  2. STRIPE_SEARCH_INVOICES
    - 搜索发票(可选)
  3. STRIPE_CREATE_INVOICE
    - 创建发票(可选)
关键参数
  • customer
    :发票关联的客户ID
  • collection_method
    :收费方式,可选'charge_automatically'或'send_invoice'
  • 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:
  1. STRIPE_LIST_PRODUCTS
    - List products [Optional]
  2. STRIPE_SEARCH_PRODUCTS
    - Search products [Optional]
  3. STRIPE_LIST_PRICES
    - List prices [Optional]
  4. STRIPE_GET_PRICES_SEARCH
    - Search prices [Optional]
Key parameters:
  • active
    : Filter by active/inactive status
  • query
    : Search query for search endpoints
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
适用场景:用户需要列出或搜索产品及其定价
工具序列
  1. STRIPE_LIST_PRODUCTS
    - 列出产品(可选)
  2. STRIPE_SEARCH_PRODUCTS
    - 搜索产品(可选)
  3. STRIPE_LIST_PRICES
    - 列出价格(可选)
  4. 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:
  1. STRIPE_LIST_REFUNDS
    - List refunds [Optional]
  2. STRIPE_POST_CHARGES_CHARGE_REFUNDS
    - Create a refund [Optional]
  3. STRIPE_CREATE_REFUND
    - Create refund via payment intent [Optional]
Key parameters:
  • charge
    : Charge ID for refund
  • amount
    : Partial refund amount (omit for full refund)
  • reason
    : Refund reason ('duplicate', 'fraudulent', 'requested_by_customer')
Pitfalls:
  • Refunds can take 5-10 business days to appear on customer statements
  • Amount is in smallest currency unit
适用场景:用户需要对收费记录发起退款
工具序列
  1. STRIPE_LIST_REFUNDS
    - 列出退款记录(可选)
  2. STRIPE_POST_CHARGES_CHARGE_REFUNDS
    - 创建退款(可选)
  3. STRIPE_CREATE_REFUND
    - 通过支付意向创建退款(可选)
关键参数
  • charge
    :退款对应的收费ID
  • amount
    :部分退款金额(留空则为全额退款)
  • reason
    :退款原因(可选'duplicate'、'fraudulent'、'requested_by_customer')
注意事项
  • 退款可能需要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
    limit
    parameter (max 100)
  • Check
    has_more
    in response
  • Pass
    starting_after
    with last object ID for next page
  • Continue until
    has_more
    is false
  • 使用
    limit
    参数(最大值100)
  • 检查响应中的
    has_more
    字段
  • 传递
    starting_after
    参数,值为上一页最后一个对象的ID,以获取下一页数据
  • 重复操作直到
    has_more
    为false

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:
    cus_
    , Charges:
    ch_
    , Subscriptions:
    sub_
  • Invoices:
    in_
    , Products:
    prod_
    , Prices:
    price_
  • Payment Intents:
    pi_
    , Refunds:
    re_
金额单位
  • 始终使用最小货币单位(美元/欧元为分)
  • 无小数货币(日元、韩元)直接使用金额数值
ID前缀
  • 客户:
    cus_
    、收费:
    ch_
    、订阅:
    sub_
  • 发票:
    in_
    、产品:
    prod_
    、价格:
    price_
  • 支付意向:
    pi_
    、退款:
    re_

Quick Reference

快速参考

TaskTool SlugKey Params
Create customerSTRIPE_CREATE_CUSTOMERemail, name
Search customersSTRIPE_SEARCH_CUSTOMERSquery
Update customerSTRIPE_POST_CUSTOMERS_CUSTOMERcustomer, fields
List chargesSTRIPE_LIST_CHARGEScustomer, limit
Create payment intentSTRIPE_CREATE_PAYMENT_INTENTamount, currency
Confirm paymentSTRIPE_CONFIRM_PAYMENT_INTENTpayment_intent
List subscriptionsSTRIPE_LIST_SUBSCRIPTIONScustomer
Create subscriptionSTRIPE_POST_CUSTOMERS_CUSTOMER_SUBSCRIPTIONScustomer, items
Update subscriptionSTRIPE_UPDATE_SUBSCRIPTIONsubscription, fields
List invoicesSTRIPE_LIST_INVOICEScustomer
Create invoiceSTRIPE_CREATE_INVOICEcustomer
Search invoicesSTRIPE_SEARCH_INVOICESquery
List productsSTRIPE_LIST_PRODUCTSactive
Search productsSTRIPE_SEARCH_PRODUCTSquery
List pricesSTRIPE_LIST_PRICESproduct
Search pricesSTRIPE_GET_PRICES_SEARCHquery
List refundsSTRIPE_LIST_REFUNDScharge
Create refundSTRIPE_CREATE_REFUNDcharge, amount
Payment methodsSTRIPE_LIST_CUSTOMER_PAYMENT_METHODScustomer
Checkout sessionSTRIPE_CREATE_CHECKOUT_SESSIONline_items
List payment intentsSTRIPE_LIST_PAYMENT_INTENTScustomer
任务工具标识关键参数
创建客户STRIPE_CREATE_CUSTOMERemail, name
搜索客户STRIPE_SEARCH_CUSTOMERSquery
更新客户STRIPE_POST_CUSTOMERS_CUSTOMERcustomer, fields
列出收费记录STRIPE_LIST_CHARGEScustomer, limit
创建支付意向STRIPE_CREATE_PAYMENT_INTENTamount, currency
确认支付STRIPE_CONFIRM_PAYMENT_INTENTpayment_intent
列出订阅STRIPE_LIST_SUBSCRIPTIONScustomer
创建订阅STRIPE_POST_CUSTOMERS_CUSTOMER_SUBSCRIPTIONScustomer, items
更新订阅STRIPE_UPDATE_SUBSCRIPTIONsubscription, fields
列出发票STRIPE_LIST_INVOICEScustomer
创建发票STRIPE_CREATE_INVOICEcustomer
搜索发票STRIPE_SEARCH_INVOICESquery
列出产品STRIPE_LIST_PRODUCTSactive
搜索产品STRIPE_SEARCH_PRODUCTSquery
列出价格STRIPE_LIST_PRICESproduct
搜索价格STRIPE_GET_PRICES_SEARCHquery
列出退款记录STRIPE_LIST_REFUNDScharge
创建退款STRIPE_CREATE_REFUNDcharge, amount
支付方式管理STRIPE_LIST_CUSTOMER_PAYMENT_METHODScustomer
创建结账会话STRIPE_CREATE_CHECKOUT_SESSIONline_items
列出支付意向STRIPE_LIST_PAYMENT_INTENTScustomer