メインコンテンツへスキップ
商品グループの名前、説明、ルール、または商品リストを更新します。
POST /v1/actions/subscription-product-group/update-group
認証: API Key

リクエストボディ

フィールド必須説明
idstringYesグループ ID(UUID フォーマット)
namestringNo更新後のグループ名
descriptionstringNo更新後の説明
rulesobjectNo更新後のルール({ sharedTrial: boolean }
productIdsstring[]No更新後の商品リスト(PROD_xxx フォーマット)。リスト全体を置換します。

リクエスト例

const { group } = await client.subscriptionProductGroups.update({
  id: "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f9a",
  name: "Updated Pricing Plans",
  productIds: [
    "PROD_3F7H2J5L8N1Q4S6U",
    "PROD_8B4D6F9H2K5M7P1R",
  ],
});
// Uses callApi() helper from authentication.mdx
const result = await callApi("POST", "/v1/actions/subscription-product-group/update-group", {
  id: "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f9a",
  name: "Updated Pricing Plans",
  productIds: [
    "PROD_3F7H2J5L8N1Q4S6U",
    "PROD_8B4D6F9H2K5M7P1R",
  ],
});
console.log(result.data);
// Uses callApi() helper from authentication.mdx
String body = """
    {"id":"d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f9a","name":"Updated Pricing Plans","productIds":["PROD_3F7H2J5L8N1Q4S6U","PROD_8B4D6F9H2K5M7P1R"]}""";

String response = callApi("POST", "/v1/actions/subscription-product-group/update-group", body);
System.out.println(response);
# Uses call_api() helper from authentication.mdx
result = call_api("POST", "/v1/actions/subscription-product-group/update-group", {
    "id": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f9a",
    "name": "Updated Pricing Plans",
    "productIds": [
        "PROD_3F7H2J5L8N1Q4S6U",
        "PROD_8B4D6F9H2K5M7P1R",
    ],
})
print(result["data"])
// Uses callAPI() helper from authentication.mdx
body := map[string]interface{}{
    "id":   "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f9a",
    "name": "Updated Pricing Plans",
    "productIds": []string{
        "PROD_3F7H2J5L8N1Q4S6U",
        "PROD_8B4D6F9H2K5M7P1R",
    },
}
result, err := callAPI("POST", "/v1/actions/subscription-product-group/update-group", body)
if err != nil {
    log.Fatal(err)
}
fmt.Println(string(result))
// Uses call_api() helper from authentication.mdx
let body = serde_json::json!({
    "id": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f9a",
    "name": "Updated Pricing Plans",
    "productIds": [
        "PROD_3F7H2J5L8N1Q4S6U",
        "PROD_8B4D6F9H2K5M7P1R"
    ]
});
let result = call_api("POST", "/v1/actions/subscription-product-group/update-group", &body).await?;
println!("{}", result);
/* Uses call_api() helper from authentication.mdx */
const char *body = "{\"id\":\"d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f9a\",\"name\":\"Updated Pricing Plans\",\"productIds\":[\"PROD_3F7H2J5L8N1Q4S6U\",\"PROD_8B4D6F9H2K5M7P1R\"]}";
char *response = call_api("POST", "/v1/actions/subscription-product-group/update-group", body);
printf("%s\n", response);
free(response);
// Uses callApi() helper from authentication.mdx
std::string body = R"({"id":"d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f9a","name":"Updated Pricing Plans","productIds":["PROD_3F7H2J5L8N1Q4S6U","PROD_8B4D6F9H2K5M7P1R"]})";
std::string response = callApi("POST", "/v1/actions/subscription-product-group/update-group", body);
std::cout << response << std::endl;
MERCHANT_ID="MER_2aUyqjCzEIiEcYMKj7TZtw"
TIMESTAMP=$(date +%s)
BODY='{
  "id": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f9a",
  "name": "Updated Pricing Plans",
  "productIds": [
    "PROD_3F7H2J5L8N1Q4S6U",
    "PROD_8B4D6F9H2K5M7P1R"
  ]
}'
BODY_HASH=$(echo -n "$BODY" | openssl dgst -sha256 -binary | base64 -w 0)
CANONICAL_REQUEST="POST
/v1/actions/subscription-product-group/update-group
$TIMESTAMP
$BODY_HASH"

SIGNATURE=$(echo -n "$CANONICAL_REQUEST" | openssl dgst -sha256 -sign private_key.pem | base64 -w 0)

curl -X POST "https://api.waffo.ai/v1/actions/subscription-product-group/update-group" \
  -H "Content-Type: application/json" \
  -H "X-Merchant-Id: $MERCHANT_ID" \
  -H "X-Timestamp: $TIMESTAMP" \
  -H "X-Signature: $SIGNATURE" \
  -d "$BODY"
MERCHANT_ID="MER_2aUyqjCzEIiEcYMKj7TZtw"
TIMESTAMP=$(date +%s)
BODY='{
  "id": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f9a",
  "name": "Updated Pricing Plans",
  "productIds": [
    "PROD_3F7H2J5L8N1Q4S6U",
    "PROD_8B4D6F9H2K5M7P1R"
  ]
}'
BODY_HASH=$(echo -n "$BODY" | openssl dgst -sha256 -binary | base64 -w 0)
CANONICAL_REQUEST="POST
/v1/actions/subscription-product-group/update-group
$TIMESTAMP
$BODY_HASH"

SIGNATURE=$(echo -n "$CANONICAL_REQUEST" | openssl dgst -sha256 -sign private_key.pem | base64 -w 0)

wget -qO- "https://api.waffo.ai/v1/actions/subscription-product-group/update-group" \
  --header="Content-Type: application/json" \
  --header="X-Merchant-Id: $MERCHANT_ID" \
  --header="X-Timestamp: $TIMESTAMP" \
  --header="X-Signature: $SIGNATURE" \
  --post-data="$BODY"
productIds フィールドは商品リスト全体を置換します。商品を追加するには、既存の商品 ID すべてと新しい ID を含めてください。商品を削除するには、リストから省略してください。

エラー

リトライポリシー:4xx は一切リトライしない — リクエストを修正してから再送信。5xx は指数バックオフでリトライ(5s 開始、最大 3 回)。
ステータスerrors[0].message意味推奨処理
400Missing required field: idリクエストボディに id が含まれないid を追加して再送信
400Expected format: PROD_xxx, got "..."productIds の Short ID をデコードできないID を修正して再送信
404Group not found指定された id のグループが存在しないid が自分のストアに属しているか確認
500Internal server error内部エラーまたは一時的な下流障害指数バックオフでリトライ(5s 開始、最大 3 回)