Requires write_products access scope.
For more info , refer to:
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 required
    The value of this field is fixed to application/json; charset=utf-8
  • Authorization string required
    The 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 data
  • body_html string
    Product description , limited to 512k
    Example: This is a description
  • handle string
    Globally unique product handle, default product title, limited to 255 characters
    Example: product-handle
  • imagesobject[]
    Product main image , up to 502 sheets
  • alt string
    Alt information of the image , limited to 255 characters
    Example: This is a image alt
  • src string
    Corresponding image src link, limited to 255 characters
    Example: https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
  • optionsobject[]
    Option collection, up to 5
  • name string
    Option name , limited to 255 characters
    Example: Color
  • values_images map
    The image of option value
    Example: [object Object]
  • product_category string
    Product category
    Example: Electronic
  • published_scope string
    Set the sales channel , when the value is " web " , it means online stores
    Example: web
  • spu string
    SPU Code, limited to 255 characters
    Example: S000001
  • status string
    Product status ; activated- on shelves , deactivated- off shelves , archived- filing
    Example: active
  • subtitle string
    Product summary, limited to 255 characters
    Example: This is a subtitle
  • tags array
    Product tag up to 250 tag and each tag length limited to up to 255
    Example: tag1, tag2
  • title string
    Product title , limited to 255 characters
    Example: This is a title
  • variantsobject[]
    Variant list, up to 500
  • barcode string
    Barcode , limited to 255 characters
    Example: B000000001
  • compare_at_price string
    Original price, default null
    Example: 11
  • imageobject
    Variant image
  • alt string
    Alt information of the image , limited to 255 characters
    Example: This is a image alt
  • src string
    Image src, limited to 255 characters
    Example: https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
  • inventory_policy string
    Oversold strategy: deny - Oversold is not allowed, continue - Oversold is allowed
    Example: deny
  • inventory_tracker boolean
    Track inventory , default is not tracking or not
    Example: true
  • option1 string
    The variant corresponds to the value of the option1 limited to 255 characters
    Example: Red
  • option2 string
    The variant corresponds to the value of the option2 limited to 255 characters
    Example: L
  • option3 string
    The variant corresponds to the value of the option3 limited to 255 characters
  • option4 string
    The variant corresponds to the value of the option4 limited to 255 characters
  • option5 string
    The variant corresponds to the value of the option5 limited to 255 characters
  • price string
    Selling price, default is 0
    Example: 10.11
  • required_shipping boolean
    Shipping or not
    Example: true
  • sku string
    SKU code , limited to 255 characters
    Example: T0000000001
  • taxable boolean
    Tax collection or not required
    Example: true
  • weight string
    Weight, it is required to be greater than 0, and rounded up to two decimal places
    Example: 1.2
  • weight_unit string
    Weight units : g , kg , lb , oz , zh_kg
    Example: kg
  • vendor string
    vendor, limited to 255 characters
    Example: Shopline
Response
For more information about status codes, see Http status code.

Response Headers
  • traceId
    traceId
