Skip to content
 

Webhook Protocol v1.0

AON sends conversion and four earning status events to the HTTPS endpoint configured for a Developer Application. Events arrive in batches: each request body is an envelope, {"delivery_id":"…","events":[…]}, holding 1 to 100 events. Verify every delivery before parsing JSON or applying a business side effect.

Canonical source and runtime evidence are different

The protected Protocol v1.0 postback specification and schema fixtures define the canonical contract. Publication does not prove that a particular runtime, OpenAPI document, SDK, or Portal follower has deployed and validated it. Treat each follower as unvalidated until its owner publishes evidence; production support requires separate runtime and release evidence.

The request body is now a batch envelope

A delivery used to carry one event object as the whole body. It now carries {"delivery_id":"…","events":[…]}. A receiver written for the old format must change; see Format change: batch envelope.

Required headers

Every Protocol v1.0 delivery uses POST, Content-Type: application/json, and exactly one value for each security/control header:

HeaderRequired value or responsibility
AON-Protocol-VersionExact value 1.0
X-AON-KeyOpaque callback key id selecting one current or grace secret
X-AON-TimestampCanonical unsigned Unix epoch seconds for this attempt
X-AON-SignatureLowercase-hex HMAC-SHA256 over the exact wire inputs

AON always delivers these Webhooks on Protocol v1.0 with AON-Protocol-Version: 1.0, whichever protocol version or placement type (including Offer Wall placements) your Offer Query requests used. The batch envelope did not change this value.

Reject a missing, empty, or duplicate header before HMAC verification or JSON parsing. Never choose the first or last value from duplicate security headers.

A test delivery that you trigger from the Developer Portal carries one more header, X-AON-Test: true; see Send a test event.

Delivery body

The body is a JSON object with two members: delivery_id, a string, and events, an array of event objects. delivery_id comes first. The value in the example is a placeholder; treat real values as opaque strings.

{
  "delivery_id": "dlv_3f2b8c1e9a7d4e56b0c1d2e3f4a5b6c7",
  "events": [
    {
      "event_id": "evt_01J0AONCONVERSION000001",
      "event_type": "conversion",
      "aon_click_id": "aci_0192f3a4b5c67d8e9f0a1b2c3d4e5f60",
      "offer_instance_id": "0192f3a5-6b7c-7d8e-9f01-23456789abcd",
      "offer_id": "ao_01HX2B3C4D5E6F7G8H9J0KABCD",
      "application_id": "app_demoApplication1",
      "placement_id": "plc_demoPlacement001",
      "event_name": "subscription",
      "amount": "96.000000",
      "currency": "USD",
      "sub_id": "homepage_widget",
      "sub_id_2": "cohort_a",
      "timestamp": "2026-03-21T03:10:00Z"
    },
    {
      "event_id": "evt_01J0AONCONVERSION000002",
      "event_type": "conversion",
      "aon_click_id": "aci_0192f3a4b5c67d8e9f0a1b2c3d4e5f71",
      "offer_id": "ao_01HX2B3C4D5E6F7G8H9J0KABCD",
      "application_id": "app_demoApplication1",
      "placement_id": "plc_demoPlacement001",
      "event_name": "purchase",
      "amount": "0.010000",
      "currency": "USD",
      "sub_id": "checkout_banner",
      "timestamp": "2026-03-21T03:10:04Z"
    }
  ]
}

On the wire the body is one compact line. The example is formatted for reading only.

  • delivery_id identifies one request. Every request gets a new value, and so does every retry. Treat it as an opaque string.
  • Use delivery_id for troubleshooting only. Log it on your side and give it to AON support when you report a problem with a delivery.
  • Never de-duplicate on delivery_id. A retry arrives with a new value, and the same event can show up in different requests. De-duplicate by (application_id, event_id).
  • 1 to 100 events per delivery. AON does not wait to fill a batch: a delivery often holds a single event. A body never exceeds 2 MiB and is usually far smaller.
  • Each event object is unchanged. Its fields, field order and values are exactly what used to be sent as the whole body.
  • One application, one callback URL. Events in a delivery belong to the same Developer Application and were queued for the same callback URL.
  • Conversions and earning events are never mixed. A delivery holds either conversion events or earning status events. Earning events of different types can share a delivery, so handle every element by its own event_type.
  • No order is guaranteed, inside a delivery or across deliveries.

