Create a product
POST https://{handle}.myshopline.com/admin/openapi/v20260301/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.
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.created_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.product_category stringThe product category customized by the merchant.
Maximum length: 255variantsobject[]
A list of product variants.
Maximum size: 500option2 stringInformation of the second option of the variant.
Maximum length: 255taxable booleanIndicates whether the variant is subject to tax.true: Tax is required.false: Tax is not required.
Default value:trueoption5 stringInformation of the fifth option of the variant.
Maximum length: 255sku stringThe product SKU. It is distinct fromvariant.idreturned by SHOPLINE.
Maximum size: 255option4 stringInformation of the fourth option of the variant.
Maximum length: 255price stringThe selling price of the variant. The value is rounded to two decimal places.
Default value:0barcode stringThe barcode of the variant.
Maximum length: 255compare_at_price stringThe original price of the variant. The value is rounded to two decimal places.
Default value:0option1 stringInformation of the first option of the variant.
Maximum length: 255required_shipping booleanIndicates whether the variant is required to be shipped.true: Shipping is required.false: Shipping is not required.
Default value:trueweight_unit stringThe unit of weight for the variant. Valid values are:g: gramkg: kilogramlb: poundoz: ouncezh_kg: kilogram
Default value:ginventory_tracker booleanIndicates whether the inventory tracking is enabled.true: Inventory tracking is enabled.false: Inventory tracking is not enabled.
Default value:trueoption3 stringInformation of the third option of the variant.
Maximum length: 255weight stringThe weight of the variant. The value is required to be greater than0,and rounded to two decimal places.imageobject
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: 512src stringThe link to the variant image, represented as a URL.
Maximum length: 255inventory_policy stringIndicates whether the variant is allowed to be oversold.deny: overselling not allowedcontinue: overselling allowed
Default value:denyvendor stringThe brand or vendor of the product.
Maximum length: 255handle stringThe semantically unique identifier for the product, which is generated based ontitleby default.
Maximum length: 255subtitle stringThe subtitle of the product.
Maximum length: 400published_at stringThe date and time when the product was published to the online store. Format: ISO 8601.status stringThe status of the product. Valid values are:active: products on shelvesdraft: products off shelvesarchived: products archiving
Default value:draftspu stringThe identifier customized for the product by the merchant. It is distinct fromproduct.idreturned by SHOPLINE.template_path stringThe theme template of the product.path stringThe relative path of the product page.
Maximum length: 512tags arrayA list of tags of the product.
Maximum size: 250
Maximum length per string: 255Example:[""]title stringThe title of the product.
Maximum length: 255published_scope stringThe published scope of product sales channels. The value of this field is fixed toweb, indicating an online store.body_html stringThe product description.
Maximum length: 512optionsobject[]
A list of product options.
Maximum size: 5values_images mapThe mapping relationship between the option value and the corresponding image URL.Example:{}name stringThe name of the option.
Maximum length: 255imagesobject[]
A list of product images.
Maximum size: 502src stringThe link to the product image, represented as a URL.
Maximum length: 255alt stringThe alternative textual description of the product image, usually a word or phrase with the characteristics or content of the image.
Maximum length: 512activated_at stringThe date and time when the product was put on the shelves, which must not be earlier thancreated_at. Format: ISO 8601.
Status Codes
- 200
- 201
- 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.product_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
body_html stringThe product description.published_at stringThe date and time when the product was published to the online store. Format:ISO 8601.spu stringThe identifier customized for the product by the merchant. It is distinct fromproduct.idreturned by SHOPLINE.template_path stringThe theme template of the product.imagesobject[]
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.id stringThe unique identifier for the product image.src stringThe link to the product image, represented as a URL.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.subtitle stringThe subtitle of the product.vendor stringThe brand or vendor of the product.id stringThe unique identifier for the product.activated_at stringThe date and time when the product was put on the shelves. Format: ISO 8601.imageobject
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.id stringThe unique identifier for the image.src stringThe link to the image, represented as a URL.created_at stringThe date and time when the product was created. Format: ISO 8601.handle stringThe semantically unique identifier for the product, which is generated based ontitleby default.published_scope stringThe published scope of product sales channels. The value of this field is fixed toweb, indicating an online store.title stringThe title of the product.variantsobject[]
A list of product variants.option2 stringInformation of the second option of the variant.sku stringThe product SKU. It is distinct fromvariant.idreturned by SHOPLINE.inventory_quantity integerThe total inventory quantity at all storage locations.option3 stringInformation of the third option of the variant.updated_at stringThe date and time when the variant was last updated. Format: ISO 8601.weight stringThe weight of the variant. The value is rounded up if it exceeds two decimal places.created_at stringThe date and time when the variant was created. Format: ISO 8601.id stringThe unique identifier for the variant.option4 stringInformation of the fourth option of the variant.title stringThe title of the variant, assembled from the option values of the variant.inventory_policy stringIndicates whether the variant is allowed to be oversold.deny: overselling not allowedcontinue: overselling allowed
weight_unit stringThe unit of weight for the variant. Valid values are:g: gramkg: kilogramlb: poundoz: ouncezh_kg: kilogram
compare_at_price stringThe original price of the variant. The value is rounded to two decimal places.price stringThe selling price of the variant. The value is rounded to two decimal places.taxable booleanIndicates whether the variant is subject to tax.true: Tax is required.false: Tax is not required.
imageobject
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.id stringThe unique identifier for the variant image.src stringThe link to the variant image, represented as a URL.option1 stringInformation of the first option of the variant.option5 stringInformation of the fifth option of the variant.required_shipping booleanIndicates whether the variant is required to be shipped.true: Shipping is required.false: Shipping is not required.
inventory_tracker booleanIndicates whether the inventory tracking is enabled.true: Inventory tracking is enabled.false: Inventory tracking is not enabled.
inventory_item_id stringThe unique identifier for the inventory item.barcode stringThe barcode of the variant.product_id stringThe unique identifier for the product corresponding to the variant.optionsobject[]
A list of product options.id stringThe unique identifier for the option.name stringThe name of the option.option_valuesobject[]
A list of product option values.value stringThe option value.id stringThe unique identifier for the option value.product_id stringThe unique identifier for the product corresponding to the option.values arrayA list of option values.Example:[""]values_images mapThe mapping relationship between the option value and the corresponding image URL.Example:{}updated_at stringThe date and time when the product was last updated. Format: ISO 8601.product_category stringThe product category customized by the merchant.status stringThe status of the product. Valid values are:active: products on shelvesdraft: products off shelvesarchived: products archiving
tags stringA list of tags of the product.
API Explorer
Debugger
Examples
Was this article helpful to you?