stripe

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Stripe Billing Operations

Stripe账单支付操作

Execute billing and payment operations on Stripe: customers, products, invoices, payment links, subscriptions, refunds, and disputes.
MCP is optional. This skill works with MCP (auto), Stripe CLI, or Dashboard. See BACKENDS.md for execution options.
在Stripe上执行账单与支付操作:涵盖客户、产品、发票、支付链接、订阅、退款及争议处理。
MCP为可选组件。 该技能支持MCP(自动模式)、Stripe CLI或Dashboard。执行方式详情请查看BACKENDS.md

Three Hard Rules

三条硬性规则

  1. Read before write — Before creating customer/product/price, check if it already exists to avoid duplicates
  2. Money operations require confirmation — Refunds, subscription changes, dispute updates must be confirmed before execution
  3. When in doubt, search — If unsure about object ID or parameters, search first, don't guess
  1. 先查后建 — 创建客户/产品/定价前,需检查是否已存在同名对象,避免重复
  2. 资金操作需确认 — 退款、订阅变更、争议处理更新等操作执行前必须获得确认
  3. 存疑即查 — 若不确定对象ID或参数,先搜索确认,切勿猜测

Security Rules

安全规则

Operation TypeRule
Read (list, get, search)Execute directly
Create (customer, product, price, invoice)Check for duplicates first
Money (refund, subscription cancel/update, dispute)Display details → Await confirmation → Execute
ModeTest mode by default. Live requires explicit "live mode" + double confirmation
操作类型规则
读取(列表、获取、搜索)直接执行
创建(客户、产品、定价、发票)先检查是否重复
资金类(退款、订阅取消/更新、争议处理)展示详情 → 等待确认 → 执行
模式默认测试模式。生产模式需要明确指定“生产模式”并进行双重确认

Dangerous Actions (Require Confirmation)

危险操作(需确认)

Before executing these operations:
  1. Display — Show object ID and key fields
  2. Explain impact — Amount, timing, consequences
  3. Await confirmation — Wait for explicit "confirm"/"yes"/"proceed"
  4. Execute and receipt — Return result + object ID + status
ActionRisk
create_refund
Money leaves account
cancel_subscription
Revenue loss
update_subscription
Contract change
update_dispute
Legal implications
Example confirmation prompt:
About to execute refund:
- PaymentIntent: pi_xxx
- Amount: $50.00 (full amount)
- Reason: requested_by_customer

Reply "confirm" to proceed, or "cancel" to abort.
执行以下操作前:
  1. 展示详情 — 显示对象ID及关键字段
  2. 说明影响 — 说明金额、执行时间及后果
  3. 等待确认 — 等待用户明确回复“confirm”/“yes”/“proceed”
  4. 执行并反馈 — 返回执行结果、对象ID及状态
操作风险
create_refund
资金流出账户
cancel_subscription
收入损失
update_subscription
合同变更
update_dispute
法律影响
示例确认提示:
即将执行退款操作:
- PaymentIntent: pi_xxx
- 金额:50.00美元(全额)
- 原因:客户申请

请回复“confirm”继续,或“cancel”终止操作。

Common Workflows

常见工作流

Create Customer

创建客户

1. Search/list to check if customer exists (by email)
2. If not exists, create_customer(name, email, metadata)
3. Return cus_xxx + key info
1. 通过邮箱搜索/列出客户,检查是否已存在
2. 若不存在,执行create_customer(name, email, metadata)
3. 返回cus_xxx及关键信息

Create Product and Price

创建产品与定价

1. List products to check if already exists
2. create_product(name, description)
3. create_price(product=prod_xxx, unit_amount=cents, currency)
4. Return prod_xxx + price_xxx
1. 列出产品,检查是否已存在
2. 执行create_product(name, description)
3. 执行create_price(product=prod_xxx, unit_amount=cents, currency)
4. 返回prod_xxx + price_xxx

Create and Send Invoice

创建并发送发票

1. Confirm customer ID (list_customers if unknown)
2. create_invoice(customer=cus_xxx, collection_method, days_until_due)
3. create_invoice_item(invoice=inv_xxx, price=price_xxx, quantity)
4. finalize_invoice(invoice=inv_xxx)
5. Return inv_xxx + hosted_invoice_url
1. 确认客户ID(若未知则执行list_customers)
2. 执行create_invoice(customer=cus_xxx, collection_method, days_until_due)
3. 执行create_invoice_item(invoice=inv_xxx, price=price_xxx, quantity)
4. 执行finalize_invoice(invoice=inv_xxx)
5. 返回inv_xxx及hosted_invoice_url