Verify the raw body

For every attempt, AON signs this byte string:

POST\n{request-target}\n{exact-raw-body}\n{timestamp}

request-target is the exact origin-form path and raw query. Preserve repeated slashes, percent encoding, query order, and spelling. exact-raw-body is the byte sequence received on the wire — the whole envelope. There is one signature per delivery, not one per event. Verify the HMAC over those bytes before parsing or re-serializing JSON, compare the lowercase hexadecimal signature in constant time, then validate each element of events against the fields defined for the branch selected by its event_type; ignore any field you do not recognize (see Unknown fields).

X-AON-Timestamp is the attempt signing time. An event's timestamp is the business event time, normalized to UTC; the two fields are intentionally different.

Receive a delivery

  1. Verify the signature over the exact raw body, as above.
  2. Parse the body, log delivery_id and read events. Do not assume how many events it holds, their order, or that they share an event_type.
  3. For each event, de-duplicate by (application_id, event_id). Skip an event you have already processed.
  4. Process each new event by its event_type.
  5. Return one 2xx for the whole delivery within 30 seconds. Acknowledge first and do slow work afterwards.

There is no per-event response

A 2xx means you received every event in the delivery. Any other outcome fails all of them, and AON retries those events one at a time; see Five delivery attempts. AON ignores the response body.

Deliveries can arrive concurrently. Conversions and earning events for the same application are sent independently, so your endpoint can receive several requests at the same time. After a delivery of conversions is acknowledged, a larger delivery of earning events can follow right away, possibly while you are still working on the first one.

Payload fields

AON sends only the fields below for this revision of the conversion event. Fields marked optional are omitted when absent — they are never sent as null. Each conversion event object has this exact field order:

event_id, event_type, aon_click_id?, offer_instance_id?, offer_id,
application_id, placement_id?, event_name, amount, currency, sub_id?,
sub_id_2?, sub_id_3?, sub_id_4?, sub_id_5?, timestamp
FieldRequiredMeaning
event_idYesUnique id for this event
event_typeYesAlways conversion
aon_click_idNoOpaque AON click id (begins with aci_) this conversion is attributed to
offer_instance_idNoString. Id of the Offer delivery (Query/MCP result or offer wall) behind this conversion; see Using offer_instance_id
offer_idYesThe Offer that converted
application_idYesYour Developer Application id
placement_idNoThe placement the traffic came through
event_nameYesThe Offer goal that was met
amountYesYour expected net earning in USD after the platform fee, rounded up to the next cent (minimum "0.010000" when it is above zero), as a fixed six-decimal JSON string; "0.000000" when the conversion does not earn
currencyYesAlways USD
sub_id, sub_id_2 … sub_id_5NoYour attribution values from the original link
timestampYesConversion event time, UTC

amount is a JSON decimal string in USD with exactly six decimal places, never an integer number of cents. Your net share is rounded up to the next 0.01 USD, with a minimum of 0.01 whenever it is above zero. For example, a 0.001 USD commission with a 20% platform fee produces "amount": "0.010000"; "96.000000" means 96 dollars. Rounding happens after fee deduction and any currency conversion. Conversions settled before this change may still carry sub-cent amounts. Parse the string with a decimal library for calculations; do not convert it to a JavaScript Number or Python float.

amount is an expectation at delivery time. Risk freezes emit no event. Subscribe to earning status events for later changes, including reversals.

Earning status events

The existing Agent payload schema uses five oneOf branches, selected by event_type: conversion, earning_confirmed, earning_available, earning_paid_out, and earning_rejected. All five branches use the same six-decimal string format for amount. All events use the same endpoint, headers, raw-body HMAC, batch envelope, durable idempotency rule and five-attempt retry ladder.

EventMeaning
earning_confirmedThe conversion has been acknowledged automatically under its source's confirmation policy, individually through Provider action=confirm or Partner Portal, or together with its monthly statement. Confirmation does not mean the earning is available or paid.
earning_availableThe earning has become available for payout.
earning_paid_outAON has paid out this earning in full; this does not certify receipt in the developer's bank account. This state is terminal: AON does not register further earning status events for it.
earning_rejectedThe earning was rejected by the merchant, reversed, or marked refunded in a review.

