|
通过托管 OAuth 认证访问 Squarespace Commerce API。管理产品、库存、订单、客户资料和交易。
bash
https://gateway.maton.ai/squarespace/{native-api-path}
将 {native-api-path} 替换为实际的 Squarespace API 端点路径。网关将请求代理到 api.squarespace.com 并自动注入您的 OAuth 令牌。
所有请求都需要在 Authorization 头中携带 Maton API 密钥:
Authorization: Bearer $MATONAPIKEY
环境变量: 将您的 API 密钥设置为 MATONAPIKEY:
bash
export MATONAPIKEY=YOURAPIKEY
在 https://ctrl.maton.ai 管理您的 Squarespace OAuth 连接。
bash
python <
req = urllib.request.Request(https://ctrl.maton.ai/connections?app=squarespace&status=ACTIVE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
bash
python <
data = json.dumps({app: squarespace}).encode()
req = urllib.request.Request(https://ctrl.maton.ai/connections, data=data, method=POST)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Content-Type, application/json)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
bash
python <
req = urllib.request.Request(https://ctrl.maton.ai/connections/{connection_id})
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
响应:
json
{
connection: {
connection_id: 21fd90f9-5935-43cd-b6c8-bde9d915ca80,
status: ACTIVE,
creation_time: 2025-12-08T07:20:53.488460Z,
lastupdatedtime: 2026-01-31T20:03:32.593153Z,
url: https://connect.maton.ai/?session_token=...,
app: squarespace,
metadata: {}
}
}
在浏览器中打开返回的 url 以完成 OAuth 授权。
bash
python <
req = urllib.request.Request(https://ctrl.maton.ai/connections/{connection_id}, method=DELETE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
如果您有多个 Squarespace 连接,请使用 Maton-Connection 头指定要使用的连接:
bash
python <
req = urllib.request.Request(https://gateway.maton.ai/squarespace/v2/commerce/products)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(User-Agent, MyClaude/1.0)
req.add_header(Maton-Connection, 21fd90f9-5935-43cd-b6c8-bde9d915ca80)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
如果省略,网关将使用默认(最早)的活动连接。
bash
GET /squarespace/1.0/commerce/inventory
查询参数:
响应:
json
{
inventory: [
{
variantId: 5ba1418df4204bb2d21eac3f,
sku: SQ0001,
descriptor: 产品名称 - 尺寸:中号,
isUnlimited: false,
quantity: 25
}
],
pagination: {
hasNextPage: true,
nextPageCursor: abc123,
nextPageUrl: https://api.squarespace.com/1.0/commerce/inventory?cursor=abc123
}
}
bash
GET /squarespace/1.0/commerce/inventory/{variantIds}
bash
POST /squarespace/1.0/commerce/inventory/adjustments
Content-Type: application/json
Idempotency-Key: unique-key-here
{
incrementOperations: [{variantId: variant-id-1, quantity: 5}],
decrementOperations: [{variantId: variant-id-2, quantity: 2}],
setFiniteOperations: [{variantId: variant-id-3, quantity: 100}],
setUnlimitedOperations: [variant-id-4]
}
响应: 成功时返回 204 No Content
bash
GET /squarespace/1.0/commerce/orders
查询参数:
注意:不能将游标与日期范围参数结合使用。日期筛选器必须同时使用。
响应:
json
{
result: [
{
id: order-id,
orderNumber: 1001,
createdOn: 2024-01-15T10:30:00Z,
modifiedOn: 2024-01-15T12:00:00Z,
channel: web,
testmode: false,
customerEmail: customer@example.com,
fulfillmentStatus: PENDING,
lineItems: [...],
subtotal: {value: 99.99, currency: USD},
shippingTotal: {value: 9.99, currency: USD},
taxTotal: {value: 8.50, currency: USD},
grandTotal: {value: 118.48, currency: USD}
}
],
pagination: {
hasNextPage: true,
nextPageCursor: abc123,
nextPageUrl: ...
}
}
bash
GET /squarespace/1.0/commerce/orders/{orderId}
bash
POST /squarespace/1.0/commerce/orders
Content-Type: application/json
Idempotency-Key: unique-key-here
{
channelName: 外部商店,
externalOrderReference: ORDER-12345,
customerEmail: customer@example.com,
lineItems: [
{
lineItemType: PHYSICAL_PRODUCT,
variantId: variant-id,
quantity: 2,
unitPricePaid: {currency: USD, value: 29.99}
}
],
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 squarespace-1776298484 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 squarespace-1776298484 技能
skillhub install squarespace-1776298484
文件大小: 6.76 KB | 发布时间: 2026-4-16 16:11