简介
Maton 托管的 Gumroad API 集成方案,支持 OAuth 自动鉴权、产品管理、销售追踪、许可证验证及 Webhook 配置,适用于数字内容创作者自动化运营。
原始描述
Gumroad API integration with managed OAuth. Access products, sales, subscribers, licenses, and webhooks for your digital storefront. Use this skill when user...
通过你的 Agent 添加
安装目录:gumroad/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
Gumroad Skill 是一个由 Maton 提供的托管式 API 网关服务,旨在简化与 Gumroad 创作者平台的集成流程。用户无需自行处理复杂的 OAuth 2.0 授权流程,只需通过 Maton 获取统一的 API Key,即可调用完整的 Gumroad v2 API 功能。
该 Skill 覆盖创作者日常运营的核心场景:
- 账户与产品管理:获取用户信息、列出/更新产品、启用/禁用商品状态
- 销售与订阅分析:分页查询销售记录、查看订阅者状态与历史
- 优惠码与变体管理:创建限时优惠码、管理产品规格变体(如尺寸/版本)
- 许可证验证:验证软件许可证有效性、启用/禁用许可证、追踪使用次数
- Webhook 配置:订阅销售、退款、争议、订阅变更等事件通知
所有请求通过 https://api.maton.ai/gumroad/v2/ 代理转发,Maton 自动注入 OAuth Token,开发者仅需在请求头中携带 Authorization: Bearer $MATON_API_KEY。
显著优点
- 零 OAuth 维护成本:Maton 集中管理 Gumroad OAuth 连接的生命周期(创建、刷新、删除),开发者无需关心 Token 过期问题。
- 统一入口:通过单一 Maton API Key 可管理多个 Gumroad 账户的连接,适合代运营或多店铺场景。
- 完整功能覆盖:支持读取操作与写操作(产品更新、优惠码创建、许可证管理、Webhook 配置)。
- 多语言友好:提供 Python、JavaScript、Bash 等示例代码,降低接入门槛。
- 细粒度连接控制:支持通过
Maton-Connection 头指定特定连接,便于多账户场景下的精准操作。
潜在缺点与局限性
- 产品创建受限:无法通过 API 创建新产品,必须先在 Gumroad 网站手动创建,仅能后续管理。
- 表单编码格式:POST/PUT 请求强制使用
application/x-www-form-urlencoded 而非 JSON,与现代 REST 习惯存在摩擦。
- 价格单位混淆:价格以"美分"(cents)为单位,易因单位错误导致定价失误(如 500 表示 $5.00)。
- 单点依赖风险:所有流量经 Maton 代理转发,若 Maton 服务不可用则完全中断;同时需信任 Maton 处理敏感的销售数据。
- 写操作需人工确认:虽然文档声明写操作需用户明确批准,但实际自动化场景中可能增加交互复杂度。
- 分页机制原始:仅支持页码分页(page-based),无游标或时间戳偏移机制,大数据量场景效率受限。
适合人群
- 独立数字创作者:销售电子书、设计素材、软件授权、在线课程的 Gumroad 卖家
- 自动化运营开发者:需要定期同步销售数据、批量更新产品信息、自动化许可证验证的技术型创作者
- 多店铺管理代理:为多个客户管理 Gumroad 店铺的服务商或代理机构
- SaaS 集成商:需要将 Gumroad 销售数据同步至内部 CRM、财务系统或邮件营销平台的开发者
常规风险
风险类型
说明
密钥泄露
MATON_API_KEY 一旦泄露,攻击者可访问所有绑定的 Gumroad 账户数据;务必存储于安全环境变量或密钥管理系统
数据隐私
销售记录包含客户邮箱等 PII 数据,需遵守 GDPR/CCPA 等合规要求
误操作覆盖
更新产品、删除优惠码等操作不可逆,生产环境操作前建议测试
费率与限额
未明确说明 Maton 或 Gumroad 的 API 调用限额,高并发场景需关注 429 错误处理
Webhook 可靠性
自定义 Webhook 端点需自行保障可用性与安全性,防止接收伪造通知
Maton-Connection 头指定特定连接,便于多账户场景下的精准操作。- 产品创建受限:无法通过 API 创建新产品,必须先在 Gumroad 网站手动创建,仅能后续管理。
- 表单编码格式:POST/PUT 请求强制使用
application/x-www-form-urlencoded而非 JSON,与现代 REST 习惯存在摩擦。 - 价格单位混淆:价格以"美分"(cents)为单位,易因单位错误导致定价失误(如 500 表示 $5.00)。
- 单点依赖风险:所有流量经 Maton 代理转发,若 Maton 服务不可用则完全中断;同时需信任 Maton 处理敏感的销售数据。
- 写操作需人工确认:虽然文档声明写操作需用户明确批准,但实际自动化场景中可能增加交互复杂度。
- 分页机制原始:仅支持页码分页(page-based),无游标或时间戳偏移机制,大数据量场景效率受限。
适合人群
- 独立数字创作者:销售电子书、设计素材、软件授权、在线课程的 Gumroad 卖家
- 自动化运营开发者:需要定期同步销售数据、批量更新产品信息、自动化许可证验证的技术型创作者
- 多店铺管理代理:为多个客户管理 Gumroad 店铺的服务商或代理机构
- SaaS 集成商:需要将 Gumroad 销售数据同步至内部 CRM、财务系统或邮件营销平台的开发者
常规风险
风险类型
说明
密钥泄露
MATON_API_KEY 一旦泄露,攻击者可访问所有绑定的 Gumroad 账户数据;务必存储于安全环境变量或密钥管理系统
数据隐私
销售记录包含客户邮箱等 PII 数据,需遵守 GDPR/CCPA 等合规要求
误操作覆盖
更新产品、删除优惠码等操作不可逆,生产环境操作前建议测试
费率与限额
未明确说明 Maton 或 Gumroad 的 API 调用限额,高并发场景需关注 429 错误处理
Webhook 可靠性
自定义 Webhook 端点需自行保障可用性与安全性,防止接收伪造通知
| 风险类型 | 说明 |
|---|---|
| 密钥泄露 | MATON_API_KEY 一旦泄露,攻击者可访问所有绑定的 Gumroad 账户数据;务必存储于安全环境变量或密钥管理系统 |
| 数据隐私 | 销售记录包含客户邮箱等 PII 数据,需遵守 GDPR/CCPA 等合规要求 |
| 误操作覆盖 | 更新产品、删除优惠码等操作不可逆,生产环境操作前建议测试 |
| 费率与限额 | 未明确说明 Maton 或 Gumroad 的 API 调用限额,高并发场景需关注 429 错误处理 |
| Webhook 可靠性 | 自定义 Webhook 端点需自行保障可用性与安全性,防止接收伪造通知 |
技能正文
name: gumroad
description: |
Gumroad API integration with managed OAuth. Access products, sales, subscribers, licenses, and webhooks for your digital storefront.
Use this skill when users want to manage their Gumroad products, verify licenses, view sales data, or set up webhook notifications.
For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).
Requires network access and valid Maton API key.
metadata:
author: maton
version: "1.0"
clawdbot:
emoji: 🧠
requires:
env:
- MATON_API_KEY
Gumroad
Access the Gumroad API with managed OAuth authentication. Manage products, view sales, verify licenses, and set up webhooks for your digital storefront.
Quick Start
# Get current user info
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/gumroad/v2/user')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Base URL
https://api.maton.ai/gumroad/v2/{resource}
# Get current user info
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/gumroad/v2/user')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
https://api.maton.ai/gumroad/v2/{resource}
Maton proxies requests to api.gumroad.com/v2 and automatically injects your OAuth token.
Authentication
All requests require the Maton API key in the Authorization header:
Authorization: Bearer $MATON_API_KEY
Environment Variable: Set your API key as MATON_API_KEY:
export MATON_API_KEY="YOUR_API_KEY"
Getting Your API Key
- Sign in or create an account at maton.ai
- Go to maton.ai/settings
- Copy your API key
Connection Management
Manage your Gumroad OAuth connections at https://api.maton.ai.
List Connections
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections?app=gumroad&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Create Connection
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'gumroad'}).encode()
req = urllib.request.Request('https://api.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Get Connection
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections?app=gumroad&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'gumroad'}).encode()
req = urllib.request.Request('https://api.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Get Connection
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Response:
{
"connection": {
"connection_id": "{connection_id}",
"status": "ACTIVE",
"creation_time": "2026-02-08T06:22:48.654579Z",
"last_updated_time": "2026-02-08T06:23:07.420381Z",
"url": "https://connect.maton.ai/?session_token=...",
"app": "gumroad",
"metadata": {}
}
}
Open the returned url in a browser to complete OAuth authorization.
Delete Connection
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Specifying Connection
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
If you have multiple Gumroad connections, specify which one to use with the Maton-Connection header:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/gumroad/v2/products')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Maton-Connection', '{connection_id}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
If you have multiple connections, always include this header to ensure requests go to the intended account.
Security & Permissions
- Access is scoped to products, sales, subscribers, licenses, and webhooks for your digital storefront within the connected Gumroad account.
- All write operations require explicit user approval. Before executing any create, update, or delete call, confirm the target resource and intended effect with the user.
API Reference
User Info
Get Current User
GET /gumroad/v2/user
User Info
GET /gumroad/v2/user
Response:
{
"success": true,
"user": {
"name": "Chris",
"currency_type": "usd",
"bio": null,
"twitter_handle": null,
"id": "1690942847664",
"user_id": "QmTtTnViFSoocHAexgLuJw==",
"url": "https://chriswave1246.gumroad.com",
"profile_url": "https://public-files.gumroad.com/...",
"email": "chris@example.com",
"display_name": "Chris"
}
}
Product Operations
List Products
GET /gumroad/v2/products
Response:
{
"success": true,
"products": [
{
"id": "ABC123",
"name": "My Product",
"price": 500,
"currency": "usd",
"short_url": "https://gumroad.com/l/abc",
"sales_count": 10,
"sales_usd_cents": 5000
}
]
}
Get Product
GET /gumroad/v2/products/{product_id}
Update Product
PUT /gumroad/v2/products/{product_id}
Content-Type: application/x-www-form-urlencoded
name=Updated%20Name&price=1000
Enable/Disable Product
PUT /gumroad/v2/products/{product_id}/disable
Content-Type: application/x-www-form-urlencoded
disabled=true
Delete Product
DELETE /gumroad/v2/products/{product_id}
GET /gumroad/v2/products/{product_id}
PUT /gumroad/v2/products/{product_id}
Content-Type: application/x-www-form-urlencoded
name=Updated%20Name&price=1000
Enable/Disable Product
PUT /gumroad/v2/products/{product_id}/disable
Content-Type: application/x-www-form-urlencoded
disabled=true
Delete Product
DELETE /gumroad/v2/products/{product_id}
PUT /gumroad/v2/products/{product_id}/disable
Content-Type: application/x-www-form-urlencoded
disabled=true
DELETE /gumroad/v2/products/{product_id}
Note: Creating new products via API is not supported. Products must be created through the Gumroad website.
Offer Code Operations
List Offer Codes
GET /gumroad/v2/products/{product_id}/offer_codes
Get Offer Code
GET /gumroad/v2/products/{product_id}/offer_codes/{offer_code_id}
Create Offer Code
POST /gumroad/v2/products/{product_id}/offer_codes
Content-Type: application/x-www-form-urlencoded
name=SUMMER20&amount_off=20
GET /gumroad/v2/products/{product_id}/offer_codes/{offer_code_id}
POST /gumroad/v2/products/{product_id}/offer_codes
Content-Type: application/x-www-form-urlencoded
name=SUMMER20&amount_off=20
Parameters:
name- The code customers enter (required)amount_off- Cents or percentage off (required)offer_type- "cents" or "percent" (default: "cents")max_purchase_count- Maximum uses (optional)
Update Offer Code
PUT /gumroad/v2/products/{product_id}/offer_codes/{offer_code_id}
Content-Type: application/x-www-form-urlencoded
max_purchase_count=100
Delete Offer Code
DELETE /gumroad/v2/products/{product_id}/offer_codes/{offer_code_id}
Sales Operations
List Sales
GET /gumroad/v2/sales
PUT /gumroad/v2/products/{product_id}/offer_codes/{offer_code_id}
Content-Type: application/x-www-form-urlencoded
max_purchase_count=100
DELETE /gumroad/v2/products/{product_id}/offer_codes/{offer_code_id}
Sales Operations
List Sales
GET /gumroad/v2/sales
Query parameters:
after- Only sales after this date (YYYY-MM-DD)before- Only sales before this date (YYYY-MM-DD)page- Page number for pagination
Example with filters:
GET /gumroad/v2/sales?after=2026-01-01&before=2026-12-31
Response:
{
"success": true,
"sales": [
{
"id": "sale_abc123",
"email": "customer@example.com",
"seller_id": "seller123",
"product_id": "prod123",
"product_name": "My Product",
"price": 500,
"currency_symbol": "$",
"created_at": "2026-01-15T10:30:00Z"
}
]
}
Get Sale
GET /gumroad/v2/sales/{sale_id}
Subscriber Operations
List Subscribers
GET /gumroad/v2/products/{product_id}/subscribers
Get Subscriber
GET /gumroad/v2/subscribers/{subscriber_id}
GET /gumroad/v2/sales/{sale_id}
List Subscribers
GET /gumroad/v2/products/{product_id}/subscribers
GET /gumroad/v2/subscribers/{subscriber_id}
Response:
{
"success": true,
"subscriber": {
"id": "sub123",
"product_id": "prod123",
"product_name": "Monthly Subscription",
"user_id": "user123",
"user_email": "subscriber@example.com",
"status": "alive",
"created_at": "2026-01-01T00:00:00Z"
}
}
License Operations
Verify License
POST /gumroad/v2/licenses/verify
Content-Type: application/x-www-form-urlencoded
product_id={product_id}&license_key={license_key}
Parameters:
product_id- The product ID (required)license_key- The license key to verify (required)increment_uses_count- Increment the use count (default: true)
Response (success):
{
"success": true,
"uses": 1,
"purchase": {
"seller_id": "seller123",
"product_id": "prod123",
"product_name": "My Product",
"permalink": "abc",
"email": "customer@example.com",
"license_key": "ABC-123-DEF",
"quantity": 1,
"created_at": "2026-01-15T00:00:00Z"
}
}
Response (failure):
{
"success": false,
"message": "That license does not exist for the provided product."
}
Enable License
PUT /gumroad/v2/licenses/enable
Content-Type: application/x-www-form-urlencoded
product_id={product_id}&license_key={license_key}
Disable License
PUT /gumroad/v2/licenses/disable
Content-Type: application/x-www-form-urlencoded
product_id={product_id}&license_key={license_key}
Decrement License Uses
PUT /gumroad/v2/licenses/decrement_uses_count
Content-Type: application/x-www-form-urlencoded
product_id={product_id}&license_key={license_key}
Resource Subscriptions (Webhooks)
PUT /gumroad/v2/licenses/enable
Content-Type: application/x-www-form-urlencoded
product_id={product_id}&license_key={license_key}
PUT /gumroad/v2/licenses/disable
Content-Type: application/x-www-form-urlencoded
product_id={product_id}&license_key={license_key}
Decrement License Uses
PUT /gumroad/v2/licenses/decrement_uses_count
Content-Type: application/x-www-form-urlencoded
product_id={product_id}&license_key={license_key}
Resource Subscriptions (Webhooks)
PUT /gumroad/v2/licenses/decrement_uses_count
Content-Type: application/x-www-form-urlencoded
product_id={product_id}&license_key={license_key}
Subscribe to notifications for sales and other events.
List Resource Subscriptions
GET /gumroad/v2/resource_subscriptions?resource_name=sale
GET /gumroad/v2/resource_subscriptions?resource_name=sale
Parameters:
resource_name- Required. One of:sale,refund,dispute,dispute_won,cancellation,subscription_updated,subscription_ended,subscription_restarted
Response:
{
"success": true,
"resource_subscriptions": [
{
"id": "wX43hzi-s7W4JfYFkxyeiQ==",
"resource_name": "sale",
"post_url": "https://example.com/webhook"
}
]
}
Delete Resource Subscription
DELETE /gumroad/v2/resource_subscriptions/{resource_subscription_id}
DELETE /gumroad/v2/resource_subscriptions/{resource_subscription_id}
Response:
{
"success": true,
"message": "The resource_subscription was deleted successfully."
}
Variant Categories
List Variant Categories
GET /gumroad/v2/products/{product_id}/variant_categories
Get Variant Category
GET /gumroad/v2/products/{product_id}/variant_categories/{variant_category_id}
Create Variant Category
POST /gumroad/v2/products/{product_id}/variant_categories
Content-Type: application/x-www-form-urlencoded
title=Size
Delete Variant Category
DELETE /gumroad/v2/products/{product_id}/variant_categories/{variant_category_id}
Variants
List Variants
GET /gumroad/v2/products/{product_id}/variant_categories/{variant_category_id}/variants
Create Variant
POST /gumroad/v2/products/{product_id}/variant_categories/{variant_category_id}/variants
Content-Type: application/x-www-form-urlencoded
name=Large&price_difference=200
Update Variant
PUT /gumroad/v2/products/{product_id}/variant_categories/{variant_category_id}/variants/{variant_id}
Content-Type: application/x-www-form-urlencoded
name=Extra%20Large
Delete Variant
DELETE /gumroad/v2/products/{product_id}/variant_categories/{variant_category_id}/variants/{variant_id}
Custom Fields
List Custom Fields
GET /gumroad/v2/products/{product_id}/custom_fields
Create Custom Field
POST /gumroad/v2/products/{product_id}/custom_fields
Content-Type: application/x-www-form-urlencoded
name=Company%20Name&required=true
Update Custom Field
PUT /gumroad/v2/products/{product_id}/custom_fields/{name}
Content-Type: application/x-www-form-urlencoded
required=false
Delete Custom Field
DELETE /gumroad/v2/products/{product_id}/custom_fields/{name}
Pagination
GET /gumroad/v2/products/{product_id}/variant_categories/{variant_category_id}
POST /gumroad/v2/products/{product_id}/variant_categories
Content-Type: application/x-www-form-urlencoded
title=Size
Delete Variant Category
DELETE /gumroad/v2/products/{product_id}/variant_categories/{variant_category_id}
Variants
List Variants
GET /gumroad/v2/products/{product_id}/variant_categories/{variant_category_id}/variants
Create Variant
POST /gumroad/v2/products/{product_id}/variant_categories/{variant_category_id}/variants
Content-Type: application/x-www-form-urlencoded
name=Large&price_difference=200
Update Variant
PUT /gumroad/v2/products/{product_id}/variant_categories/{variant_category_id}/variants/{variant_id}
Content-Type: application/x-www-form-urlencoded
name=Extra%20Large
Delete Variant
DELETE /gumroad/v2/products/{product_id}/variant_categories/{variant_category_id}/variants/{variant_id}
Custom Fields
List Custom Fields
GET /gumroad/v2/products/{product_id}/custom_fields
Create Custom Field
POST /gumroad/v2/products/{product_id}/custom_fields
Content-Type: application/x-www-form-urlencoded
name=Company%20Name&required=true
Update Custom Field
PUT /gumroad/v2/products/{product_id}/custom_fields/{name}
Content-Type: application/x-www-form-urlencoded
required=false
Delete Custom Field
DELETE /gumroad/v2/products/{product_id}/custom_fields/{name}
Pagination
DELETE /gumroad/v2/products/{product_id}/variant_categories/{variant_category_id}
List Variants
GET /gumroad/v2/products/{product_id}/variant_categories/{variant_category_id}/variants
POST /gumroad/v2/products/{product_id}/variant_categories/{variant_category_id}/variants
Content-Type: application/x-www-form-urlencoded
name=Large&price_difference=200
Update Variant
PUT /gumroad/v2/products/{product_id}/variant_categories/{variant_category_id}/variants/{variant_id}
Content-Type: application/x-www-form-urlencoded
name=Extra%20Large
Delete Variant
DELETE /gumroad/v2/products/{product_id}/variant_categories/{variant_category_id}/variants/{variant_id}
Custom Fields
List Custom Fields
GET /gumroad/v2/products/{product_id}/custom_fields
Create Custom Field
POST /gumroad/v2/products/{product_id}/custom_fields
Content-Type: application/x-www-form-urlencoded
name=Company%20Name&required=true
Update Custom Field
PUT /gumroad/v2/products/{product_id}/custom_fields/{name}
Content-Type: application/x-www-form-urlencoded
required=false
Delete Custom Field
DELETE /gumroad/v2/products/{product_id}/custom_fields/{name}
Pagination
PUT /gumroad/v2/products/{product_id}/variant_categories/{variant_category_id}/variants/{variant_id}
Content-Type: application/x-www-form-urlencoded
name=Extra%20Large
DELETE /gumroad/v2/products/{product_id}/variant_categories/{variant_category_id}/variants/{variant_id}
Custom Fields
List Custom Fields
GET /gumroad/v2/products/{product_id}/custom_fields
Create Custom Field
POST /gumroad/v2/products/{product_id}/custom_fields
Content-Type: application/x-www-form-urlencoded
name=Company%20Name&required=true
Update Custom Field
PUT /gumroad/v2/products/{product_id}/custom_fields/{name}
Content-Type: application/x-www-form-urlencoded
required=false
Delete Custom Field
DELETE /gumroad/v2/products/{product_id}/custom_fields/{name}
Pagination
POST /gumroad/v2/products/{product_id}/custom_fields
Content-Type: application/x-www-form-urlencoded
name=Company%20Name&required=true
PUT /gumroad/v2/products/{product_id}/custom_fields/{name}
Content-Type: application/x-www-form-urlencoded
required=false
Delete Custom Field
DELETE /gumroad/v2/products/{product_id}/custom_fields/{name}
Pagination
DELETE /gumroad/v2/products/{product_id}/custom_fields/{name}
Gumroad uses page-based pagination for endpoints that return lists:
GET /gumroad/v2/sales?page=1
GET /gumroad/v2/sales?page=2
Continue incrementing the page number until you receive an empty list.
Code Examples
JavaScript
const response = await fetch(
'https://api.maton.ai/gumroad/v2/products',
{
headers: {
'Authorization': `Bearer ${process.env.MATON_API_KEY}`
}
}
);
const data = await response.json();
Python
import os
import requests
response = requests.get(
'https://api.maton.ai/gumroad/v2/products',
headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'}
)
data = response.json()
Python (Verify License)
import os
import requests
response = requests.post(
'https://api.maton.ai/gumroad/v2/licenses/verify',
headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'},
data={
'product_id': 'your_product_id',
'license_key': 'CUSTOMER-LICENSE-KEY'
}
)
result = response.json()
if result['success']:
print(f"License valid! Uses: {result['uses']}")
else:
print(f"Invalid: {result['message']}")
Notes
- All responses include a
success boolean field
- Product creation is not available via API - products must be created through the Gumroad website
- POST/PUT requests use
application/x-www-form-urlencoded content type (not JSON)
- Prices are in cents (e.g., 500 = $5.00)
- License keys are case-insensitive
- Resource subscription webhooks send POST requests to your specified URL
- IMPORTANT: When piping curl output to
jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments
Error Handling
Status
Meaning
400
Missing Gumroad connection or bad request
401
Invalid or missing Maton API key
404
Resource not found (returned with success: false)
429
Rate limited
4xx/5xx
Passthrough error from Gumroad API
import os
import requests
response = requests.get(
'https://api.maton.ai/gumroad/v2/products',
headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'}
)
data = response.json()
import os
import requests
response = requests.post(
'https://api.maton.ai/gumroad/v2/licenses/verify',
headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'},
data={
'product_id': 'your_product_id',
'license_key': 'CUSTOMER-LICENSE-KEY'
}
)
result = response.json()
if result['success']:
print(f"License valid! Uses: {result['uses']}")
else:
print(f"Invalid: {result['message']}")
Notes
- All responses include a
success boolean field
- Product creation is not available via API - products must be created through the Gumroad website
- POST/PUT requests use
application/x-www-form-urlencoded content type (not JSON)
- Prices are in cents (e.g., 500 = $5.00)
- License keys are case-insensitive
- Resource subscription webhooks send POST requests to your specified URL
- IMPORTANT: When piping curl output to
jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments
Error Handling
Status
Meaning
400
Missing Gumroad connection or bad request
401
Invalid or missing Maton API key
404
Resource not found (returned with success: false)
429
Rate limited
4xx/5xx
Passthrough error from Gumroad API
success boolean fieldapplication/x-www-form-urlencoded content type (not JSON)jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments| Status | Meaning |
|---|---|
| 400 | Missing Gumroad connection or bad request |
| 401 | Invalid or missing Maton API key |
| 404 | Resource not found (returned with success: false) |
| 429 | Rate limited |
| 4xx/5xx | Passthrough error from Gumroad API |
Gumroad errors typically return HTTP 404 with a JSON body:
{
"success": false,
"message": "Error description"
}
Troubleshooting: API Key Issues
- Check that the
MATON_API_KEY environment variable is set:
echo $MATON_API_KEY
- Verify the API key is valid by listing connections:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Troubleshooting: Invalid App Name
- Ensure your URL path starts with
gumroad. For example:
- Correct:
https://api.maton.ai/gumroad/v2/user
- Incorrect:
https://api.maton.ai/v2/user
Resources
MATON_API_KEY environment variable is set:echo $MATON_API_KEY
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
- Ensure your URL path starts with
gumroad. For example:
- Correct:
https://api.maton.ai/gumroad/v2/user - Incorrect:
https://api.maton.ai/v2/user
Resources
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。