Each earning event object has this exact field order. Optional fields are omitted, never null:

event_id, event_type, earning_id, sequence, conversion_event_id,
offer_instance_id?, offer_id, application_id, placement_id?, amount, currency,
reason?, sub_id?, sub_id_2?, sub_id_3?, sub_id_4?, sub_id_5?, timestamp
FieldMeaning
event_idearning: followed by the immutable outbox UUID; unchanged on retry.
event_typeOne of the four earning event names above.
earning_idLowercase hyphenated settlement UUID, identical to the Earnings API id.
sequencePositive JSON integer increasing within this earning; gaps are allowed.
conversion_event_idThe originating conversion's event id, even if its webhook was never delivered.
offer_instance_idOptional string. The offer_instance_id of the originating conversion — the same value as in that conversion event. Not unique; omitted when absent, never null.
offer_idThe Earnings API Offer identity; canonical resolution may differ from the conversion's Offer id. Join events using conversion_event_id.
application_idDeveloper Application id.
placement_idOptional placement identity.
amountNet earning in USD as a fixed six-decimal JSON string, including review adjustments; rejection carries the last observed live amount, or the original amount when none was observed.
currencyAlways USD.
reasonRequired only for earning_rejected; forbidden on the other earning branches.
sub_id, sub_id_2 … sub_id_5Optional. The originating conversion's attribution slots, rendered by the same rule as the conversion event (leading and trailing whitespace removed; omitted when empty, never null). Present on every earning branch, including earning_rejected, even when the conversion event was never delivered.
timestampBusiness time of this state, RFC3339 seconds in UTC (...Z); not a sorting key.

The reason closed set is merchant_cancelled, duplicate, invalid_order, fraud, returned, reversed, or refund; operator free text is never sent. Conversion-only fields (event_name, aon_click_id) are forbidden in earning bodies.

Use (application_id, event_id) for deduplication. Track the largest sequence per earning_id for the latest state; events can be duplicated or arrive out of order — including inside one delivery — and timestamps need not increase. Do not add the amounts of these snapshots together. Amounts can differ between events because of review adjustments or USD rounding (even by one cent); use the amount of the earning event with the largest sequence. If an adjustment and rejection occur between two observations, the rejection may carry the amount before the adjustment. Earning status events still reflect existing cent-based financial records: "5.000000" represents the recorded 5 USD amount. The six-decimal wire format does not increase ledger or payout precision. Only conversions settled before the round-up change can carry sub-cent amounts; later earning snapshots follow the financial records. In rare cases a rejection is withdrawn and the earning continues.

New conversions use automatic confirmation by default. When a valid conversion can be acknowledged and both events are subscribed, the normal delivery flow is conversion, followed promptly by earning_confirmed after AON records the first successful 2xx response to a delivery that held the conversion. The two events always arrive in separate deliveries. This is asynchronous; a fixed delivery interval is not guaranteed. If the conversion exhausts its five attempts or is skipped, the dependent confirmation is not sent. An application subscribed only to earning events does not need a conversion delivery first.

Sources configured for manual confirmation retain individual or monthly statement confirmation. The policy is fixed when the conversion is first recorded: changing a source's policy does not reclassify existing conversions. These ordering rules apply to automatic confirmations; continue handling duplicates and out-of-order earning snapshots as described above.

Each event has an independent subscription. The first earning subscription establishes a baseline at the configuration transaction's commit time: existing states are not replayed. Reopening subscriptions after all four were off also establishes a baseline; changes while all were off are not backfilled. While any earning event is enabled, all earning status changes are observed, but only currently subscribed events are registered. Opening another switch does not rebuild that baseline. Disabling a switch stops new event registration; already registered events continue delivery. Skipped registrations may consume sequence numbers. A risk freeze emits no earning event. Available may return to confirmed; unsubscribed intermediate states are not guaranteed to arrive.

Crediting users by sub_id

If you credit your own end users by sub_id, follow these rules:

  1. The amounts on events for the same earning are snapshots, not increments. Never add them together; use the amount of the event with the largest sequence for that earning_id.
  2. Deduplicate by (application_id, event_id).
  3. Key credits by earning_id and record the amount already credited to the user for that earning. On earning_rejected, reverse only the amount already credited. A rejection can arrive for an earning you never credited, or whose conversion event you never received; then reverse nothing.
  4. A rejection can be withdrawn: if a later event with a larger sequence returns the earning to a non-rejected state, credit it again.
  5. When the conversion carried no sub_id, the sub_id fields are absent from its earning events.
  6. The sub_id slots are only populated when you pass sub_id values on the click link (see Attribution with sub_id).

