Update Product Sorting in Smart Collections
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 requiredthe collection ID
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
- product_ids arrayA 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 stringSpecify the sorting order of products within a smart collection.
parameter description updated-asc Sorted by update date in ascending order (oldest to newest). updated-desc Sorted by update date in descending order (newest to oldest). created-asc Sorted by creation date in ascending order (oldest to newest). created-desc Sorted by creation date in descending order (newest to oldest). price-asc Sort by variant lowest selling price in ascending order (lowest - highest). price-desc Sort by variant's lowest selling price in descending order (highest - lowest). best-selling Sorted by best-selling products. add-to-cart-desc Sort by the amount of purchases in the past 90 days in descending order. conversion-rate-desc Sorted by conversion rate in descending order. view-desc Sort by page views in the last 90 days in descending order. alpha-asc Sort by product title in ascending alphabetical order (A - Z). alpha-desc Sort by product title in descending alphabetical order (Z - A). manual Sorted by the order manually set by the merchant. Example:created-asc
Response
- 200
- 401
- 429
API Explorer
Debugger
Examples
Was this article helpful to you?