Response Body
  • productobject
    Product object
  • body_html string
    Product description
    Example: This is a description
  • created_at string
    Creation time
    Example: 2021-09-02T14:11:54+00:00
  • handle string
    Global unique Product handle
    Example: product-handle
  • id string
    Product ID
    Example: 16050375155238626683133099
  • imageobject
    Product main image
  • alt string
    Images alt
    Example: This is a image alt
  • id string
    Image id
    Example: 5759070976424132652
  • src string
    Image src
    Example: https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
  • imagesobject[]
    Product image list
  • alt string
    Images alt
    Example: This is a image alt
  • id string
    Image id
    Example: 5759070976424132652
  • src string
    Image src
    Example: https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
  • optionsobject[]
    Option collection
  • id string
    Option id
    Example: 16150375907221969070413099
  • name string
    Option name
    Example: Color
  • product_id string
    Product ID
    Example: 16050375155238626683133099
  • values array
    List of option value
    Example: ["Red", "Green", "White"]
  • values_images map
    The image of option value
    Example: [object Object]
  • product_behavior string
    Product behavior
  • product_category string
    Product category
    Example: Electronic
  • product_type string
    Product type: NORMAL, POD_TEMPORARY, TEMPORARY
    Example: NORMAL
  • published_at string
    Time to post to the online store
    Example: 2021-09-02T14:11:54+00:00
  • published_scope string
    Set the sales channel , when the value is " web " , it means online stores
    Example: web
  • spu string
    SPU code
    Example: S000001
  • status string
    Product status ; activated- on shelves , deactivated- off shelves , archived- filing
    Example: active
  • subtitle string
    Product summary
    Example: This is a subtitle
  • tags string
    Product tag
    Example: tag1, tag2
  • template_path string
    Theme template
  • title string
    Product title
    Example: This is a title
  • updated_at string
    Update time
    Example: 2021-09-02T14:11:54+00:00
  • variantsobject[]
    Variant list
  • barcode string
    Barcode
    Example: B000000001
  • compare_at_price string
    Original price
    Example: 11
  • created_at string
    Creation time
    Example: 2021-09-02T14:11:54+00:00
  • id string
    variant id
    Example: 18050375907221969070393099
  • imageobject
    Variant Image
  • alt string
    Images alt
    Example: This is a image alt
  • id string
    Image id
    Example: 5759070976424132652
  • src string
    Image src
    Example: https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
  • inventory_item_id string
    Inventory item ID
  • inventory_policy string
    Oversold strategy: deny - Oversold is not allowed, continue - Oversold is allowed
    Example: deny
  • inventory_quantity integer
    Inventory summary for all locations
    Example: 99
  • inventory_tracker boolean
    Track inventory or not
    Example: true
  • option1 string
    The variant corresponds to the value of the option1
    Example: Red
  • option2 string
    The variant corresponds to the value of the option2
    Example: L
  • option3 string
    The variant corresponds to the value of the option3
  • option4 string
    The variant corresponds to the value of the option4
  • option5 string
    The variant corresponds to the value of the option5
  • price string
    Selling price
    Example: 10.11
  • product_id string
    Product ID
    Example: 16050375155238626683133099
  • required_shipping boolean
    Shipping or not
    Example: true
  • sku string
    SKU code
    Example: 2111341123434
  • taxable boolean
    Tax collection or not required
    Example: true
  • title string
    variant title
    Example: Red/L
  • updated_at string
    Update time
    Example: 2021-09-02T14:11:54+00:00
  • weight string
    Weight
    Example: 1.2
  • weight_unit string
    Weight units : g , kg , lb , oz , zh_kg
    Example: kg
  • vendor string
    vendor
    Example: Shopline
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20240301

ParamOptions

— header required

Body

required
{
  "product": {
    "body_html": "This is a description",
    "handle": "product-handle",
    "images": [
      {
        "alt": "This is a image alt",
        "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
      }
    ],
    "options": [
      {
        "name": "Color",
        "values_images": {}
      }
    ],
    "product_category": "Electronic",
    "published_scope": "web",
    "spu": "S000001",
    "status": "active",
    "subtitle": "This is a subtitle",
    "tags": [
      "tag1, tag2"
    ],
    "title": "This is a title",
    "variants": [
      {
        "barcode": "B000000001",
        "compare_at_price": "11",
        "image": {
          "alt": "This is a image alt",
          "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
        },
        "inventory_policy": "deny",
        "inventory_tracker": true,
        "option1": "Red",
        "option2": "L",
        "option3": "",
        "option4": "",
        "option5": "",
        "price": "10.11",
        "required_shipping": true,
        "sku": "T0000000001",
        "taxable": true,
        "weight": "1.2",
        "weight_unit": "kg"
      }
    ],
    "vendor": "Shopline"
  }
}

Language

