Create a product
POST https://{handle}.myshopline.com/admin/openapi/v20260901/products/products.json
handle : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is open001.myshopline.com , the store handle is open001 .Create a new product in the store.
TIP
The API does not support direct management of product SEO information. Product SEO details are managed via metafields. For operation instructions, refer to Editing SEO information for the corresponding resource page through metafield's Open API.
When creating a product via this API, the initial value for
seoTitle is assigned through title, and the initial value for seoDescription is assigned through body_html.Request Headers
- Content-Type string requiredThe field must be set to the fixed value
application/json; charset=utf-8. - Authorization string requiredThe access token for the API resource. Refer to App authorization to obtain the access token, and then pass the obtained token in the Bearer format.Example:
Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
Request Body
productobject
Product information.activated_at stringThe date and time when the product was put on the shelves, which must not be earlier thancreated_at. Format: ISO 8601.When setting this field, the productstatusmust be set toactive; otherwise, this field will be invalid.Example:2025-03-06T02:20:26+08:00body_html stringThe product description.
Maximum size: 512 KBExample:This is a descriptioncreated_at stringThe date and time when the product was created, which must be no earlier than1990-01-01T00:00:00+08:00. Format: ISO 8601.If not provided, the time defaults to when this API call is received.Example:2025-03-06T02:20:26+08:00handle stringThe semantically unique identifier for the product, which is generated based ontitleby default.
Maximum length: 255Example:product-handleimagesobject[]
A list of product images.
Maximum size: 502alt stringThe alternative textual description of the product image, usually a word or phrase with the characteristics or content of the image.
Maximum length: 512src stringThe link to the product image, represented as a URL.
Maximum length: 255Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.pngoptionsobject[]
A list of product options.
Maximum size: 5name stringThe name of the option.
Maximum length: 255Example:Colorvalues_images mapThe mapping relationship between the option value and the corresponding image URL.Example:{"red":"https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"}path stringThe relative path of the product page.
Maximum length: 512Example:/products/clothesproduct_category stringThe product category customized by the merchant.
Maximum length: 255Example:Electronicpublished_at stringThe date and time when the product was published to the online store. Format: ISO 8601.Example:2025-03-06T02:20:26+08:00published_scope stringThe published scope of product sales channels. The value of this field is fixed toweb, indicating an online store.spu stringThe identifier customized for the product by the merchant. It is distinct fromproduct.idreturned by SHOPLINE.Example:S000001status stringThe status of the product. Valid values are:active: products on shelvesdraft: products off shelvesarchived: products archiving
Default value:draftsubtitle stringThe subtitle of the product.
Maximum length: 400Example:This is a subtitle.tags arrayA list of tags of the product.
Maximum size: 250
Maximum length per string: 255Example:["tag1, tag2"]template_path stringThe theme template of the product.Example:templates/product.product_template_name.jsontitle stringThe title of the product.
Maximum length: 255Example:This is a product titlevariantsobject[]
A list of product variants.
Maximum size: 500barcode stringThe barcode of the variant.
Maximum length: 255Example:T0000001compare_at_price stringThe original price of the variant. The value is rounded to two decimal places.
Default value:0Example:129.99imageobject
The image of the variant.alt stringThe alternative textual description of the variant image, usually a word or phrase with the characteristics or content of the image.
Maximum length: 512Example:This is an image altsrc stringThe link to the variant image, represented as a URL.
Maximum length: 255Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.pnginventory_policy stringIndicates whether the variant is allowed to be oversold.deny: overselling not allowedcontinue: overselling allowed
Default value:denyinventory_tracker booleanIndicates whether the inventory tracking is enabled.true: Inventory tracking is enabled.false: Inventory tracking is not enabled.
Default value:trueoption1 stringInformation of the first option of the variant.
Maximum length: 255Example:redoption2 stringInformation of the second option of the variant.
Maximum length: 255Example:xloption3 stringInformation of the third option of the variant.
Maximum length: 255Example:cottonoption4 stringInformation of the fourth option of the variant.
Maximum length: 255Example:shortoption5 stringInformation of the fifth option of the variant.
Maximum length: 255Example:shortprice stringThe selling price of the variant. The value is rounded to two decimal places.
Default value:0Example:90.22required_shipping booleanIndicates whether the variant is required to be shipped.true: Shipping is required.false: Shipping is not required.
Default value:truesku stringThe product SKU. It is distinct fromvariant.idreturned by SHOPLINE.
Maximum size: 255Example:S000000001taxable booleanIndicates whether the variant is subject to tax.true: Tax is required.false: Tax is not required.
Default value:trueweight stringThe weight of the variant. The value is required to be greater than0,and rounded to two decimal places.Example:0.23weight_unit stringThe unit of weight for the variant. Valid values are:g: gramkg: kilogramlb: poundoz: ouncezh_kg: kilogram
Default value:gvendor stringThe brand or vendor of the product.
Maximum length: 255Example:SHOPLINE
Status Codes
- 200
- 401
- 429
For the complete list of codes and messages, see Http status code.
Response Headers
traceId
A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise.
Response Body
productobject
Product information.activated_at stringThe date and time when the product was put on the shelves. Format: ISO 8601.Example:2025-03-06T02:20:26+08:00body_html stringThe product description.created_at stringThe date and time when the product was created. Format: ISO 8601.Example:2025-03-06T02:20:26+08:00handle stringThe semantically unique identifier for the product, which is generated based ontitleby default.Example:product-handleid stringThe unique identifier for the product.Example:16050375155238626683133099imageobject
The cover image of the product.alt stringThe alternative textual description of the image, usually a word or phrase with the characteristics or content of the image.Example:This is an image alt.id stringThe unique identifier for the image.Example:5759070976424132652src stringThe link to the image, represented as a URL.Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.pngimagesobject[]
A list of product images.alt stringThe alternative textual description of the product image, usually a word or phrase with the characteristics or content of the image.Example:This is an image alt.id stringThe unique identifier for the product image.Example:5759070976424132652src stringThe link to the product image, represented as a URL.Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.pngoptionsobject[]
A list of product options.id stringThe unique identifier for the option.Example:16150375907221969070413099name stringThe name of the option.Example:Coloroption_valuesobject[]
A list of product option values.id stringThe unique identifier for the option value.Example:16050375155238626683133099value stringThe option value.Example:redproduct_id stringThe unique identifier for the product corresponding to the option.Example:16050375155238626683133099values arrayA list of option values.Example:["[\"red\", \"green\", \"white\"]"]values_images mapThe mapping relationship between the option value and the corresponding image URL.Example:{"red":"https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"}product_behavior stringUsed to identify the special behavior of the product. This field returns a value only under certain conditions.For example, if the product has potential risks, the field returns a value.Example:RISK, HIDDENproduct_category stringThe product category customized by the merchant.Example:Electronicsproduct_type stringThe source of the product. Valid values are:NORMAL: products maintained in the SHOPLINE AdminPOD_TEMPORARY: temporary products on the Product Option Customizer&ProductBundler appTEMPORARY: other temporary products
published_at stringThe date and time when the product was published to the online store. Format:ISO 8601.Example:2025-03-06T02:20:26+08:00published_scope stringThe published scope of product sales channels. The value of this field is fixed toweb, indicating an online store.spu stringThe identifier customized for the product by the merchant. It is distinct fromproduct.idreturned by SHOPLINE.Example:S000001status stringThe status of the product. Valid values are:active: products on shelvesdraft: products off shelvesarchived: products archiving
subtitle stringThe subtitle of the product.Example:This is a subtitletags stringA list of tags of the product.Example:tag1, tag2template_path stringThe theme template of the product.Example:templates/product.product_template_name.jsontitle stringThe title of the product.Example:This is a product titleupdated_at stringThe date and time when the product was last updated. Format: ISO 8601.Example:2025-03-06T02:20:26+08:00variantsobject[]
A list of product variants.barcode stringThe barcode of the variant.Example:T0000001compare_at_price stringThe original price of the variant. The value is rounded to two decimal places.Example:129.99created_at stringThe date and time when the variant was created. Format: ISO 8601.Example:2025-03-06T02:20:26+08:00id stringThe unique identifier for the variant.Example:18050375907221969070393099imageobject
The image of the variant.alt stringThe alternative textual description of the variant image, usually a word or phrase with the characteristics or content of the image.Example:This is an image alt.id stringThe unique identifier for the variant image.Example:5759070976424132652src stringThe link to the variant image, represented as a URL.Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.pnginventory_item_id stringThe unique identifier for the inventory item.Example:5705499385037070868inventory_policy stringIndicates whether the variant is allowed to be oversold.deny: overselling not allowedcontinue: overselling allowed
inventory_quantity integerThe total inventory quantity at all storage locations.Example:99inventory_tracker booleanIndicates whether the inventory tracking is enabled.true: Inventory tracking is enabled.false: Inventory tracking is not enabled.
option1 stringInformation of the first option of the variant.Example:redoption2 stringInformation of the second option of the variant.Example:xloption3 stringInformation of the third option of the variant.Example:cottonoption4 stringInformation of the fourth option of the variant.Example:shortoption5 stringInformation of the fifth option of the variant.Example:casualprice stringThe selling price of the variant. The value is rounded to two decimal places.Example:90.22product_id stringThe unique identifier for the product corresponding to the variant.Example:16050375155238626683133099required_shipping booleanIndicates whether the variant is required to be shipped.true: Shipping is required.false: Shipping is not required.
sku stringThe product SKU. It is distinct fromvariant.idreturned by SHOPLINE.Example:S000000001taxable booleanIndicates whether the variant is subject to tax.true: Tax is required.false: Tax is not required.
title stringThe title of the variant, assembled from the option values of the variant.Example:red · xlupdated_at stringThe date and time when the variant was last updated. Format: ISO 8601.Example:2025-03-06T02:20:26+08:00weight stringThe weight of the variant. The value is rounded up if it exceeds two decimal places.Example:0.23weight_unit stringThe unit of weight for the variant. Valid values are:g: gramkg: kilogramlb: poundoz: ouncezh_kg: kilogram
vendor stringThe brand or vendor of the product.Example:SHOPLINE
API Explorer
Debugger
Examples
Was this article helpful to you?