Disposable Discounter
DiDi public platform

Public API and widget contracts

Installation-aware widgets, public APIs and embeddable product experiences for the isolated Disposable Discounter platform.

Principles
  • 1. Widgets bootstrap with a publishable key and a short-lived bootstrap token.
  • 2. Search widget stays isolated through Shadow DOM; chatbot stays isolated through iframe.
  • 3. `v1` stays stable for widgets, `v2` preserves the legacy DiDi migration shape, and `v3` is the canonical API for new clients.
  • 4. The public runtime reads installation presentation and enabled capabilities from the isolated `didi` database.
  • 5. Host interactions remain explicit bridge actions instead of arbitrary script execution.
Endpoints
POST/v1/bootstrap/search
Payload: publishableKey, locale
Returns bootstrap token and presentation config.
POST/v1/search/products
Payload: bootstrapToken, query, filters, paging
Current widget/runtime search contract used by embeds and public demos.
POST/v2/search/didi
Payload: query, assistant?, publishableKey?, bootstrapToken?, mode?, fields?
Legacy DiDi-compatible response shape for migration-safe API consumers. Supports the old `x-app-key` and `x-secret-key` header pair when configured.
POST/v3/search/products
Payload: bootstrapToken, query, filters, paging
Canonical versioned search contract for new direct integrations.
POST/v1/bootstrap/chatbot
Payload: publishableKey, locale
Bootstraps iframe widget and validates origin.
POST/v1/chatbot/session
Payload: bootstrapToken, locale, sessionId?
Creates or resumes a public chatbot session.
POST/v1/chatbot/message
Payload: bootstrapToken, sessionId, message
Stores the conversation and returns a reply plus optional bridge actions.