Skip to content

Reorder a manual collection's products

PUT
/stores/{storeRef}/collections/{id}/products/reorder
curl --request PUT \
--url https://apibase.ecomweb.app/api/v1/stores/example/collections/1/products/reorder \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "product_ids": [ 1 ] }'

Takes the complete ordered list of the collection’s product IDs and saves it as the display order. The list must contain exactly the products already in the collection, with no duplicates, or the request is rejected with a 400 error.

Required scopes: write:categories

id
required
integer

The collection ID.

storeRef
required
string

The store’s ref, as returned by GET /stores.

Media typeapplication/json
object
product_ids
required

The complete ordered list of product IDs. Must match the collection’s current membership exactly.

Array<number>

Example generated

{
"product_ids": [
1
]
}
Media typeapplication/json
object
reordered
required

Number of products in the new order.

number

Example generated

{
"reordered": 1
}

The request is malformed or failed validation.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The resource does not exist in this store.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}