Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Avelero/avelero/llms.txt

Use this file to discover all available pages before exploring further.

Collections are saved product filter configurations that allow users to quickly access and reuse common filter combinations.

List collections

Retrieve all collections for the active brand.
const { data } = await trpc.brand.collections.list.query();

Response

data
array
Array of collection objects

Create collection

Create a new saved filter collection for the active brand.
const { data } = await trpc.brand.collections.create.mutate({
  name: "Summer Collection 2024",
  description: "Products for summer season launch",
  filter: {
    season: ["summer"],
    year: 2024,
    category: ["apparel"]
  }
});

Input parameters

name
string
required
Collection nameValidation: 1-100 characters
description
string
Optional collection descriptionValidation: 1-500 characters
filter
object
required
FilterState structure representing the filter configurationThis is stored as JSONB and can contain any valid filter parameters. Common filter properties include:
  • Product attributes (category, season, color, size)
  • Custom fields
  • Date ranges
  • Status flags

Response

data
object
The created collection object with all fields including generated id, created_at, and updated_at

Errors

  • 500 Internal Server Error: Failed to create collection

Update collection

Update an existing collection. All fields except id are optional.
const { data } = await trpc.brand.collections.update.mutate({
  id: "collection-uuid",
  name: "Updated Collection Name",
  filter: {
    season: ["summer", "spring"],
    year: 2024
  }
});

Input parameters

id
string
required
UUID of the collection to update
name
string
Updated collection nameValidation: 1-100 characters
description
string | null
Updated collection description (set to null to clear)Validation: 1-500 characters
filter
object
Updated FilterState structureThis replaces the entire filter configuration—partial updates are not supported

Response

data
object
The updated collection object with all fields

Errors

  • 404 Not Found: Collection not found
  • 500 Internal Server Error: Failed to update collection

Delete collection

Delete a collection permanently.
const { data } = await trpc.brand.collections.delete.mutate({
  id: "collection-uuid"
});

Input parameters

id
string
required
UUID of the collection to delete

Response

data
object
The deleted collection object

Errors

  • 404 Not Found: Collection not found
  • 500 Internal Server Error: Failed to delete collection

Filter structure

The filter field in collections stores a FilterState object as JSONB. This flexible structure allows you to save any combination of product filters.

Common filter properties

{
  // Product categorization
  category: ["apparel", "accessories"],
  subcategory: ["tops", "bottoms"],
  
  // Product attributes
  season: ["summer", "spring"],
  year: 2024,
  color: ["blue", "green"],
  size: ["S", "M", "L"],
  
  // Status and flags
  published: true,
  archived: false,
  
  // Custom fields
  custom_field_1: "value",
  custom_field_2: ["option1", "option2"]
}
The filter structure is flexible and validated client-side. You can include any fields that match your product schema and filtering requirements.

Build docs developers (and LLMs) love