Using offer_instance_id

offer_instance_id identifies one delivery of an Offer — a Query or MCP result, or an offer wall. It is optional, always a string when present, and omitted — never null — when AON has no value. Treat it as an opaque string; do not assume a UUID format. When it is UUID-shaped it is a derived value, so do not rely on its UUID version bits or on time ordering either.

  • Same value as your Query. It equals the offer_instance_id returned in the Query or MCP response for that Offer, and the value of the aon_tracking_id link macro.
  • Not the same as aon_click_id. aon_click_id identifies one click; offer_instance_id identifies one delivery. One delivery can be clicked several times, so several clicks and several conversions can share one offer_instance_id.
  • Not unique and not an idempotency key. Multiple conversions (for example several goals of one Offer) and their earning events carry the same value. Deduplicate by (application_id, event_id).
  • Offer walls: AON generates it. On a static offer wall AON generates the value when the user clicks; on a hosted offer wall it is generated each time the wall loads. You never hold it in advance, so credit users by sub_id.
  • Third-party MCP hosts. When your traffic reaches AON through a third-party MCP host, the Query result lives in the model's context and your server may never have seen the value.

Unknown fields

Receivers must ignore any field of an event object they do not recognize for that event's event_type, including a field defined only for another event type, and must not reject the event for it. AON may add optional fields to any event type within Protocol v1.0 without changing AON-Protocol-Version. The same applies to the envelope itself: ignore any top-level member other than delivery_id and events that you do not recognize. The signature always uses the original raw bytes of the whole body.

The published JSON Schema describes exactly what AON sends; do not use it unmodified to reject events. If you validate with the Schema, reduce each element of events first:

  1. Read the element's event_type and select the Schema branch whose event_type const equals it. An unknown event_type is handled by your event-type rule, not by this one.
  2. Remove every field of the element that is not a key of that branch's properties.
  3. Validate the reduced object against that branch.

SDK receivers

Upgrade to @agentoffernetwork/sdk 1.2.0 or later. Earlier versions accept only a single event object as the body and reject the batch envelope.

verifyAgentConversionWebhook still verifies the raw body before parsing, and accepts all five event types. From 1.2.0 it returns the list of events in the delivery, in body order, instead of one payload. Narrow each event by eventType before using event-specific fields. The result also carries deliveryId, the delivery_id of the request; log it, and do not use it for de-duplication.

const verified = await verifyAgentConversionWebhook(input)
 
// deliveryId identifies this one request. Log it; never de-duplicate on it.
console.info("aon webhook", verified.deliveryId)
 
for (const event of verified.events) {
  // idempotencyKey is [applicationId, eventId] — skip what you already processed
  if (await alreadyProcessed(event.idempotencyKey)) continue
 
  if (event.payload.eventType === "conversion") {
    await recordConversion(event.payload.eventName)
  } else {
    await recordEarning(event.payload.earningId, event.payload.sequence)
  }
  await markProcessed(event.idempotencyKey)
}
 
// one 2xx acknowledges every event in the delivery
return new Response(null, { status: 204 })

Upgrading from 1.1.0 requires a code change

The return value changed: there is no single payload and no body digest any more. Code that reads verified.payload must loop over verified.events. A malformed envelope — delivery_id missing or empty, or events empty, longer than 100, or holding an invalid element — throws; the function never returns a partial list. A body that is a single event object, the format before this change, still verifies and comes back as a one-event list with deliveryId set to null.

SDK verification does not store deduplication keys or reorder events for you.

Idempotency

Use (application_id, event_id) as the durable idempotency key, one record per event, and keep it for at least 24 hours. Do not use delivery_id for this: it changes on every request, retries included, so it never identifies an event.

  • Key not seen before: apply the business effect once and store the key in the same transaction.
  • Key already processed: skip the event without another business effect. The delivery still gets a 2xx.

A retried event can arrive alone or next to events you have never seen, so the digest of the whole body no longer identifies an event. The earlier rule — keep the body digest and return HTTP 409 when the same key arrives with a different body — is withdrawn; do not return 409 for a repeated event.

