Setup
On first use, read setup.md for integration guidelines.
When to Use
User needs to integrate Paddle for SaaS payments. Agent handles API calls, webhook verification, checkout setup, subscription management, and tax compliance configuration.
Architecture
Memory lives in ~/paddle/. See memory-template.md for structure.
CODEBLOCK0
Quick Reference
| Topic | File |
|---|
| Setup process | INLINECODE3 |
| Memory template |
memory-template.md |
| API endpoints |
api.md |
| Webhook handling |
webhooks.md |
Core Rules
1. Always Use Sandbox First
- - Test ALL integrations in sandbox before production
- Sandbox API: INLINECODE7
- Production API: INLINECODE8
- Never skip sandbox testing for payment flows
2. Verify Webhook Signatures
- - Every webhook MUST be verified before processing
- Use the webhook secret from Paddle dashboard
- Reject requests with invalid signatures immediately
- Log failed verifications for debugging
3. Handle Subscription States Correctly
| State | Meaning | Action |
|---|
| INLINECODE9 | Paying customer | Grant access |
| INLINECODE10 |
In trial period | Grant access, remind before end |
|
past_due | Payment failed | Retry period, warn user |
|
paused | User paused | Restrict access, allow resume |
|
canceled | Subscription ended | Revoke access at period end |
4. Store Paddle IDs Correctly
- -
customer_id (ctmxxx) — unique per customer - INLINECODE15 (subxxx) — unique per subscription
- INLINECODE16 (txnxxx) — unique per payment
- INLINECODE17 (prixxx) — your pricing configuration
- Map these to your internal user/subscription records
5. Use Paddle Retain for Dunning
- - Enable Paddle Retain in dashboard for failed payments
- It handles retry logic and customer communication
- Track
subscription.past_due events but let Paddle retry first - Only take action after
subscription.canceled from failed payments
Common Traps
- - Hardcoding price IDs → Use environment variables, prices change between sandbox/production
- Processing webhooks without verification → Security vulnerability, anyone can fake events
- Ignoring
past_due state → User loses access during retry window, bad UX - Not handling proration → Confusing charges when users upgrade/downgrade mid-cycle
- Testing with production keys → Real charges, angry customers, refund headaches
External Endpoints
| Endpoint | Data Sent | Purpose |
|---|
| https://api.paddle.com | Customer data, subscription info | Payment processing |
| https://sandbox-api.paddle.com |
Test customer data | Sandbox testing |
No other data is sent externally.
Security & Privacy
Data that leaves your machine:
- - Customer email and name sent to Paddle for billing
- Payment amounts and subscription details
- IP addresses for tax calculation
Data that stays local:
- - API keys stored in environment variables
- Webhook secrets never logged
- Internal user mappings
This skill does NOT:
- - Store credit card numbers (Paddle handles PCI compliance)
- Access payment methods directly
- Share customer data with third parties beyond Paddle
Trust
By using this skill, customer and payment data is sent to Paddle.
Only install if you trust Paddle with your billing data.
Related Skills
Install with
clawhub install <slug> if user confirms:
- -
billing — General billing patterns - INLINECODE23 — Payment processing
- INLINECODE24 — Subscription management
Feedback
- - If useful: INLINECODE25
- Stay updated: INLINECODE26
设置
首次使用时,请阅读 setup.md 了解集成指南。
使用时机
用户需要通过Paddle集成SaaS支付。智能体负责处理API调用、Webhook验证、结账设置、订阅管理以及税务合规配置。
架构
记忆文件存储在 ~/paddle/ 目录下。结构请参考 memory-template.md。
~/paddle/
├── memory.md # API密钥、环境、产品ID
└── webhooks.md # Webhook端点与事件处理
快速参考
memory-template.md |
| API端点 | api.md |
| Webhook处理 | webhooks.md |
核心规则
1. 始终优先使用沙箱环境
- - 所有集成在上线前必须在沙箱环境中测试
- 沙箱API:https://sandbox-api.paddle.com
- 生产API:https://api.paddle.com
- 支付流程绝不能跳过沙箱测试
2. 验证Webhook签名
- - 每个Webhook在处理前必须验证
- 使用Paddle控制面板中的Webhook密钥
- 签名无效的请求立即拒绝
- 记录验证失败的日志以便调试
3. 正确处理订阅状态
| 状态 | 含义 | 操作 |
|---|
| active | 付费用户 | 授予访问权限 |
| trialing |
试用期 | 授予访问权限,到期前提醒 |
| past_due | 支付失败 | 重试期,警告用户 |
| paused | 用户暂停 | 限制访问,允许恢复 |
| canceled | 订阅结束 | 周期结束时撤销访问权限 |
4. 正确存储Paddle ID
- - customerid (ctmxxx) — 每个客户唯一
- subscriptionid (subxxx) — 每个订阅唯一
- transactionid (txnxxx) — 每笔支付唯一
- priceid (prixxx) — 你的定价配置
- 将这些ID映射到你的内部用户/订阅记录
5. 使用Paddle Retain处理催款
- - 在控制面板中启用Paddle Retain处理支付失败
- 它负责重试逻辑和客户沟通
- 跟踪 subscription.past_due 事件,但让Paddle先重试
- 仅在支付失败导致 subscription.canceled 后采取行动
常见陷阱
- - 硬编码价格ID → 应使用环境变量,沙箱和生产环境的价格不同
- 未验证就处理Webhook → 安全漏洞,任何人都可以伪造事件
- 忽略 past_due 状态 → 用户在重试期间失去访问权限,体验差
- 未处理按比例分配 → 用户在周期中途升级/降级时产生混乱的收费
- 使用生产密钥测试 → 产生真实扣费、引发客户投诉、退款麻烦
外部端点
| 端点 | 发送的数据 | 用途 |
|---|
| https://api.paddle.com | 客户数据、订阅信息 | 支付处理 |
| https://sandbox-api.paddle.com |
测试客户数据 | 沙箱测试 |
不会向外部发送其他数据。
安全与隐私
离开你机器的数据:
- - 发送给Paddle用于计费的客户邮箱和姓名
- 支付金额和订阅详情
- 用于税务计算的IP地址
保留在本地的数据:
- - 存储在环境变量中的API密钥
- Webhook密钥永不记录
- 内部用户映射关系
此技能不会:
- - 存储信用卡号(Paddle负责PCI合规)
- 直接访问支付方式
- 将客户数据分享给Paddle以外的第三方
信任
使用此技能即表示将客户和支付数据发送给Paddle。
仅在你信任Paddle处理你的计费数据时才安装。
相关技能
如果用户确认,使用 clawhub install 安装:
- - billing — 通用计费模式
- payments — 支付处理
- subscriptions — 订阅管理
反馈
- - 如果觉得有用:clawhub star paddle
- 保持更新:clawhub sync