Requires write_collection access scope. More access scope
The Create Collection API allows users to create a new collection in the store, including details like the title, description, associated products, SEO attributes, and merchandise sorting rules. This endpoint provides flexibility for managing collections and organizing products effectively.This API is especially useful for:
Create a collection to group related products for better categorization.
Apply specific sorting rules to arrange products in the collection.
Object containing details of the collection image.
image.src
string
//cdn.shoplazza.com/loading.png
Source URL of the collection image.
image.width
integer
100
Width of the collection image in pixels.
image.height
integer
100
Height of the collection image in pixels.
image.alt
string
""
Alt text for the collection image.
image.path
string
loading.png
File path of the collection image.
seo_title
string
seo_title
SEO title of the collection.
seo_description
string
Desc
SEO description of the collection.
seo_keywords
string
test
SEO keywords associated with the collection.
sort_order
string
title-asc
Merchandise sorting rules. Options include: manual (default), sales-desc, price-asc, price-desc, views-desc, vendor-asc, vendor-desc, created-desc, and more. (see Sort Order Options).
created_at
string
2024-04-16T10:31:12Z
Timestamp when the collection was created.
updated_at
string
2024-04-16T10:31:12Z
Timestamp when the collection was last updated.
Error Response
Error responses in the API can be represented using two different fields: errors and error. Both fields provide details about issues encountered during request processing. Below is an explanation of the fields with their respective examples and descriptions.
Field
Type
Example
Description
errors
Array
[ "Title is taken."]
A list of errors encountered during the request processing.
Field
Type
Example
Description
error
Array
"store is not active"
Indicates an error encountered during the process.
Error Details
Status Code
Message
Possible Reason
Example Response
400
Bad Request
Invalid input format or request structure (e.g., missing required fields or incorrect data types).
Bad Request
Unauthorized
The request is missing valid authentication credentials or the credentials provided are invalid.
Unauthorized
422
Invalid or empty product_id, or product_id is not found
Missing required product_id, or incorrect UUID types.
{ "errors": [ "productIds has an invalid UUID"]}
Title is taken
title is already existed
{ "errors": ["Title is taken."] }
Unprocessable Entity
Missing required field input, or invalid field input
{ "errors": ["Title is required."] }
404
Record Not Found
The collection could not be created due to missing or invalid data, or the specified products do not exist.
{ "errors": ["Record is required."] }
API Structure Overview
Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!