Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

post
/group_product_items/
Authorizations
AuthorizationstringRequired

Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.

Body

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.

from_productintegerRequired

Identifier of the grouped master product.

to_productintegerRequired

Identifier of the member (simple) product.

orderintegerOptional

Sort order of the member within the group. Defaults to 0.

Default: 0
initial_quantityintegerRequired

Quantity of the member product included in the set.

Default: 1
Responses
201

The group product item was created.

application/json

A membership row linking a grouped product to one of its member (simple) products.

pkintegerRead-onlyRequired

Unique identifier of the group product item.

from_productintegerRequired

Identifier of the grouped master product.

to_productintegerRequired

Identifier of the member (simple) product.

orderintegerRequired

Sort order of the member within the group. Lower values appear first.

Default: 0
initial_quantityintegerRequired

Quantity of the member product included in the set.

Default: 1
post/group_product_items/
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?