Create Collection

Allows users to create a new collection in the store, including details like the title, description, associated products, SEO attributes, and merchandise sorting rules.

🔒

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:

  1. Create a collection to group related products for better categorization.
  2. Apply specific sorting rules to arrange products in the collection.

Request Parameters

Public Request Parameters

📘

Body Parameters

ParameterTypeRequiredDescriptionExample
collectionobjectYesThe collection configuration object{...}
collection.titlestringYesThe name of the collectionSummer Sale 2023
collection.handlestringNoA unique URL-friendly identifier for the collectionsummer-sale-2023
collection.descriptionstringNoThe description of the collectionDiscounted summer products
collection.imageobjectNoImage details for the collection{...}
collection.seo_titlestringNoThe SEO title for the collectionSummer Sale Collection
collection.seo_keywordsarray of stringsNoThe keywords for SEO["summer", "sale", "2023"]
collection.seo_descriptionstringNoThe SEO description for the collectionDiscounted summer products collection
collection.sort_orderstringNoMerchandise sorting rules. Options include: manual (default), sales-desc, price-asc, price-desc, views-desc, vendor-asc, vendor-desc, created-desc, and moreprice-asc
collection.product_idsarray of stringsNoList of product IDs to include in the collection. Must be valid UUIDs["prod_123", "prod_456"]

Image Object Structure

ParameterTypeRequiredDescriptionExample
srcstringYesThe source URL of the collection imagehttps://example.com/summer.jpg
widthint32NoThe width of the collection image in pixels800
heightint32NoThe height of the collection image in pixels600
altstringNoAlt text for the collection imageSummer collection image

Response Explanation

Public Response Parameters

📘

Successful Response

ParameterTypeExampleDescription
codestring200Error code (200 indicates success)
messagestringSuccessError message
dataobject{...}Contains the collects data
data.collectioncollection object {...}collection object

Collection Object Structure

ParameterTypeExampleDescription
idstringcoll_123456Unique identifier of the collection
titlestringSummer CollectionName of the collection
descriptionstringOur best summer productsDescription of the collection
handlestringsummer-collectionURL-friendly identifier
smartbooleanfalseWhether this is a smart collection (dynamically filtered)
imageobject{...}Image details for the collection
seo_titlestringSummer Collection 2023SEO-optimized title
seo_keywordsarray of strings["summer", "2023", "sale"]SEO keywords for the collection
seo_descriptionstringDiscount on summer productsSEO description
sort_orderstringmanualHow products are sorted in this collection
created_atstring2023-06-20T15:30:00ZTimestamp when the collection was created
updated_atstring2023-06-21T09:15:00ZTimestamp when the collection was last updated

Image Object Structure

ParameterTypeExampleDescription
srcstringhttps://example.com/image.jpgURL of the collection image
widthint32800Image width in pixels
heightint32600Image height in pixels
altstringSummer productsAlternative text for the image

Error Response

FieldTypeExampleDescription
codestringInvalidParameterError http message
messagestring``Error message

API Structure Overview

Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!