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.
Body Parameters
Human-readable event name from your system, such as
trial_started,
invoice_paid, or activation_completed.Event type. Valid values:
conversion, lead, trial, milestone.Referral ID to credit directly. Optional if you provide
customer_id,
external_user_id, or click_id.Your internal customer identifier. Optional if you provide
referral_id,
external_user_id, or click_id.Your external application user ID. Optional if you provide
referral_id,
customer_id, or click_id.Click ID returned by
POST /clicks. Optional if you provide referral_id,
customer_id, or external_user_id.Optional ISO 8601 timestamp describing when the event happened upstream.
Optional idempotency key for non-conversion events. Required for conversion
events. Use a stable upstream event identifier.
Sale amount for conversion events. Required when
event_type is
conversion.Three-letter currency code for the sale amount, such as
USD or EUR.
Required when event_type is conversion.Optional product identifiers to improve incentive matching on conversion
events.
Optional price identifiers to improve incentive matching on conversion
events.
Subscription interval for conversion events. Valid values:
monthly,
yearly.Whether the conversion comes from a subscription purchase.
Optional metadata stored with the resulting event log and, when applicable,
the affiliate earning.
Validation Rules
- At least one of
referral_id,customer_id,external_user_id, orclick_idis required. - 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.
Always
true for successful responses.The conversion object, including
matched_incentive_id,
commission_amount, and sales_status.Milestone Response
Whenevent_type is lead, trial, or milestone, the response describes
what Affonso did with the event.
Always
true for successful responses.Event processing result.
Example Request: Conversion Event
Example Request: Trial 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 Conversions.