Create a group product item
Adds a member (to_product) to a grouped product (from_product) with a starting quantity. The from_product must be a Grouped product and the to_product must be a Simple product; the pair must not already exist. On success the grouped product's price is recomputed from its members using the GROUPED_PRODUCT_PRICE_SELECTOR dynamic setting.
Business-rule violations are returned with HTTP 406 and a stable error code: group_product_item_100_1 (master not grouped), group_product_item_100_2 (member not simple), or the "already exists" error for a duplicate pair.
Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.
Fields for creating or fully replacing a group product item. from_product must be a Grouped product and to_product a Simple product; the pair must be unique.
Identifier of the grouped master product.
Identifier of the member (simple) product.
Sort order of the member within the group. Defaults to 0.
0Quantity of the member product included in the set.
1The group product item was created.
A membership row linking a grouped product to one of its member (simple) products.
Unique identifier of the group product item.
Identifier of the grouped master product.
Identifier of the member (simple) product.
Sort order of the member within the group. Lower values appear first.
0Quantity of the member product included in the set.
1The request contains invalid or missing data.
Authentication credentials were not provided or are invalid.
The authenticated user does not have administrator privileges.
The request is well-formed but violates a membership rule — the master is not a Grouped product (group_product_item_100_1), the member is not a Simple product (group_product_item_100_2), or the (from_product, to_product) pair already exists.
POST /api/v1/remote/1/group_product_items/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 68
{
"from_product": 700,
"to_product": 341,
"order": 0,
"initial_quantity": 2
}{
"pk": 5,
"from_product": 700,
"to_product": 341,
"order": 0,
"initial_quantity": 2
}Last updated
Was this helpful?