An in-memory cache or SDK signature verifier does not provide this durable transaction.

Five delivery attempts

Any 2xx response completes delivery of every event in the request. AON waits at most 30 seconds, does not follow redirects and ignores the response body. A timeout, 3xx, or other non-2xx response fails every event in the request, and each of them then follows one fixed five-attempt ladder:

AttemptDelay after the previous attempt
1Immediate
21 minute
35 minutes
430 minutes
52 hours
  • Attempts are counted per event. A failed delivery uses one attempt of each event it held. There is no sixth attempt.
  • After a failure, events are retried one at a time. Every later attempt for such an event is a delivery whose events array holds only that event. One event your receiver cannot process therefore never blocks the others.
  • The event is frozen; the delivery is not. Across attempts, event_id and the bytes of the event object stay the same. Which events travel together is not guaranteed, and each attempt gets a fresh timestamp, a new delivery_id and a matching signature.

Send a test event

You do not have to wait for a real conversion or a real earning change to check your receiver. Every event type can be tested: conversion, earning_confirmed, earning_available, earning_paid_out and earning_rejected. In the Developer Portal, open your application's Webhooks page, click Payload on any row of the Events card, then Send test event. To check how your receiver links the events of one conversion, click Simulate full flow on the same card (see Simulate a full flow). A test needs a saved callback URL and a saved signing secret, and goes only to the saved URL. You do not have to subscribe to an earning event before you test it.

You can fill in amount and sub_id … sub_id_5; every other field is a fixed sample value.

  • Earning amounts have at most 2 decimal places and at most 16 digits before the decimal point, because earnings are paid in whole cents. A blank amount sends 5.00, rendered as "5.000000" like a real earning. A conversion test accepts up to 6 decimal places.
  • earning_rejected carries a rejection reason. Pick one of merchant_cancelled, duplicate, invalid_order, fraud, returned, reversed or refund; the default is refund. Test each reason your receiver branches on.

AON sends one POST, built and signed exactly like a real delivery: the same four headers, the same signing string, and a batch envelope with its own delivery_id whose events array holds one event of the type you picked, with the fields and field order of that type. The body has no test-only field. The only difference is one extra request header:

HeaderValueMeaning
X-AON-TesttrueThis delivery is a test event you triggered. Real deliveries never carry this header.

X-AON-Test is a header on the callback AON sends to you; you never send it yourself. The header is not part of the signing string, so it does not change how you verify the signature.

Handle a test event in this order:

  1. Verify the signature first, exactly as for a real delivery. An unsigned or wrongly signed request is not a test event, whatever headers it carries.
  2. Then check X-AON-Test. When its value is true, return a 2xx and skip your business logic for every event in the body: do not credit a user, record a conversion, or store the event_id as a real one.

This matters most for earning events. Never credit, book or pay out anything for an event that arrived with X-AON-Test: true — in particular not for earning_paid_out, which looks exactly like a real payout.

What to expect from a test event:

  • It holds one event, or two in the first request of a flow simulation. A real delivery can hold up to 100, so a receiver that passes the test must still loop over events.
  • It is not counted as an earning. It creates no conversion, earning, or settlement, and your reports and balance do not change.
  • It is never retried. Each click sends exactly one request. The five-attempt ladder above applies to real events only.
  • A real event may carry one more field. A real conversion body can include mapped_event_name; a test event never does. Ignore fields you do not recognize, as described in Unknown fields.
  • The ids are samples. aon_click_id, offer_instance_id, offer_id, placement_id, earning_id and conversion_event_id are sample or test-generated values that point to no real click, conversion, earning or Offer, and event_id (earning: followed by a UUID for earning events) and delivery_id are new on every send. Do not validate the format of real ids against them.

The Portal shows the result of each send: the status code your endpoint returned, the time it took, and the request headers and body AON sent. The time is measured from sending the request to receiving your response headers; it does not include the time AON spends resolving your host name. AON does not read or show your response body.

Simulate a full flow

A flow simulation sends the events of one conversion as real deliveries would reach you, one request at a time. Pick a flow:

FlowRequest 1Request 2Request 3
Positiveconversion, earning_confirmedearning_availableearning_paid_out
Negativeconversion, earning_confirmedearning_rejected (reason refund)—

