Overview
Use this endpoint if Segment is already your event hub and you want Affonso to ingest affiliate-relevant events directly from Segment. Send Segmenttrack payloads to:
For a less technical setup guide, examples, and troubleshooting, see the
Segment Helpcenter guide.
What This Endpoint Supports
- Segment
trackevents - conversion events
- lead events
- trial events
- milestone events
- retry-safe ingestion with Segment
messageId
identify, group, page, and
screen return a validation error.
Mapping Rules
Affonso normalizes Segment payloads onto the same server-side event pipeline used byPOST /v1/events and POST /v1/conversions.
Identifier mapping
userIdmaps tocustomer_idexternal_user_idis only read when you send it explicitly in:properties.external_user_idproperties.externalUserIdcontext.traits.external_user_idcontext.traits.externalUserId
- Affonso does not guess between
customer_idandexternal_user_id
userId nor an explicit external_user_id is present, the request
fails.
Idempotency
messageIdmaps toexternal_event_id- Reusing the same
messageIdreturns the original processed result instead of creating a duplicate
Event type mapping
Order Completed,Completed Order,purchase→conversionqualified_lead,demo_booked→leadtrial_started→trial- everything else →
milestone
Revenue field mapping
For conversion events, Affonso looks for the sale amount in this order:properties.revenueproperties.amountproperties.valueproperties.total
properties.currencyproperties.sale_amount_currency
Example Request: Conversion
cURL
Example Request: Milestone
cURL
Response Behavior
- conversion events return the same conversion response shape as
POST /v1/conversions - lead, trial, and milestone events return the same processing result shape as
POST /v1/events - duplicate
messageIdvalues return the prior processed result
Common Errors
Only Segment track payloads are supportedSegment track events require either userId or an explicit external_user_id mapping- conversion validation errors when revenue or currency is missing
Related Docs
Segment Helpcenter Guide
Product-facing setup guide for Segment users
Server-Side Tracking
Overview of Affonso’s core backend conversion and event endpoints
Events API Reference
Canonical normalized event contract used by the Segment adapter
