note:product schema post and edit API's link need to be replaced when they could show in web page successfully.
Post/Edit product by using Product Schema
Product schema is a JSON type specification for defining the fields, options and rules of product posting.
It’s a human- and machine- readable specification, through the schema, you can accurately construct an instance and verify that the instance meets the specification.
The following shows the related APIs involved when using product schema
1.Get product schema
2.Post product based on schema
3.Full edit product based on schema
There are some general pre requests before beginning integration schema solution, which could be found in the Prerequisites section in Overall view of product management.
By invoking api Get product schema, Aliexpress system will feed back a JSON format schema. The JSON schema follows the standards ofJSON Schema Core Standard AND JSON schema Validation Standard.
The product schema currently defined 17 required first-level fields, which includes category attributes, SKU attributes, shipping templates, etc.
1. title_multi_language_list – Support setting titles in different languages at once
2. description_multi_language_list : – Support setting descriptions in different languages at once
3. locale
4. product_units_type – Most common used type are piece/pieces(100000015)
5. category_id – Aliexpress category ID
6. image_url_list
7. category_attributes
8. sku_info_list
9. inventory_deduction_strategy
10. package_weight
11. package_length
12. package_height
13. package_width
14. shipping_preparation_time
15. shipping_template_id – The value is different for different sellers
16. service_template_id – The value is different for different sellers
17. product_group_id – The value is different for different sellers
Below is a sample schema from test account for men’s shirts.
sample schema
Note: The data returned by schema has the possibility to change as time varies. It is needed for the sellers/ISVs to check and adjust the configurations in their side based on the schema. Otherwiese, some of the the products may fail to upload/edit as the requirements for each category might change.
Based on the JSON schema format obtained from step 1, the developer needs to implement the generation and validation of the product instance according to the standards mentioned in step 1.
The final generated product instance for product posting is as the following.
For Product full editing based on schema, the seller needs to add another field “aliexpress_product_id” while the logic of other fields keep the same.
{ "category_id": 348, "title_multi_language_list": [ { "locale": "es_ES", "title": "a test product test test 001" } ], "description_multi_language_list": [ { "locale": "es_ES", "module_list": [ { "type": "html", "html": { "content": "uno test test description 002" } } ] } ], "locale": "es_ES", "product_units_type": "100000015", "image_url_list": [ "https://upload.wikimedia.org/wikipedia/commons/b/ba/E-SENS_architecture.jpg" ], "category_attributes": { "Brand Name": { "value": "200010868" }, "Shirts Type": { "value": "200001208" }, "Material": { "value": [ "567" ] }, "Sleeve Length(cm)": { "value": "200001500" } }, "sku_info_list": [ { "sku_code": "WEO19293829123", "inventory": 3, "price": 9900, "discount_price": 9800, "sku_attributes": { "Size": { "alias": "Uni", "value": "200003528" }, "Color": { "alias": "Black", "value": "193" } } }, { "sku_code": "WEO19293829124", "inventory": 5, "price": 9800, "discount_price": 9700, "sku_attributes": { "Size": { "alias": "Small", "value": "100014064" }, "Color": { "alias": "Blue", "value": "173" } } } ], "inventory_deduction_strategy": "payment_success_deduct", "package_weight": 1.5, "package_length": 10, "package_height": 20, "package_width": 30, "shipping_preparation_time": 3, "shipping_template_id": "714844311", "service_template_id": "0", "product_group_id":"5756383" }
Invoke the API of Post product based on schema or Full edit product based on schema based on the generated product instance from step 2.