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.
Certifications represent third-party validations and standards that apply to your materials and products. Track certification details, issuing institutes, validity periods, and attach certification documents.
List certifications
Retrieve all certifications for your brand with usage metrics.
const result = await trpc . catalog . certifications . list . query ();
Response
Returns an array of certifications with material usage counts:
Array of certification objects Certification title (e.g., “GOTS”, “OEKO-TEX Standard 100”, “Fair Trade”)
Certification number or code (e.g., “GOTS-2024-001”)
Name of the certifying institute (e.g., “Control Union”, “OEKO-TEX”)
Contact email for the institute
Institute address line 1 (max 500 characters)
Institute address line 2 (max 500 characters)
Institute city (max 100 characters)
Institute state/province (max 100 characters)
Institute postal/ZIP code (max 100 characters)
ISO 3166-1 alpha-2 country code (e.g., “US”, “GB”, “DE”)
ISO 8601 datetime when certification was issued
ISO 8601 datetime when certification expires
File path or URL to the certification document (max 500 characters)
Number of materials linked to this certification
The materials_count metric shows how many materials reference this certification.
Create certification
Create a new certification entry.
const result = await trpc . catalog . certifications . create . mutate ({
title: "GOTS (Global Organic Textile Standard)" ,
certification_code: "GOTS-2024-001" ,
institute_name: "Control Union" ,
institute_email: "info@controlunion.com" ,
institute_website: "https://www.controlunion.com" ,
institute_country_code: "NL" ,
issue_date: "2024-01-15T00:00:00Z" ,
expiry_date: "2025-01-15T00:00:00Z" ,
certification_path: "https://storage.example.com/certs/gots-2024.pdf"
});
Request
Certification title (1-100 characters) Examples: “GOTS”, “OEKO-TEX Standard 100”, “Fair Trade Certified”, “Bluesign”
Certification number or reference code (1-100 characters) Examples: “GOTS-2024-001”, “CU-875432”, “FT-2024-12345”
Name of the certifying organization (1-100 characters) Examples: “Control Union”, “OEKO-TEX Association”, “Fair Trade USA”
Contact email for the institute Must be a valid email address format.
Institute website URL Must be a valid URL format (e.g., https://example.com).
First line of institute address (1-500 characters)
Second line of institute address (1-500 characters)
Institute city (1-100 characters)
Institute state or province (1-100 characters)
Postal or ZIP code (1-100 characters)
ISO 3166-1 alpha-2 country code (2 uppercase letters) Examples: "US", "GB", "DE", "NL", "CH"
ISO 8601 datetime when certification was issued Example: "2024-01-15T00:00:00Z"
ISO 8601 datetime when certification expires Example: "2025-01-15T00:00:00Z"
File path or URL to the certification document (1-500 characters) Can be a file storage URL or internal path reference.
Response
ID of the created certification
Validation rules
title is required and must be 1-100 characters
All optional string fields have max lengths (see parameter descriptions)
institute_email must be a valid email format
institute_website must be a valid URL format
institute_country_code is automatically converted to uppercase and must be exactly 2 characters
issue_date and expiry_date must be valid ISO 8601 datetime strings
Error handling
Invalid Email
Invalid URL
Invalid Date
{
"code" : "BAD_REQUEST" ,
"message" : "Invalid email format"
}
Update certification
Update an existing certification.
const result = await trpc . catalog . certifications . update . mutate ({
id: "550e8400-e29b-41d4-a716-446655440000" ,
expiry_date: "2026-01-15T00:00:00Z" ,
certification_path: "https://storage.example.com/certs/gots-2024-updated.pdf"
});
Request
New certification title (1-100 characters)
Update or clear certification code
Update or clear institute name
Update or clear institute email
Update or clear institute website
Update or clear address line 1
Update or clear address line 2
Update or clear country code
Update or clear issue date
Update or clear expiry date
Update or clear certification document path
Response
ID of the updated certification
Only provided fields are updated. Omitted fields remain unchanged. To explicitly clear a nullable field, pass null.
Error handling
{
"code" : "NOT_FOUND" ,
"message" : "certification with ID '...' not found"
}
Delete certification
Delete a certification from your catalog.
const result = await trpc . catalog . certifications . delete . mutate ({
id: "550e8400-e29b-41d4-a716-446655440000"
});
Request
Response
ID of the deleted certification
Deleting a certification does not check for material references. Materials referencing this certification will have their certification_id set to null via cascade.
Error handling
{
"code" : "NOT_FOUND" ,
"message" : "certification with ID '...' not found"
}
TypeScript types
All procedures are fully typed when using the tRPC client:
import type { AppRouter } from "@v1/api" ;
import { createTRPCClient } from "@trpc/client" ;
const trpc = createTRPCClient < AppRouter >({
// ... config
});
// Fully typed request and response
const result = await trpc . catalog . certifications . create . mutate ({
title: "GOTS" ,
certification_code: "GOTS-2024-001" ,
issue_date: "2024-01-15T00:00:00Z" ,
expiry_date: "2025-01-15T00:00:00Z"
});
// result.data.id is typed as string
// Type inference for list results
const list = await trpc . catalog . certifications . list . query ();
// list.data is typed as Certification[]
for ( const cert of list . data ) {
console . log ( cert . title ); // typed as string
console . log ( cert . expiry_date ); // typed as string | null
console . log ( cert . materials_count ); // typed as number
}
Schema types
// Request schemas
type CreateCertificationSchema = {
title : string ; // 1-100 chars, required
certification_code ?: string ; // 1-100 chars
institute_name ?: string ; // 1-100 chars
institute_email ?: string ; // valid email
institute_website ?: string ; // valid URL
institute_address_line_1 ?: string ; // 1-500 chars
institute_address_line_2 ?: string ; // 1-500 chars
institute_city ?: string ; // 1-100 chars
institute_state ?: string ; // 1-100 chars
institute_zip ?: string ; // 1-100 chars
institute_country_code ?: string ; // 2-char uppercase
issue_date ?: string ; // ISO 8601 datetime
expiry_date ?: string ; // ISO 8601 datetime
certification_path ?: string ; // 1-500 chars
};
type UpdateCertificationSchema = {
id : string ; // UUID, required
title ?: string ;
certification_code ?: string | null ;
institute_name ?: string | null ;
institute_email ?: string | null ;
institute_website ?: string | null ;
institute_address_line_1 ?: string | null ;
institute_address_line_2 ?: string | null ;
institute_city ?: string | null ;
institute_state ?: string | null ;
institute_zip ?: string | null ;
institute_country_code ?: string | null ;
issue_date ?: string | null ;
expiry_date ?: string | null ;
certification_path ?: string | null ;
};
type DeleteCertificationSchema = {
id : string ; // UUID
};
// Response types
type Certification = {
id : string ;
title : string ;
certification_code : string | null ;
institute_name : string | null ;
institute_email : string | null ;
institute_website : string | null ;
institute_address_line_1 : string | null ;
institute_address_line_2 : string | null ;
institute_city : string | null ;
institute_state : string | null ;
institute_zip : string | null ;
institute_country_code : string | null ;
issue_date : string | null ; // ISO 8601
expiry_date : string | null ; // ISO 8601
certification_path : string | null ;
created_at : string ; // ISO 8601
updated_at : string ; // ISO 8601
};
type CertificationWithMetrics = Certification & {
materials_count : number ;
};
Common patterns
Creating a complete certification
const certification = await trpc . catalog . certifications . create . mutate ({
title: "GOTS (Global Organic Textile Standard)" ,
certification_code: "GOTS-2024-001" ,
institute_name: "Control Union" ,
institute_email: "info@controlunion.com" ,
institute_website: "https://www.controlunion.com" ,
institute_address_line_1: "P.O. Box 22074" ,
institute_city: "Amsterdam" ,
institute_zip: "1100 CB" ,
institute_country_code: "NL" ,
issue_date: "2024-01-15T00:00:00Z" ,
expiry_date: "2025-01-15T00:00:00Z" ,
certification_path: "https://storage.example.com/certs/gots-2024.pdf"
});
Checking expiry dates
const certs = await trpc . catalog . certifications . list . query ();
const now = new Date ();
const expiringWithin90Days = certs . data . filter ( cert => {
if ( ! cert . expiry_date ) return false ;
const expiry = new Date ( cert . expiry_date );
const daysUntilExpiry = ( expiry . getTime () - now . getTime ()) / ( 1000 * 60 * 60 * 24 );
return daysUntilExpiry > 0 && daysUntilExpiry <= 90 ;
});
console . log ( ` ${ expiringWithin90Days . length } certifications expiring soon` );
Finding unused certifications
const certs = await trpc . catalog . certifications . list . query ();
// Find certifications not linked to any materials
const unused = certs . data . filter ( cert => cert . materials_count === 0 );
// Safe to delete if no longer needed
for ( const cert of unused ) {
await trpc . catalog . certifications . delete . mutate ({ id: cert . id });
}
Updating expiry dates
// Extend certification validity
await trpc . catalog . certifications . update . mutate ({
id: certificationId ,
expiry_date: "2027-01-15T00:00:00Z"
});
Linking to materials
// Create certification first
const cert = await trpc . catalog . certifications . create . mutate ({
title: "OEKO-TEX Standard 100" ,
certification_code: "21.HUS.68339" ,
issue_date: "2024-01-01T00:00:00Z" ,
expiry_date: "2025-01-01T00:00:00Z"
});
// Link to material
await trpc . catalog . materials . create . mutate ({
name: "OEKO-TEX Certified Cotton" ,
certification_id: cert . data . id ,
recyclable: true
});