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 published, 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 not be earlier than1990-01-01T00:00:00+08:00. Format: ISO 8601.If not provided, the time defaults to the current time.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: 502DEPRECATED:This parameter is deprecated from API version v20260301.alt 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.
Maximum length: 255Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.pngmediaobject[]
A list of product media.
Maximum size: 502alt stringThe alternative textual description of the product media, usually a word or phrase with the characteristics or content of the media.
Maximum length: 512Example:This is a media alt.content_type stringThe type of the media. Valid values are:IMAGE:Represents a SHOPLINE image.VIDEO:Represents a SHOPLINE video.EXTERNAL_VIDEO:Represents an external video.
id stringThe unique ID of an existing media file. Omit this field if you add new media viaoriginal_source.
Maximum length: 64Example:5759070976424132652media_preview_imageobject
Configuration for the video cover image. Specify this parameter whencontent_typeis set toVIDEO.imageobject
Custom cover image information. Specify this parameter whensourceis set toUPLOADED. Supported image formats: GIF, JPG, JPEG, PNG, WebP, and SVG.src stringThe URL of the custom cover image.
Maximum length: 255Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.pngsource stringSource type of the cover image. Valid values are:VIDEO_FRAME_CAPTURE: capture of a single frame from the videoUPLOADED: upload of a custom cover image
video_frame_ms integerMillisecond of the video frame to capture. This parameter is valid only whensourceisVIDEO_FRAME_CAPTURE.Default value:0(indicating the capture of the first frame of the video; the default image format is PNG).original_source stringThe resource URL used to add a new media file. It can be an external image URL, a staged upload URL, or a SHOPLINE file URL.Example:https://sl-resource-tmp-sg.s3-ap-southeast-1.xxx.com/temp%2Ffile%2Fstore%2F1672369729606%2F6995259736342668404%2Fimage.png?Expires=1747882880&OSSAccessKeyId=LTAI5tNjm7fr4EUCoEps4UPE&Signature=kLIWPCVwWTQMZcHUWyszjoH4DPM%3Doptionsobject[]
A list of product options.
Maximum size: 5name stringThe name of the option.
Maximum length: 255Example:Colorvalues_colors mapThe mapping relationship between option values and hexadecimal color codes.Example:{"blue":"#87CEEB","red":"#D22222"}values_images mapThe mapping relationship between the option values and the corresponding image URLs.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.
Maximum size: 255Example:S000001status stringThe status of the product. Valid values are:active: product publisheddraft: product unpublishedarchived: product archived
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 altid stringThe unique identifier for the variant image.
Maximum length:64Example:5759070976424132652src stringThe link to the variant image.
Maximum length: 255Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.pnginventory_policy stringIndicates whether the variant is allowed to be oversold.deny: Overselling is not allowed.continue: Overselling is 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 requires shipping.sku stringThe product SKU. It is distinct fromvariant.idreturned by SHOPLINE.
Maximum length: 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 must be greater than0, and rounded up 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 published. 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:00featured_mediaobject
The cover media of the product.alt stringThe alternative textual description of the product media, usually a word or phrase with the characteristics or content of the media.Example:This is a media alt.content_type stringThe type of the media. Valid values are:IMAGE:Represents a SHOPLINE image.VIDEO:Represents a SHOPLINE video.EXTERNAL_VIDEO:Represents an external video.
id stringThe unique identifier for the product media.Example:5759070976424132652preview_image stringThe URL of the product media cover image.Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.pngsrc stringThe link to the media.Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.pnghandle 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.DEPRECATED:This parameter is deprecated from API version v20260301.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.Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.pngimagesobject[]
A list of product images.DEPRECATED:This parameter is deprecated from API version v20260301.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.Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.pngmediaobject[]
A list of product media.alt stringThe alternative textual description of the product media, usually a word or phrase with the characteristics or content of the media.Example:This is a media alt.content_type stringThe type of the media. Valid values are:IMAGE:Represents a SHOPLINE image.VIDEO:Represents a SHOPLINE video.EXTERNAL_VIDEO:Represents an external video.
id stringThe unique identifier for the product media.Example:5759070976424132652preview_image stringThe URL of the product media cover image.Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.pngsrc stringThe link to the media.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_colors mapThe mapping relationship between option values and hexadecimal color codes.Example:{"blue":"#87CEEB","red":"#D22222"}values_images mapThe mapping relationship between the option values and the corresponding image URLs.Example:{"red":"https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"}product_behavior stringUsed to identify special circumstances regarding 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: product publisheddraft: product unpublishedarchived: product archived
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.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 is not allowed.continue: Overselling is 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 requires shipping.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?