Requires write_products access scope.
For more info , refer to:
POST https://{handle}.myshopline.com/admin/openapi/v20231201/products/smart_collections.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 smart classification
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
  • smart_collectionobject required
    Intelligent collection relevant information
  • bannerobject
    Collection banner
  • alt string
    Image alt
    Example: This is a image alt
  • src string
    Image src
    Example: https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
  • body_html string
    Collection description
    Example: This is a description
  • disjunctive boolean
    Relationship between the intelligent collection box and Product conditions true : Product meets any condition and can be incorporated into the intelligent collection false : Product must meet all conditions and must be fully compliant to be incorporated into this intelligent collection
    Example: true
  • handle string
    collection Handle
    Example: collection-handle
  • imageobject
    collection images
  • alt string
    Image alt
    Example: This is a image alt
  • src string
    Image src
    Example: https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
  • published_scope string
    Set the launch range , when the value is " web " , it means online stores
    Example: web
  • rulesobject[] required
    Smartly add condition
  • column string required
    Conditions variable , Product title : title , selling price : sale_price , original price : compared_at_price , tag : tag , inventory : inventory , supplier : vendor ,Weight : variant_weight , specification name : variant_title , created time : created_at , sales : sales , browsing : view , purchase : add_to_cart ,Product type : product_category, product metafield definition : product_metafield_definition, type: type , product taxonomy node id: product_taxonomy_node_id
    Example: product_metafield_definition
  • condition string
    Value of the corresponding condition variable
    Example: true
  • condition_object_id long
    The ID of the metafield object
    Example: 459302847
  • relation string required
    The if-else statement is equal to : equals , not equal to : not_equals , the beginning is : starts_with , the end is : ends_with , including : contains , not included : not_contains ,Greater than : greater_than , less than : less_than
    Example: equals
  • sort_order string
    Product name , sort by , hot sale : best-selling , product name from a-z : alpha-asc , product name from z-a : alpha-desc , new update time → old : updated-desc ,Update time old → new : updated-asc , custom : manual
    Example: updated-asc
  • title string required
    Collection title
    Example: This is a title
Response
For more information about status codes, see Http status code.

Response Headers
  • traceId
    traceId
Response Body
  • smart_collectionobject
    Intelligent collection information
  • bannerobject
    Collection banner
  • alt string
    Image alt
    Example: This is a image alt
  • src string
    Image src
    Example: https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
  • body_html string
    Collection description
    Example: This is a description
  • created_at string
    Creation time
    Example: 2021-09-03T14:11:54+00:00
  • disjunctive boolean
    Relationship between conditions
    Example: true
  • handle string
    Collection handle
    Example: collection-handle
  • id string
    Collection id
    Example: 12257170618007271602093384
  • imageobject
    Collection images
  • alt string
    Image alt
    Example: This is a image alt
  • src string
    Image src
    Example: https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
  • published_at string
    Time to post to online stores
    Example: 2021-09-03T14:11:54+00:00
  • published_scope string
    The launch range , when the value is " web " , indicates online stores
    Example: web
  • rulesobject[]
    Smartly add condition
  • column string
    Conditions variable,title : title , selling price : sale_price , original price : compared_at_price , tag : tag , inventory : inventory , supplier : vendor ,Weight : variant_weight , specification name : variant_title , created time : created_at , sales : sales , browsing : view , purchase : add_to_cart ,Custom type : type , standardized product type : product_taxonomy_node_id , field of origin : product_metafield_definition
    Example: product_metafield_definition
  • condition string
    Value of the corresponding condition variable
    Example: true
  • condition_object_id long
    The ID of the metafield object
    Example: 459302847
  • relation string
    The if-else statement is equal to : equals , not equal to : not_equals , the beginning is : starts_with , the end is : ends_with , including : contains , not included : not_contains ,Greater than : greater_than , less than : less_than
    Example: equals
  • sort_order string
    Sort by , hot sale : best-selling , product name from a-z : alpha-asc , product name from z-a : alpha-desc , new update time → old : updated-desc ,Update time old → new : updated-asc , custom : manual
    Example: updated-asc
  • template_path string
    Theme template
    Example: templates/sortation/detail.json
  • title string
    Collection title
    Example: This is a title
  • updated_at string
    Update time
    Example: 2021-09-03T14:11:54+00:00
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20231201

ParamOptions

— header required

Body

required
{
  "smart_collection": {
    "banner": {
      "alt": "This is a image alt",
      "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
    },
    "body_html": "This is a description",
    "disjunctive": true,
    "handle": "collection-handle",
    "image": {
      "alt": "This is a image alt",
      "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
    },
    "published_scope": "web",
    "rules": [
      {
        "column": "product_metafield_definition",
        "condition": "true",
        "condition_object_id": 459302847,
        "relation": "equals"
      }
    ],
    "sort_order": "updated-asc",
    "title": "This is a title"
  }
}

Language

curl --request POST \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20231201/products/smart_collections.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
Request
{
"smart_collection": {
"banner": {
"alt": "This is a image alt",
"src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
},
"body_html": "This is a description",
"disjunctive": "true",
"handle": "four-zn",
"image": {
"alt": "This is a image alt",
"src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
},
"published_scope": "web",
"rules": [
{
"column": "tag",
"condition": "T shirt",
"relation": "equals"
}
],
"sort_order": "updated-asc",
"title": "Four Smart Collection"
}
}
Response
{
"smart_collection": {
"banner": {
"alt": "This is a image alt",
"src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png?type=banner"
},
"body_html": "This is a description",
"created_at": "2023-08-29T16:05:23+08:00",
"disjunctive": true,
"handle": "four-zn",
"id": "12260895961380206730473144",
"image": {
"alt": "This is a image alt",
"src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png?type=cover"
},
"published_at": "2023-08-29T16:05:23+08:00",
"published_scope": "web",
"rules": [
{
"column": "tag",
"condition": "T shirt",
"relation": "equals"
}
],
"sort_order": "updated-asc",
"title": "Four Smart Collection",
"updated_at": "2023-08-29T16:05:23+08:00"
}
}
Was this article helpful to you?

Error loading component.

Error loading component.