跳转到主要内容
创建产品组以组织相关订阅产品。
POST /v1/actions/subscription-product-group/create-group
认证方式: API Key

请求体

字段类型必需说明
storeIdstring门店 ID(STO_xxx 格式)
namestring产品组名称(每个门店 + 环境唯一)
descriptionstring产品组描述
rulesobject产品组规则({ sharedTrial: boolean }
productIdsstring[]要包含的订阅产品 ID(PROD_xxx 格式)

请求示例

const { group } = await client.subscriptionProductGroups.create({
  storeId: "STO_2D5F8G3H1K4M6N9P",
  name: "Pricing Plans",
  description: "Free, Pro, and Enterprise tiers",
  rules: { sharedTrial: true },
  productIds: [
    "PROD_3F7H2J5L8N1Q4S6U",
    "PROD_8B4D6F9H2K5M7P1R",
    "PROD_1C3E5G7J0L2N4Q6S",
  ],
});

成功响应

{
  "data": {
    "group": {
      "id": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f9a",
      "storeId": "STO_2D5F8G3H1K4M6N9P",
      "name": "Pricing Plans",
      "description": "Free, Pro, and Enterprise tiers",
      "rules": { "sharedTrial": true },
      "productIds": [
        "PROD_3F7H2J5L8N1Q4S6U",
        "PROD_8B4D6F9H2K5M7P1R",
        "PROD_1C3E5G7J0L2N4Q6S"
      ],
      "environment": "test",
      "createdAt": "2026-03-30T10:30:00.000Z",
      "updatedAt": "2026-03-30T10:30:00.000Z"
    }
  }
}

错误响应

状态码条件
400缺少必填字段(storeIdname