360 Secure SkillHub
360 安全技能中心

Stripe API Actions

使用 STRIPE_SECRET_KEY 调用 Stripe 实时 REST API 执行写入类操作:创建客户、产品、价格、支付链接、退款,取消订阅,更新元数据。脚本基于 Python 标准库,每条写命令必须带 --confirm,并强调核对目标对象 ID、谨慎处理退款与取消订阅。

stanestane
stanestane
热度 31.96
最近更新 2026-05-18 11:48:57
分类:营销依赖:代码执行 / 第三方 API应用场景:财务 / API 集成 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add stripe-api-actions
Metadata
name
stripe-api-actions
description
Use Stripe's live REST API for authenticated write actions. Use when you need to create or update Stripe customers, products, prices, payment links, refunds, subscriptions, or metadata with a secret key supplied via STRIPE_SECRET_KEY. Keep this separate from read-only inspection when the task changes live billing or payment state.

Stripe API Actions

Use this skill for live Stripe write operations.

Quick start

  1. Set STRIPE_SECRET_KEY in the current shell environment.
  2. Read references/actions-and-safety.md for the supported write actions and example commands.
  3. Require --confirm on every write command.

Core workflow

1. Confirm scope

Before running a write action, identify exactly which Stripe object should change and what the expected result is.

2. Use explicit commands

Examples:

python skills/stripe-api-actions/scripts/stripe_actions.py create_customer --name "Alice" --email "alice@example.com" --confirm
python skills/stripe-api-actions/scripts/stripe_actions.py create_product --name "Monthly Plan" --confirm
python skills/stripe-api-actions/scripts/stripe_actions.py create_price --product prod_123 --unit-amount 900 --currency eur --interval month --confirm
python skills/stripe-api-actions/scripts/stripe_actions.py create_payment_link --price price_123 --quantity 1 --confirm
python skills/stripe-api-actions/scripts/stripe_actions.py create_refund --payment-intent pi_123 --amount 500 --reason requested_by_customer --confirm
python skills/stripe-api-actions/scripts/stripe_actions.py cancel_subscription sub_123 --invoice-now --prorate --confirm
python skills/stripe-api-actions/scripts/stripe_actions.py update_metadata /customers/cus_123 --metadata external_id=42 --confirm

3. Prefer narrow changes

Prefer creating or updating the minimum necessary object rather than bundling several unrelated changes into one step.

Safety rules

  • Do not store live Stripe secrets in skill files.
  • Require --confirm for every write action.
  • Be cautious with refunds and subscription cancellation.
  • If a task affects live money flow or billing state, double-check the target object IDs first.

Resources

  • scripts/stripe_actions.py — minimal authenticated Stripe write helper using Python standard library
  • references/actions-and-safety.md — supported actions, caveats, and example commands