The events of one simulation are linked the way real ones are:

  • every earning event's conversion_event_id is the event_id of the conversion event in request 1;
  • all earning events share one earning_id;
  • sequence counts up from 1 (earning_rejected is 2 in the negative flow);
  • every event carries the same amount and the sub_id values you entered.

AON generates every id, and each run uses new ones. Each request is a separate test delivery with its own delivery_id and signature and X-AON-Test: true. The Portal sends the next request 5 seconds after the previous result, and stops at the first request that does not get a 2xx; you can also stop it while it waits.

Two things in a simulation are test shapes, not what real deliveries look like:

  • Request 1 mixes a conversion and an earning event. The protocol allows events of different types in one request, so your receiver must handle it. Today real conversion and earning events are sent separately, so they do not arrive in the same request.
  • The conversion and its earning have the same amount. That only saves you typing. In real deliveries the earning amount is your share of the conversion, which usually differs from the conversion amount.

An application can send 20 test requests per minute. Single test events and the requests of a flow simulation share this limit, and each request of a simulation counts once.

Format change: batch envelope

This section summarizes the change for teams that built, or are building, a receiver. It takes effect with this release and applies to every application with a callback URL; there is no per-application switch and no opt-in period.

BeforeNow
Request body{"event_id":"evt_…","event_type":"conversion", … }{"delivery_id":"dlv_…","events":[{"event_id":"evt_…","event_type":"conversion", … }, … ]}
Request identifierNonedelivery_id: new on every request, retries included; for troubleshooting only, never for de-duplication
Events per requestExactly one1 to 100
Event objectIts fields, field order and valuesUnchanged
Headers and signatureFour headers, one signing string over the whole raw body, AON-Protocol-Version: 1.0Unchanged
Meaning of a 2xxThe event was receivedEvery event in the request was received
Retry after a failureThe same body is sent againEach event is retried on its own; up to 5 attempts per event
IdempotencyKey plus body digest; 409 on a mismatchKey (application_id, event_id) only; no 409
Test eventOne event objectAn envelope with its own delivery_id, holding one event (two in the first request of a flow simulation)

What to change in a receiver:

  1. Keep verifying the signature over the raw body — that code does not change.
  2. Log delivery_id, and ignore any top-level member of the envelope you do not recognize.
  3. Read events and process each element the way you processed the whole body before.
  4. De-duplicate per event by (application_id, event_id); drop any check that compares body digests or returns 409.
  5. Return one 2xx once every event is handled or safely stored, within 30 seconds for up to 100 events.
  6. If you use the TypeScript SDK, upgrade to @agentoffernetwork/sdk 1.2.0 and loop over the returned event list; see SDK receivers.

Reference vectors. The Protocol v1.0 schema fixtures include signed envelope vectors with several events — raw body, headers, secret and expected signature — next to the single-event vectors. They are in the envelopes member of postback-agent-webhook.json (conversions, including a delivery and its retry) and postback-agent-earning-webhook.json (earning events of several types in one delivery). Use them to check your verification and parsing before you send a test event.

Frozen and current facts

Configuration changes affect different parts of the delivery lifecycle:

  • Event-time opt-in is frozen. A conversion records whether it was eligible when the event was accepted. Disabling the current subscription does not cancel an already eligible conversion.
  • Target URL is frozen at outbox creation. Changing the endpoint affects future outbox entries, not the target already stored on a queued entry. Queued events for the old and the new URL are never sent in the same delivery.
  • Wire version and each event object are frozen at outbox creation. The bytes of an event object stay the same across every attempt, and a v1.0 row stays v1.0 and is never downgraded as a fallback. The envelope is assembled when a delivery is sent and is not part of the frozen content.
  • Signing secret and key version are current per attempt. The worker reads the application's current callback secret and key version when it attempts delivery. A rotation can therefore change X-AON-Key and the signature for an already queued event while its target and event object remain unchanged.

Keep the current and previous key generations available during your receiver's rotation window. Unknown or expired key ids must fail closed; do not try every secret as a fallback.

Configuration is not delivery health

A saved endpoint, enabled subscription, configured secret, or successful Portal response is a configuration fact. It is not proof that a worker is running or that a delivery reached your receiver. Runtime support is closed by deployment observation and a signed callback canary, not by this static page.