POST /v1/actions/subscription-product-group/create-group
リクエストボディ
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
storeId | string | Yes | Store ID(STO_xxx フォーマット) |
name | string | Yes | グループ名(ストア + 環境ごとに一意) |
description | string | No | グループの説明 |
rules | object | No | グループルール({ sharedTrial: boolean }) |
productIds | string[] | No | 含めるサブスクリプション商品 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",
],
});
curl -X POST https://api.waffo.ai/v1/actions/subscription-product-group/create-group \
-H "Content-Type: application/json" \
-H "X-Merchant-Id: MER_7K3M9P2R5T8W1Y4Z" \
-H "X-Timestamp: 2026-03-30T10:00:00Z" \
-H "X-Signature: BASE64_RSA_SIGNATURE" \
-d '{
"storeId": "STO_2D5F8G3H1K4M6N9P",
"name": "Pricing Plans",
"description": "Free, Pro, and Enterprise tiers",
"rules": { "sharedTrial": true },
"productIds": [
"PROD_3F7H2J5L8N1Q4S6U",
"PROD_8B4D6F9H2K5M7P1R",
"PROD_1C3E5G7J0L2N4Q6S"
]
}'
body = {
"storeId": "STO_2D5F8G3H1K4M6N9P",
"name": "Pricing Plans",
"description": "Free, Pro, and Enterprise tiers",
"rules": {"sharedTrial": True},
"productIds": [
"PROD_3F7H2J5L8N1Q4S6U",
"PROD_8B4D6F9H2K5M7P1R",
"PROD_1C3E5G7J0L2N4Q6S",
],
}
response = requests.post(
"https://api.waffo.ai/v1/actions/subscription-product-group/create-group",
json=body,
headers=sign_request("POST", "/v1/actions/subscription-product-group/create-group", body),
)
group = response.json()["data"]["group"]
成功レスポンス (200)
{
"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"
}
}
}
エラー
リトライポリシー:4xx は一切リトライしない — リクエストを修正してから再送信。5xx は指数バックオフでリトライ(5s 開始、最大 3 回)。
| ステータス | errors[0].message | 意味 | 推奨処理 |
|---|---|---|---|
| 400 | Missing or invalid header: x-context-environment | environment ヘッダーが欠落、または test / prod 以外 | ヘッダーを修正して再送信 |
| 400 | Missing required fields: storeId, name | 必須フィールド欠落 | フィールドを追加して再送信 |
| 400 | Expected format: STO_xxx, got "..." / Expected format: PROD_xxx, got "..." | storeId または productIds の Short ID をデコードできない | ID を修正して再送信 |
| 500 | Internal server error | 内部エラーまたは一時的な下流障害 | 指数バックオフでリトライ(5s 開始、最大 3 回) |