All analytics endpoints are public — no authentication is required. Events are accepted asynchronously and processed in the background. The API returns
202 Accepted or 201 Created to avoid blocking the caller.POST /api/v1/analytics/track
Track a generic analytics event for a specific tenant and interaction type. Middleware:throttle:apiAuthentication: Not required
Request body
UUID or string ID of the tenant to associate the event with.
Interaction type. Must be one of the
InteractionType enum values: whatsapp_click, call, location_view, cart_add, social_share, conversion, purchase.Optional. If provided, must exist in the
products table. The product ID is also merged into metadata.Arbitrary key-value metadata to attach to the event.
Response 202 Accepted
trueEvent accepted for processingResponse 404 Not Found
Returned when the tenant_id does not correspond to a public (active) tenant.
falseTenant not found or not availableError responses
| Status | Cause |
|---|---|
404 | Tenant not found or not public |
422 | tenant_id or type missing, invalid interaction type |
POST /api/v1/analytics/conversion
Record a purchase/conversion beacon event. Designed to be called from a client-side beacon (e.g. after a payment confirmation). Failures are swallowed silently to avoid disrupting the user flow. Middleware:throttle:apiAuthentication: Not required
Request body
URL slug of the tenant. Used to resolve the tenant without exposing internal IDs.
Unique transaction identifier from the payment system.
Order/transaction value. Defaults to
0.0.ISO 4217 currency code. Defaults to
HNL.Event type. Defaults to the
purchase interaction type.ISO 8601 timestamp of the original event. Defaults to server time when omitted.
Response 200 OK
ok on success, skipped when tenant not found or slug missing.Echoed back from the request.
POST /api/v1/interactions
Record a low-level interaction event (view, WhatsApp click, call, maps click). This endpoint uses thetenant-aware throttle group rather than the general api group.
Middleware: throttle:tenant-awareAuthentication: Not required
Request body
Numeric tenant ID.
Event type. Allowed values:
view, whatsapp_click, call_click, maps_click.Optional product ID associated with the interaction.
Arbitrary metadata object.
Response 201 Created / 202 Accepted
201 when the interaction is successfully recorded. 202 when the tenant does not exist (silent acceptance) or on processing errors.
success, accepted.Error responses
| Status | Cause |
|---|---|
422 | Missing tenant_id or type, or type not in the allowed list |