Add Product Variants
POST
v1/products/{product_id}/options/This endpoint creates child variants for a given product by defining choices for its attributes. If the product in question is a stand-alone product (neither a parent nor having any children), this operation will transform it into a parent product.
Steps to Create Variants:
- Create Product Attributes: Begin by creating product attributes for the store using the Create Attribute endpoint.
- Define Attribute Choices: Next, define choices for these attributes. For example, for a size attribute, choices might include 'small', 'medium', 'large', etc.
- Choice Objects in Different Languages: Each choice is an object that accepts values in multiple languages. Currently, English and Arabic are supported.
- Submit Attributes and Choices: This endpoint accepts an array of attributes and their respective choices.
- Variant Generation: Variants are then created using the cartesian product of these attribute values, resulting in all possible combinations.
Request
The Authorization token is a unique key given to the third-party application (Partner) by Zid. It is used to authenticate the API requests made by the Partner application. The token verifies the partner's identity and ensures they have permission to access Zid's API but does not provide any specific user or store information. It should be included in the header of API requests when the partner application needs to access Zid's API.
This token is used to authenticate and access information related to the store. It is obtained through an OAuth mechanism and is required to perform operations on the store's data. The X-Manager-Token
should be included in the header of API requests that require store-related information.
Request samples
Responses
{}