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.

Update brand settings

Only brand owners can update brand settings.
const result = await trpc.brand.update.mutate({
  id: "brand-uuid",
  name: "Acme Clothing",
  slug: "acme-clothing",
  email: "contact@acme.com",
  country_code: "US",
  logo_url: "/api/storage/brand-avatars/logo.png"
});

Input parameters

id
string
required
UUID of the brand to update
name
string
Brand display nameValidation: 1-100 characters
slug
string
URL-friendly brand identifier used in Digital Product Passport URLsValidation:
  • 2-50 characters
  • Only lowercase letters, numbers, and dashes
  • No leading or trailing dashes
  • Must be unique across all brands
Example: acme-clothing, sustainable-brand-123
email
string
Brand contact email addressValidation: Valid email format
country_code
string
ISO 3166-1 alpha-2 country codeValidation: 2-letter uppercase codeExample: US, GB, DE, FR
logo_url
string
Brand logo image URL or storage pathNote: When providing a logo URL, the system extracts the storage path from known prefixes like /api/storage/brand-avatars/

Response

success
boolean
Returns true if the update was successful
slug
string | null
The brand’s current slug after update

Behavior

  • Slug validation: If updating the slug, the system checks for uniqueness before applying the change
  • Cache revalidation: When the slug changes, both the old and new slug paths are revalidated to update cached Digital Product Passport pages
  • Active brand check: The active brand in context must match the brand being updated

Errors

  • 400 Bad Request: Slug is already taken by another brand
  • 400 Bad Request: Active brand does not match the brand being updated
  • 403 Forbidden: User is not a brand owner

Delete brand

Deleting a brand is a soft-delete operation that triggers background cleanup. Only brand owners can delete brands.
const result = await trpc.brand.delete.mutate({
  brand_id: "brand-uuid"
});

Input parameters

brand_id
string
required
UUID of the brand to delete

Behavior

The deletion process happens in two stages:
  1. Immediate soft-delete:
    • Sets deleted_at timestamp on the brand record
    • Updates affected users’ active brand if needed
    • Returns immediately
  2. Background cleanup (triggered asynchronously):
    • Deletes products in batches
    • Cleans up storage files (avatars, product images)
    • Hard-deletes the brand record
If the background job fails to trigger, the brand is still soft-deleted and the cleanup job can be manually re-triggered.

Errors

  • 400 Bad Request: Brand ID is required
  • 403 Forbidden: User is not a brand owner

Check slug availability

Validate if a slug is available for use, typically during real-time validation while editing.
const { available } = await trpc.brand.checkSlug.query({
  slug: "my-new-brand"
});

Input parameters

slug
string
required
Slug to check for availabilityValidation: Minimum 1 character

Response

available
boolean
Returns true if the slug is available, false if already taken by another brandNote: Excludes the current brand from the availability check (you can keep your own slug)

Build docs developers (and LLMs) love