curl --request POST \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20240301/products/products.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json'
Examples
Create Product
Request
{
"product": {
"body_html": "<p>Thisisadesription</p>",
"created_at": "2023-08-28T11:52:10+08:00",
"handle": "my-product-23",
"images": [
{
"alt": "Thisisaimagealt",
"src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
}
],
"options": [
{
"name": "Size",
"values": [
"L",
"XL",
"XXL"
],
"values_images": {}
},
{
"name": "Color",
"values": [
"White"
],
"values_images": {}
}
],
"product_category": "Clothes",
"published_at": "2023-08-28T11:52:10+08:00",
"published_scope": "web",
"spu": "S000000001",
"status": "active",
"subtitle": "Thisisasubtitle",
"tags": [
"Spring",
"Tshirt"
],
"template_path": "templates/products/detail.html",
"title": "MyProduct25",
"variants": [
{
"barcode": "T00000001",
"compare_at_price": "120.00",
"image": {
"alt": "Thisisaimagealt",
"src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
},
"inventory_policy": "continue",
"inventory_tracker": true,
"option1": "L",
"option2": "White",
"position": 1,
"price": "100.00",
"required_shipping": true,
"sku": "S00000000101",
"taxable": true,
"title": "L·White",
"weight": "10.00",
"weight_unit": "g"
},
{
"barcode": "B0000000001",
"compare_at_price": "120.00",
"image": {
"alt": "Thisisaimagealt",
"src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
},
"inventory_policy": "deny",
"inventory_tracker": true,
"option1": "XL",
"option2": "White",
"position": 2,
"price": "100.00",
"required_shipping": true,
"sku": "S00000000102",
"taxable": true,
"title": "XL·White",
"weight": "50.00",
"weight_unit": "g"
},
{
"barcode": "B0000000001",
"compare_at_price": "120.00",
"image": {
"alt": "Thisisaimagealt",
"src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
},
"inventory_policy": "deny",
"inventory_tracker": true,
"option1": "XXL",
"option2": "White",
"position": 3,
"price": "100.00",
"required_shipping": true,
"sku": "S00000000103",
"taxable": true,
"title": "XXL·White",
"weight": "50.00",
"weight_unit": "g"
}
],
"vendor": "Shopline"
}
}
Response
{
"product": {
"body_html": "<p>Thisisadesription</p>",
"created_at": "2024-03-29T16:56:28+08:00",
"handle": "my-product-23-2",
"id": "16063984020156223494610520",
"image": {
"alt": "Thisisaimagealt",
"id": "6398402015348996146",
"src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
},
"images": [
{
"alt": "Thisisaimagealt",
"id": "6398402015348996146",
"src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
}
],
"options": [
{
"id": "16163984020161759975980520",
"name": "Size",
"product_id": "16063984020156223494610520",
"values": [
"L",
"XL",
"XXL"
],
"values_images": {}
},
{
"id": "16163984020161759976010520",
"name": "Color",
"product_id": "16063984020156223494610520",
"values": [
"White"
],
"values_images": {}
}
],
"product_behavior": "",
"product_category": "Clothes",
"product_type": "NORMAL",
"published_at": "2024-03-29T16:56:28+08:00",
"published_scope": "web",
"spu": "S000000001",
"status": "active",
"subtitle": "Thisisasubtitle",
"tags": "Spring,Tshirt",
"title": "MyProduct25",
"updated_at": "2024-03-29T16:56:28+08:00",
"variants": [
{
"barcode": "T00000001",
"compare_at_price": "120.00",
"created_at": "2024-03-29T16:56:28+08:00",
"id": "18063984020161759975960520",
"image": {
"alt": "Thisisaimagealt",
"id": "6398402015348996146",
"src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
},
"inventory_item_id": "6398402018457731423",
"inventory_policy": "continue",
"inventory_quantity": 0,
"inventory_tracker": true,
"option1": "L",
"option2": "White",
"price": "100.00",
"product_id": "16063984020156223494610520",
"required_shipping": true,
"sku": "S00000000101",
"taxable": true,
"title": "L · White",
"updated_at": "2024-03-29T16:56:28+08:00",
"weight": "10.00",
"weight_unit": "g"
},
{
"barcode": "B0000000001",
"compare_at_price": "120.00",
"created_at": "2024-03-29T16:56:28+08:00",
"id": "18063984020161759976050520",
"image": {
"alt": "Thisisaimagealt",
"id": "6398402015348996146",
"src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
},
"inventory_item_id": "6398402018457731421",
"inventory_policy": "deny",
"inventory_quantity": 0,
"inventory_tracker": true,
"option1": "XL",
"option2": "White",
"price": "100.00",
"product_id": "16063984020156223494610520",
"required_shipping": true,
"sku": "S00000000102",
"taxable": true,
"title": "XL · White",
"updated_at": "2024-03-29T16:56:28+08:00",
"weight": "50.00",
"weight_unit": "g"
},
{
"barcode": "B0000000001",
"compare_at_price": "120.00",
"created_at": "2024-03-29T16:56:28+08:00",
"id": "18063984020161759976110520",
"image": {
"alt": "Thisisaimagealt",
"id": "6398402015348996146",
"src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
},
"inventory_item_id": "6398402018457731422",
"inventory_policy": "deny",
"inventory_quantity": 0,
"inventory_tracker": true,
"option1": "XXL",
"option2": "White",
"price": "100.00",
"product_id": "16063984020156223494610520",
"required_shipping": true,
"sku": "S00000000103",
"taxable": true,
"title": "XXL · White",
"updated_at": "2024-03-29T16:56:28+08:00",
"weight": "50.00",
"weight_unit": "g"
}
],
"vendor": "Shopline"
}
}
Was this article helpful to you?

Error loading component.

Error loading component.