Create product
POST https://{handle}.myshopline.com/admin/openapi/v20240301/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 product
Request Headers
- Content-Type requiredThe value of this field is fixed to
application/json; charset=utf-8
- Authorization string requiredThe access token for the API. Please refer to App authorization to obtain the access token, and then put the obtained access token into the API request header in Bearer Token.Example:
Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
Request Body
productobject
Product databody_html stringProduct description , limited to 512kExample:This is a description
handle stringGlobally unique product handle, default product title, limited to 255 charactersExample:product-handle
imagesobject[]
Product main image , up to 502 sheetsalt stringAlt information of the image , limited to 255 charactersExample:This is a image alt
src stringCorresponding image src link, limited to 255 charactersExample:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
optionsobject[]
Option collection, up to 5name stringOption name , limited to 255 charactersExample:Color
values_images mapThe image of option valueExample:[object Object]
product_category stringProduct categoryExample:Electronic
published_scope stringSet the sales channel , when the value is " web " , it means online storesExample:web
spu stringSPU Code, limited to 255 charactersExample:S000001
status stringProduct status ; activated- on shelves , deactivated- off shelves , archived- filingExample:active
subtitle stringProduct summary, limited to 255 charactersExample:This is a subtitle
tags arrayProduct tag up to 250 tag and each tag length limited to up to 255Example:tag1, tag2
title stringProduct title , limited to 255 charactersExample:This is a title
variantsobject[]
Variant list, up to 500barcode stringBarcode , limited to 255 charactersExample:B000000001
compare_at_price stringOriginal price, default nullExample:11
imageobject
Variant imagealt stringAlt information of the image , limited to 255 charactersExample:This is a image alt
src stringImage src, limited to 255 charactersExample:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
inventory_policy stringOversold strategy: deny - Oversold is not allowed, continue - Oversold is allowedExample:deny
inventory_tracker booleanTrack inventory , default is not tracking or notExample:true
option1 stringThe variant corresponds to the value of the option1 limited to 255 charactersExample:Red
option2 stringThe variant corresponds to the value of the option2 limited to 255 charactersExample:L
option3 stringThe variant corresponds to the value of the option3 limited to 255 charactersoption4 stringThe variant corresponds to the value of the option4 limited to 255 charactersoption5 stringThe variant corresponds to the value of the option5 limited to 255 charactersprice stringSelling price, default is 0Example:10.11
required_shipping booleanShipping or notExample:true
sku stringSKU code , limited to 255 charactersExample:T0000000001
taxable booleanTax collection or not requiredExample:true
weight stringWeight, it is required to be greater than 0, and rounded up to two decimal placesExample:1.2
weight_unit stringWeight units : g , kg , lb , oz , zh_kgExample:kg
vendor stringvendor, limited to 255 charactersExample:Shopline
Response
- 200
- 201
- 401
- 429
For more information about status codes, see Http status code.
Response Headers
traceId
traceId
Response Body
productobject
Product objectbody_html stringProduct descriptionExample:This is a description
created_at stringCreation timeExample:2021-09-02T14:11:54+00:00
handle stringGlobal unique Product handleExample:product-handle
id stringProduct IDExample:16050375155238626683133099
imageobject
Product main imagealt stringImages altExample:This is a image alt
id stringImage idExample:5759070976424132652
src stringImage srcExample:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
imagesobject[]
Product image listalt stringImages altExample:This is a image alt
id stringImage idExample:5759070976424132652
src stringImage srcExample:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
optionsobject[]
Option collectionid stringOption idExample:16150375907221969070413099
name stringOption nameExample:Color
product_id stringProduct IDExample:16050375155238626683133099
values arrayList of option valueExample:["Red", "Green", "White"]
values_images mapThe image of option valueExample:[object Object]
product_behavior stringProduct behaviorproduct_category stringProduct categoryExample:Electronic
product_type stringProduct type: NORMAL, POD_TEMPORARY, TEMPORARYExample:NORMAL
published_at stringTime to post to the online storeExample:2021-09-02T14:11:54+00:00
published_scope stringSet the sales channel , when the value is " web " , it means online storesExample:web
spu stringSPU codeExample:S000001
status stringProduct status ; activated- on shelves , deactivated- off shelves , archived- filingExample:active
subtitle stringProduct summaryExample:This is a subtitle
tags stringProduct tagExample:tag1, tag2
template_path stringTheme templatetitle stringProduct titleExample:This is a title
updated_at stringUpdate timeExample:2021-09-02T14:11:54+00:00
variantsobject[]
Variant listbarcode stringBarcodeExample:B000000001
compare_at_price stringOriginal priceExample:11
created_at stringCreation timeExample:2021-09-02T14:11:54+00:00
id stringvariant idExample:18050375907221969070393099
imageobject
Variant Imagealt stringImages altExample:This is a image alt
id stringImage idExample:5759070976424132652
src stringImage srcExample:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
inventory_item_id stringInventory item IDinventory_policy stringOversold strategy: deny - Oversold is not allowed, continue - Oversold is allowedExample:deny
inventory_quantity integerInventory summary for all locationsExample:99
inventory_tracker booleanTrack inventory or notExample:true
option1 stringThe variant corresponds to the value of the option1Example:Red
option2 stringThe variant corresponds to the value of the option2Example:L
option3 stringThe variant corresponds to the value of the option3option4 stringThe variant corresponds to the value of the option4option5 stringThe variant corresponds to the value of the option5price stringSelling priceExample:10.11
product_id stringProduct IDExample:16050375155238626683133099
required_shipping booleanShipping or notExample:true
sku stringSKU codeExample:2111341123434
taxable booleanTax collection or not requiredExample:true
title stringvariant titleExample:Red/L
updated_at stringUpdate timeExample:2021-09-02T14:11:54+00:00
weight stringWeightExample:1.2
weight_unit stringWeight units : g , kg , lb , oz , zh_kgExample:kg
vendor stringvendorExample:Shopline
API Explorer
Debugger
Examples
Was this article helpful to you?
Error loading component.