Requires write_products access scope.
For more info , refer to:
PUT https://{handle}.myshopline.com/admin/openapi/v20250601/products/smart_collections/:collection_id/order.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 .
Modify the sorting type of a smart collection, supporting the adjustment of the product order within the collection.
Path Parameters
  • collection_id string required
    the collection ID
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
  • product_ids array
    A list of product IDs, arranged at the top of the collection in the order of the passed IDs. This is only effective when sort_order=manual and the number does not exceed 5000. If an empty list is passed, all previous sorting will be cleared.
    Example: 16064649853088531841170520
  • sort_order string
    Specify the sorting order of products within a smart collection.
    parameterdescription
    updated-ascSorted by update date in ascending order (oldest to newest).
    updated-descSorted by update date in descending order (newest to oldest).
    created-ascSorted by creation date in ascending order (oldest to newest).
    created-descSorted by creation date in descending order (newest to oldest).
    price-ascSort by variant lowest selling price in ascending order (lowest - highest).
    price-descSort by variant's lowest selling price in descending order (highest - lowest).
    best-sellingSorted by best-selling products.
    add-to-cart-descSort by the amount of purchases in the past 90 days in descending order.
    conversion-rate-descSorted by conversion rate in descending order.
    view-descSort by page views in the last 90 days in descending order.
    alpha-ascSort by product title in ascending alphabetical order (A - Z).
    alpha-descSort by product title in descending alphabetical order (Z - A).
    manualSorted by the order manually set by the merchant.
    Example: created-asc
Response
For more information about status codes, see Http status code.

Response Headers
  • traceId
    traceId
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20250601

ParamOptions

path required
header required

Body

required
{
  "product_ids": [
    "16064649853088531841170520"
  ],
  "sort_order": "created-asc"
}

Language

curl --request PUT \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20250601/products/smart_collections/collection_id/order.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json' \
--data '
{
"product_ids": [
"16064649853088531841170520"
],
"sort_order": "created-asc"
}
'
Examples
Modify the order of products in a category
Request
{
"product_ids": [
"16064649853088531841170520"
],
"sort_order": "created-asc"
}
Response
{}
Was this article helpful to you?