Events
Create Event
Send a normalized server-side event for a conversion, lead, trial, or milestone
POST
Use this endpoint when your backend wants one event ingestion surface for both
revenue and non-revenue events. Conversion events return a conversion object.
Lead, trial, and milestone events return an event-processing result.
For a guide on when to choose
/events versus /conversions, and for common
backend tracking flows, see
Server-Side Tracking.Body Parameters
string
required
Human-readable event name from your system, such as
trial_started,
invoice_paid, or activation_completed.string
default:"milestone"
Event type. Valid values:
conversion, lead, trial, milestone.string
Affonso referral ID to credit directly. Optional if you provide
customer_id or external_user_id.string
The customer ID from your payment provider or billing system, such as a
Stripe customer ID. Optional if you provide
referral_id or
external_user_id.string
The user ID from your own product, app, or internal system. Optional if you
provide
referral_id or customer_id.string
Compatibility alias for
referral_id.string
Optional ISO 8601 timestamp describing when the event happened upstream.
string
Optional idempotency key for non-conversion events. Required for conversion
events. Use a stable upstream event identifier.
number
Sale amount for conversion events. Required when
event_type is
conversion.string
Three-letter currency code for the sale amount, such as
USD or EUR.
Required when event_type is conversion.string[]
Optional product identifiers to improve incentive matching on conversion
events.
string[]
Optional price identifiers to improve incentive matching on conversion
events.
string
Subscription interval for conversion events. Valid values:
monthly,
yearly.boolean
Whether the conversion comes from a subscription purchase.
object
Optional metadata stored with the resulting event log and, when applicable,
the affiliate earning.
Validation Rules
- At least one of
referral_id,customer_id, orexternal_user_idis required. affonso_idis also accepted instead ofreferral_idfor compatibility.- Older field-name variants continue to work for compatibility, but new integrations should standardize on
referral_id. - If you send more than one identifier, Affonso checks
external_user_idfirst, thenreferral_id, thencustomer_id. - Conversion events require
sale_amount,sale_amount_currency, andexternal_event_id. - Reusing the same
external_event_idreturns the prior processed result instead of creating a duplicate.
Response
Conversion Response
Whenevent_type is conversion, the response matches
POST /conversions.
boolean
Always
true for successful responses.object
The conversion object, including
matched_incentive_id,
commission_amount, sales_status, commission_created, and
activity_outcome. See Create Conversion
for the complete response schema.Milestone Response
Whenevent_type is lead, trial, or milestone, the response describes
what Affonso did with the event.
boolean
Always
true for successful responses.object
Event processing result.
Example Request: Conversion Event
Example Request: Lead Event
Example Request: Trial Event
Example Request: Milestone Event
Example Response: Milestone Event
If request signing is enabled for your environment, include
X-Affonso-Timestamp and X-Affonso-Signature headers as described in
Server-Side Tracking.