Update Collection

🔒

Requires write_collection access scope. More access scope

The Update Collection API allows users to update details of an existing collection by providing the collection ID and the desired updates in the request body. This API supports updates to various attributes, including the title, description, SEO details, associated products, and more.This API is especially useful for:

  1. Modify collection details such as title, description, or handle.
  2. Update the associated image, SEO metadata, and sorting order for merchandise.

Request Parameters

Public Request Parameters

📘

Public Request Parameters

Path Parameters

ParameterTypeRequiredExampleDescription
idstringYesa60fe556-43ad-4e07-9125-507ac1bf71f7Unique identifier of the collection.

Body Parameters

Parameter Type Required Example Description
title string Yes Summer Collection The name of the collection.
handle string No summer-collection A unique URL-friendly identifier for the collection.
description string No A collection of summer products. The description of the collection.
image object No Image Object
image.src string No http://cdn.shoplazza.com/image.jpg The source URL of the collection image.
image.width int32 No 300 The width of the collection image in pixels.
image.height int32 No 300 The height of the collection image in pixels.
image.alt string No Summer Collection Image Alt text for the collection image.
seo_title string No Summer Collection The SEO title for the collection.
seo_description string No Explore our summer collection. The SEO description for the collection.
seo_keywords string No summer, collection, products Comma-separated keywords for SEO.
sort_order string No sales-desc Merchandise sorting rules. Options include: manual (default), sales-desc, price-asc, price-desc, views-desc, vendor-asc, vendor-desc, created-desc, and more.
product_ids string No 123e4567-e89b-12d3-a456-426614174000 Comma-separated list of product IDs to include in the collection. Must be valid UUIDs.

Response Explanation

Public Response Parameters

📘

Public Response Parameters

Success Response

Field Type Example Description
id string a60fe556-43ad-4e07-9125-507ac1bf71f7 Unique identifier of the collection.
title string Test-Collection Name of the collection.
description string Desc Description of the collection.
handle string test-collection URL-friendly handle for the collection.
smart boolean false Indicates whether the collection is smart.
image object Image Object 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.

FieldTypeExampleDescription
errorsArray[ "Collection not found"]A list of errors encountered during the request processing.
FieldTypeExampleDescription
errorArray "store is not active"Indicates an error encountered during the process.

Error Details

Status CodeMessagePossible ReasonExample Response
400Bad RequestInvalid input format or request structure (e.g., missing required fields or incorrect data types).Bad Request
UnauthorizedThe request is missing valid authentication credentials or the credentials provided are invalid.Unauthorized
404Collection Not FoundThe collection ID provided in the request does not exist.{ "errors": ["Collection not found"] }
422Invalid UUID- Invalid or empty collection_id.
- Invalid product_ids provided (non-UUID values).
{ "errors": [ "productId has an invalid UUID"]}
Invalid Date Formatupdated_at_min or updated_at_max has an incorrect date format.{ "errors": [ "updated_at_min has an invalid date format"]}

API Structure Overview

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