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.

The DPP configuration API provides tRPC procedures for managing passport publishing, cache revalidation, and preview functionality.

Publishing passports

Publish a single passport

trpc.dpp.publish.mutate({
  variant_id: "uuid-here"
})
variant_id
string
required
UUID of the variant to publish as a DPP
Response:
upid
string
The 16-character unique passport identifier for the published DPP
version
number
Version number of the published snapshot (increments with each publish)
published_at
string
ISO 8601 timestamp of publication
Behavior:
  • Creates an immutable snapshot of the variant’s current data
  • Generates a UPID if this is the first publication
  • Increments version number if updating an existing passport
  • Revalidates the cache for the passport URL

Bulk publish passports

trpc.dpp.publishBulk.mutate({
  variant_ids: ["uuid-1", "uuid-2", "uuid-3"]
})
variant_ids
string[]
required
Array of variant UUIDs to publish
Response:
published
number
Count of successfully published passports
failed
number
Count of variants that failed to publish
passports
array
Array of published passport details (upid, version, published_at)

Cache revalidation

Revalidate DPP cache

After publishing, the cache is automatically revalidated. For manual revalidation:
POST /api/revalidate
Authorization: Bearer {REVALIDATION_SECRET}

{
  "upid": "A1b2C3d4E5f6G7h8"
}
upid
string
required
UPID of the passport to revalidate
Authorization
string
required
Bearer token with the revalidation secret (configured via REVALIDATION_SECRET env var)
The revalidation endpoint is protected by a secret token. Never expose this token in client-side code. It should only be called from server-side contexts (tRPC API, background jobs).
Response:
{
  "revalidated": true,
  "upid": "A1b2C3d4E5f6G7h8",
  "timestamp": "2024-03-02T10:30:00Z"
}

Preview functionality

Preview unpublished changes

Preview a passport before publishing:
trpc.dpp.preview.query({
  variant_id: "uuid-here"
})
variant_id
string
required
UUID of the variant to preview
Response: Returns the complete DPP data structure as it would appear when published:
dppData
object
themeConfig
object
Brand theme configuration (menus, CTA, social links, section visibility)
themeStyles
object
Brand theme styles (colors, typography, component classes)
Preview queries are not cached and always reflect the current state of the variant. Use this for testing changes before publishing.

Unpublishing passports

To unpublish a passport, delete the variant. The passport will remain accessible but marked as inactive.
trpc.variants.delete.mutate({
  id: "uuid-here"
})
Deleted variants maintain their published snapshots for immutability. The passport page displays an “inactive” indicator but remains viewable to preserve historical data.

Passport versioning

Each time you publish changes to a variant:
  1. First publication: Creates passport record with version: 1 and generates UPID
  2. Subsequent publications: Increments version number, creates new snapshot
  3. Version history: All snapshots are retained in the database (immutable audit trail)
Version data:
  • Current version number
  • Publication timestamp
  • Snapshot of all product/variant data at time of publication
  • Theme configuration at time of publication
Immutable snapshots ensure that published passports never change unexpectedly. This is critical for:
  • Regulatory compliance: EU ESPR requires published data to remain accessible
  • Consumer trust: QR codes on physical products must point to stable data
  • Audit trails: Historical versions provide proof of what was published when
  • Cache efficiency: Immutable content can be cached indefinitely

Implementation reference

The DPP configuration API is implemented in:
  • /apps/api/src/trpc/routers/dpp/publish.ts - Publishing procedures
  • /apps/api/src/trpc/routers/dpp/preview.ts - Preview functionality
  • /apps/dpp/src/app/api/revalidate/route.ts - Cache revalidation endpoint
  • /packages/db/src/queries/dpp/ - Database queries for snapshots

Common workflows

Publishing workflow

1

Create or update product data

Use the products API to create/update product and variant data
2

Preview changes

Call trpc.dpp.preview.query() to verify data looks correct
3

Publish passport

Call trpc.dpp.publish.mutate() to create immutable snapshot
4

Cache revalidates automatically

The API automatically calls the revalidation endpoint
5

QR code points to UPID

Generate QR code pointing to https://passport.avelero.com/{upid}

Updating published passport

1

Modify variant data

Update materials, journey, environmental data, etc. via API
2

Re-publish

Call trpc.dpp.publish.mutate() again with same variant_id
3

Version increments

New snapshot created with incremented version number
4

UPID stays the same

The UPID does not change - QR codes continue to work
5

Cache revalidates

Consumers immediately see updated data

Public access

Learn about public DPP endpoints

Products API

Manage product data

Build docs developers (and LLMs) love