Collection List

🔒

Requires read_collection access scope. More access scope

The Get Collections API retrieves a list of collections based on various filter criteria, such as product_id, title, or update timestamps. It allows users to paginate results and specify query limits for efficient retrieval.This API is especially useful for:

1.Fetch all collections for specific product association.

2.Filter collections by title or update timestamps.

Note: The operation is scoped to a specific shop, identified by its unique domain prefix (shopdomain), ensuring all updates are applied to the correct store.

Public Request Parameters

Parameter NameTypeRequiredParameter LocationParameter ValueDescription
Access-TokenStringYesHeaderBx-_5aV
eXNwl-4AB98s5xLV
yg0fNzGf

MuTpqtlBA
Used to authenticate API requests. Obtain an access token from the Access Token Guide.
Pass it in the Authorization header for every request.
Content-TypeStringYesHeaderapplication
/json
Indicates the media type of the request body. It tells the server how to parse the request and
the client how to interpret the response. For more details, visit Content-Type.

Public Response Parameters

Parameter NameTypeMandatoryParameter LocationExample ValueDescription
errorStringNoResponse Body{ "error": "store is not active" }Indicates an error encountered during the process. This field typically appears when the Access Token is missing or invalid. Example: { "error": "store is not active" }.
errorsArrayNoResponse Body{ "errors"["No Context"] }A list of errors that occurred during the request processing. Example: { "errors": [ "No Context" ] }.
Request-IdStringYesHeaderBx-_5aV
eXNwl-4AB98s5xLV
yg0fNzGf

MuTpqtlBA
A unique identifier for each request. It helps in identifying and debugging specific requests.

Error and Errors Clarification:

Added explanation that the error and errors fields are currently dependent on the API implementation, with plans for future unification.

Request Parameters

Query Parameters

ParameterTypeRequiredDescription
idsstringNoComma-separated list of collection IDs to retrieve specific collections.
titlestringNoFilter collections by their title (supports partial matching).
updated_at_minstringNoMinimum timestamp for filtering collections by their last updated date. Format: YYYY-MM-DDTHH:mm:ssZ.
updated_at_maxstringNoMaximum timestamp for filtering collections by their last updated date. Format: YYYY-MM-DDTHH:mm:ssZ.
product_idstringNoUUID of a product to filter collections that include the product.
pageintegerNoPage number for pagination (default: 1).
limitintegerNoNumber of collections to retrieve per page (default: 10, max: 100).

Response Explanation

Successful Response

FieldTypeExampleDescription
collectionsArrayAn array of collection objects. Each collection contains details about a specific product collection.
collections.idString"a60fe556-43ad-4e07-9125-507ac1bf71f7"The unique identifier of the collection (UUID).
collections.titleString"Test-Collection"The title of the collection.
collections.descriptionString"Desc"A description of the collection.
collections.handleString"test-collection"The URL-friendly handle for the collection.
collections.smartBooleanfalseIndicates whether the collection is a smart collection (true) or a manual collection (false).
collections.imageObjectImage ObjectAn object containing details of the collection image.
collections.image.srcString"//cdn.shoplazza.com/cb.jpeg"The URL of the image.
collections.image.widthInteger1920The width of the image in pixels.
collections.image.heightInteger1080The height of the image in pixels.
collections.image.altString""The alternative text for the image.
collections.image.pathString"cb.jpeg"The file path of the image.
collections.seo_titleString"seo_title"The SEO title for the collection.
collections.seo_descriptionString"Desc"The SEO description for the collection.
collections.seo_keywordsString"test"Comma-separated keywords for SEO optimization.
collections.sort_orderString"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 order options ).
collections.created_atString"2024-04-16T10:31:13Z"The timestamp when the collection was created, in ISO 8601 format.
collections.updated_atString"2024-04-16T10:31:13Z"The timestamp when the collection was last updated, in ISO 8601 format.

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[ "UpdatedAtMin time format error"]A list of errors encountered during the request processing.
FieldTypeExampleDescription
errorArray "store is not active"Indicates an error encountered during the process.

Request Examples

curl --request GET \
     --url https://<shopdomain>.myshoplazza.com/openapi/2022-01/collections \
     --header 'accept: application/json' \
     --header 'access-token: <your-access-token>'

Success Response Example

{
  "collections": [
    {
      "id": "a60fe556-43ad-4e07-9125-507ac1bf71f7",
      "title": "Test-Collection",
      "description": "Desc",
      "handle": "test-collection",
      "smart": false,
      "image": {
        "src": "//cdn.shoplazza.com/9de53f9726576696b318a8d95c0946cb.jpeg",
        "width": 1920,
        "height": 1080,
        "alt": "",
        "path": "9de53f9726576696b318a8d95c0946cb.jpeg"
      },
      "seo_title": "seo_title",
      "seo_description": "Desc",
      "seo_keywords": "test",
      "sort_order": "title-asc",
      "created_at": "2024-04-16T10:31:13Z",
      "updated_at": "2024-04-16T10:31:13Z"
    }
  ]
}

Error Response Example

{
  "errors": [
      "UpdatedAtMin time format error"
  ]
}
{
  "error": "store is not active"
}

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
422update_at_min time format errorThe update_at_min field is not in a valid time format.(e.g., not ISO8601).{"errors": ["update_at_min time format error"]}
update_at_max time format errorThe update_at_max field is not in a valid time format.(e.g., not ISO8601).{"errors": ["update_at_min time format error"]}
500no contextMissing Context{"errors": ["No context"]}
Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!