Track sale events
Endpoint
POST /track/sale
Track a sale conversion event for a short link. This endpoint creates a sale event and upserts a customer record.
Every accepted POST creates a new sale, including a retry. This includes caller retries. Retrying the same request reuses the active customer but intentionally records another sale. No Idempotency-Key header is accepted, promised, or required. Retry only when another sale conversion is intended.
POST /track/saleAuthentication
Requires authentication with an API key that has the conversionsWrite scope.
Request Body
Accepts a single object (not an array). All fields are required unless marked optional.
Capture clickId in the browser
If you want to attribute a sale directly to a click, use the Browser attribution script to persist `hoko_id` and pass it as clickId. See [Browser attribution script](https://docs.hoko.to/track/analytics-js).
Attribution Priority
The sale is attributed in this order: leadEventName (if provided) → clickId (if provided) → most recent lead for the customer. If no lead exists and no clickId is provided, the request fails.