Create Payment Link

创建支付链接

1. Confirm price ID (list_prices if unknown)
2. create_payment_link(line_items=[{price, quantity}])
3. Return payment link URL
1. 确认定价ID(若未知则执行list_prices)
2. 执行create_payment_link(line_items=[{price, quantity}])
3. 返回支付链接URL

Refund (Dangerous)

退款(危险操作)

1. list_payment_intents to find target payment
2. Display pi_xxx + amount + customer info
3. Request user confirmation
4. create_refund(payment_intent=pi_xxx, amount?, reason)
5. Return re_xxx + status
1. 执行list_payment_intents找到目标支付记录
2. 展示pi_xxx、金额及客户信息
3. 请求用户确认
4. 执行create_refund(payment_intent=pi_xxx, amount?, reason)
5. 返回re_xxx及状态

Cancel Subscription (Dangerous)

取消订阅(危险操作)

1. list_subscriptions(customer=cus_xxx) to find target
2. Display sub_xxx + status + next billing date
3. Ask: cancel immediately or at period end?
4. After confirmation, cancel_subscription(subscription=sub_xxx)
5. Return cancellation result
1. 执行list_subscriptions(customer=cus_xxx)找到目标订阅
2. 展示sub_xxx、状态及下次账单日期
3. 询问:立即取消还是到期后取消?
4. 获得确认后,执行cancel_subscription(subscription=sub_xxx)
5. 返回取消结果

Default Configuration

默认配置

  • Currency: Use user-specified; else use existing object's currency; else ask
  • Amount: Accept decimals, auto-convert to smallest unit (e.g., $19.99 → 1999)
  • Output: Object type + ID + key fields + next steps
  • 货币:优先使用用户指定的货币;若无则使用已有对象的货币;若仍未确定则询问用户
  • 金额:接受小数输入,自动转换为最小货币单位(例如:19.99美元 → 1999分)
  • 输出:对象类型 + ID + 关键字段 + 后续操作建议

Limitations

限制说明

These operations are NOT available via standard tools:
  • ❌ Create PaymentIntent / charge directly
  • ❌ Create subscription (only list/update/cancel)
  • ❌ Create Promotion Code (only coupon)
  • ❌ Delete objects
For these, use Dashboard or API directly.
以下操作无法通过标准工具执行:
  • ❌ 直接创建PaymentIntent / 发起扣款
  • ❌ 创建订阅(仅支持列出/更新/取消)
  • ❌ 创建促销码(仅支持优惠券)
  • ❌ 删除对象
如需执行上述操作,请直接使用Dashboard或API。

File-based Pipeline

基于文件的工作流

When integrating into multi-step workflows:
runs/<workflow>/active/<run_id>/
├── proposal.md                # Requirements / objective
├── context.json               # Known IDs (customer, invoice, etc.)
├── tasks.md                   # Checklist + approval gate
├── evidence/stripe-actions.md # Operations to execute (money ops written here first)
├── evidence/receipt.md        # Results + object IDs
└── logs/events.jsonl          # Optional tool call summary (no sensitive data)
集成到多步骤工作流时的目录结构:
runs/<workflow>/active/<run_id>/
├── proposal.md                # 需求/目标说明
├── context.json               # 已知对象ID(客户、发票等)
├── tasks.md                   # 任务清单 + 审批节点
├── evidence/stripe-actions.md # 待执行操作(资金类操作需先写入此文件)
├── evidence/receipt.md        # 执行结果 + 对象ID
└── logs/events.jsonl          # 可选:工具调用摘要(不含敏感数据)

Error Handling

错误处理

SituationAction
Object doesn't existSearch to find correct ID
Parameter errorCheck documentation for correct format
Insufficient permissionsCheck API key scope
Network errorRetry or check connection
场景处理方式
对象不存在搜索获取正确ID
参数错误查阅文档确认正确格式
权限不足检查API密钥权限范围
网络错误重试或检查连接

Related Files

相关文件

  • BACKENDS.md — Execution options (MCP/CLI/Dashboard)
  • SETUP.md — MCP configuration (optional)
  • tools.md — Detailed tool parameters
  • BACKENDS.md — 执行方式选项(MCP/CLI/Dashboard)
  • SETUP.md — MCP配置(可选)
  • tools.md — 详细工具参数