POST /v1/actions/subscription-product-group/update-group
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Group ID (UUID format) |
name | string | No | Updated group name |
description | string | No | Updated description |
rules | object | No | Group switches to change: { sharedTrial: boolean, selfServicePlanChange: boolean }. Merged per field — send only the switches you are changing. See Rules |
productIds | string[] | No | Updated product list (PROD_xxx format). Replaces the entire list. |
Example Request
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 | tr -d '\n')
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 | tr -d '\n')
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 | tr -d '\n')
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 | tr -d '\n')
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"
The
productIds field replaces the entire product list. To add a product, include all existing product IDs plus the new one. To remove a product, omit it from the list.rules behaves the opposite way — it is merged, not replaced. Sending rules: { selfServicePlanChange: true } leaves sharedTrial at its stored value, so you never have to resend a switch you are not changing. Unrecognized keys are dropped, and rules: null is treated the same as omitting the field. The response returns the full merged object, so you can confirm the result.Success Response (200)
{
"data": {
"group": {
"id": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f9a",
"storeId": "STO_2D5F8G3H1K4M6N9P",
"name": "Updated Pricing Plans",
"description": "Free, Pro, and Enterprise tiers",
"rules": { "sharedTrial": true, "selfServicePlanChange": true },
"productIds": [
"PROD_3F7H2J5L8N1Q4S6U",
"PROD_8B4D6F9H2K5M7P1R"
],
"environment": "test",
"createdAt": "2026-03-30T10:30:00.000Z",
"updatedAt": "2026-04-02T09:15:00.000Z"
}
}
}
group object is the same shape returned by create-group — see Group Object for every field. rules is the merged result: switches you did not send keep their stored values.
Errors
Retry policy: Never retry 4xx — fix the request and resubmit. Retry 5xx with exponential backoff (start 5s, max 3 attempts).
| Status | errors[0].message | What it means | Recommended handling |
|---|---|---|---|
| 400 | Missing required field: id | Request body did not include id | Add id, resubmit |
| 400 | Expected format: PROD_xxx, got "..." | A productIds entry could not be decoded as a Short ID | Fix the ID, resubmit |
| 400 | rules.sharedTrial must be a boolean | The switch was sent as something other than true / false | Send a boolean, or omit the switch |
| 400 | rules.selfServicePlanChange must be a boolean | The switch was sent as something other than true / false | Send a boolean, or omit the switch |
| 404 | Group not found | No group exists for the supplied id | Verify the id belongs to your store |
| 500 | Internal server error | Internal error or transient downstream failure | Retry with exponential backoff (start 5s, max 3 attempts) |