Operator guideENreportingaffiliateeventspostbackexport

Reporting / Affiliate Events Report

Audit log of the events and saved amounts the platform sent to the affiliate system, with per-currency successful totals and a CSV export.

Reader view

Clean portal guidance

This page keeps the operator explanation, field and action descriptions, and screenshots visible without exposing repo paths, raw sidecars, or editorial-only implementation details.

Narrative content

Page body

What this page shows

Affiliate Events Report is the audit log of events the platform tried to send to the affiliate system. Each row is one stored affiliate event: when it was created, what kind of event it was, which affiliate and player it belonged to, the amount and currency that were saved with it, whether the send succeeded, and the exact request URL and payload that were used.

Above the table, a row of green chips shows the successful totals grouped by currency.

When to use it

  • confirm whether registration, deposit, GGR, withdrawal, or bonus events were actually sent to the affiliate provider
  • investigate why a specific event failed by reading its stored error and request payload
  • check how much was reported to affiliates per currency over a date range
  • pull a CSV of the matching events for reconciliation with the affiliate platform

How to read it

  • Each chip in Successful totals is the summed amount for one currency, plus the count of successful events in parentheses, for example EUR 1,250.00 (42).
  • The totals only include events whose status is success and that carry a numeric amount.
  • Currencies are never mixed. Each currency is summed on its own and shown as its own chip. There is no single combined total and no exchange-rate conversion on this page.
  • The table count line (N events found) reflects every matching event, not just successful ones.
  • A row marked success shows when it was sent; any other status shows the stored error message instead.
  • Amount and Currency are read from the saved event payload. When the payload carries no currency, the row and the totals show UNKNOWN.

Filters that change the result

  • Start date and End date bound the event creation date. The end date is inclusive of the whole day.
  • Event type limits to one of registration, deposit, ggr, withdrawal, or bonus.
  • Status limits to one of pending, processing, success, failed, not_qualified, cancelled, or retried.
  • Affiliate / partner matches a partner identifier exactly against the event PID, the affiliate link external id, or the link payload pid / stag.
  • Filters are staged in the form and applied only when you press Apply. Reset returns to the default last-7-days window and clears the other filters.

Export

Export downloads the events that match the currently applied filters as a CSV. The export ignores the on-screen page size and streams up to the matching rows within the date range. It uses the same filters as the table, so the date range, event type, status, and partner filter all carry through. The CSV lists one row per event with the resolved identifiers, amount, currency, error, request URL, and the saved payload. The per-currency totals chips are a screen-only summary and are not part of the CSV.

Why values may differ from other reports

  • This page reports what was sent to the affiliate system, not the platform's own ledger. A deposit can exist in finance reports without a successful affiliate event here, and vice versa.
  • The amount shown is whatever was stored on the affiliate event at the time it was created. It is not re-converted or revalued, so it reflects the currency that was recorded with the event.
  • Failed, pending, and cancelled events are listed in the table but never counted in the successful totals.

Known caveats

  • The successful totals are per-currency sums only. There is no cross-currency grand total on this page.
  • Amount and currency come from the saved payload using a fixed precedence. If a provider stored the amount under an unexpected key, that event can show no amount and is then excluded from totals.
  • UNKNOWN currency groups any successful event whose payload had no recognizable currency.
  • The partner filter is an exact match, not a contains search.

Verification status

  • status: verified_backend
  • FE route, filters, totals chips, table columns, and CSV export are mapped
  • gs-admin-backend owns the route, controller, service, and the raw SQL aggregation over nx.affiliate_events
  • no nx-workspace core dependency participates in this read-only report, so the status is verified_backend, not verified_backend_and_core
Calculation notes

Calculations

calculation

Resolved sent payload

The Payload column and CSV payload field show whatever was actually sent, not always the full stored record.

Source Fields
request_body, affiliate_event_payload
Transform
Precedence is request_body first, then affiliate_event_payload._payload, then the full affiliate_event_payload. This is the "what we sent" value and is applied identically in the FE cell (resolveSentPayload), the CSV builder, and the totals SQL CTE (saved_payload).
calculation

Resolved amount

Amount is read from the saved payload, not from a dedicated amount column.

Source Fields
request_body, affiliate_event_payload
Transform
From the resolved payload, take the first present of value, then amount, then sum. A row is excluded from totals when no numeric amount resolves.
calculation

Resolved currency

Currency is inferred from the payload; UNKNOWN means the payload had no currency hint.

Source Fields
request_body, affiliate_event_payload
Transform
From the resolved payload, take the first present of currency, currencyCode, currency_code, then affiliate_event_payload._conversion_metadata.currencyCodeTo, then the 3-letter suffix of the payload goal, then uppercase it. Falls back to UNKNOWN when nothing resolves.
calculation

Sent timestamp / error

The Sent / Error column shows a sent time for success and the stored failure reason otherwise.

Source Fields
affiliate_event_status, updated_at, response_message
Transform
When status is success, sentAt is updated_at and error is null. Otherwise sentAt is null and error is the parsed response_message (message, then error, then code, then raw text).
calculation

Related ID label

One identifier is surfaced per row using a fixed precedence.

Source Fields
identifiers.userId, identifiers.transactionId, identifiers.accountId, identifiers.affiliateLinkId
Transform
FE label precedence: `User <userId>`, then `Transaction <transactionId>`, then accountId, then `Link <affiliateLinkId>`, else N/A.
calculation

Partner identifier

The Affiliate column shows the most specific partner identifier available.

Source Fields
ae.pid, link_pid, link_stag, affiliate_link_external_id
Transform
Backend selects ae.pid plus link payload pid/stag and affiliate_link_external_id; the FE picks the first present of pid, link_pid, link_stag, affiliate_link_external_id for display.
calculation

Status chip color

Color is a visual cue only and does not change the stored status.

Source Fields
affiliate_event_status
Transform
success maps to green; failed and not_qualified map to red; pending, processing, and retried map to amber; anything else maps to default. Pure FE presentation.
Grid columns

Columns

field

Created / Sent

Render
Primary line is created_at formatted in UTC. Caption is sentAt in UTC, or `Not sent` when sentAt is null.
field

Type

Render
Primary line is the event type; caption is the event kind (ae.type) when present.
field

Event ID

Render
Raw stored affiliate event id.
field

Related ID

Render
Label precedence: `User <userId>`, then `Transaction <transactionId>`, then accountId, then `Link <affiliateLinkId>`, else N/A. Tooltip shows accountId.
field

Affiliate

Render
Primary line is partnerIdentifier or affiliateKey; caption is affiliateProvider or affiliateLinkExternalId.
field

Currency

Render
Currency code, or `UNKNOWN` when the payload had no recognizable currency.
field

Amount

Render
Formatted as `<CURRENCY> <amount>` with two decimals. Shows N/A when no amount was resolved.
field

Status

Render
Status chip. Green for success; red for failed or not_qualified; amber for pending, processing, or retried; default otherwise.
field

Sent / Error

Render
For success, shows the sent timestamp (UTC) or `Sent`. For any other status, shows the parsed error message or N/A.
field

Action / Click / TID

Render
Shows the first present of actionId, clickId, tid. Tooltip lists all three.
field

Request URL

Render
Request URL used for the send, or N/A. Tooltip shows the full URL.
field

Payload

Render
Monospace JSON of what was sent. Tooltip pretty-prints the same payload.
Filter dictionary

Filters

field

Start date

Type
date
Default
today minus 7 days
Backend Query Param
startDate
Behavior
Staged in the form; applied on Apply. Serialized as yyyy-MM-dd. Backend filters ae.created_at >= startDate.
field

End date

Type
date
Default
today
Backend Query Param
endDate
Behavior
Staged in the form; applied on Apply. Serialized as yyyy-MM-dd. Backend filters ae.created_at < (endDate + interval '1 day'), so the end day is inclusive.
field

Event type

Type
select
Backend Query Param
eventType
Options
registration, deposit, ggr, withdrawal, bonus
Behavior
All when empty. Backend matches ae.affiliate_event_type exactly. Option list is FE-provided; backend does not constrain the value.
field

Status

Type
select
Backend Query Param
status
Options
pending, processing, success, failed, not_qualified, cancelled, retried
Behavior
All when empty. Backend matches ae.affiliate_event_status exactly. Option list is FE-provided; backend does not constrain the value.
field

Affiliate / partner

Type
text
Backend Query Param
partnerIdentifier
Behavior
Trimmed on Apply. Exact match (not contains) against any of the listed sources.
Backend Matching
ae.pid = partnerIdentifier, al.affiliate_link_external_id = partnerIdentifier, al.affiliate_link_payload->>'pid' = partnerIdentifier, al.affiliate_link_payload->>'stag' = partnerIdentifier
field

Page

Type
pagination-state
Default
0
Backend Query Param
page
Behavior
FE page index is zero-based; backend page is one-based (page + 1). Reset to 0 on Apply, Reset, and rows-per-page change.
field

Rows per page

Type
pagination-state
Default
20
Backend Query Param
limit
Options
10, 20, 50, 100
Behavior
Backend default 20, clamped to a maximum of 1000.
Metric dictionary

Metrics

metric

Successful totals

For each currency, the summed amount of successful affiliate events plus the count of those events, shown as one green chip. Only events with status `success` and a numeric amount are included. Different currencies are never combined.

Aliases
affiliate successful sent amounts, affiliate totals per currency, affiliate sent amount total
Numerator
SUM(amount_text::numeric) per currency group
Denominator
none; this is a sum and a per-currency COUNT(*), not a ratio
Backend Formula
With a filtered CTE over nx.affiliate_events, each row's saved_payload is COALESCE(request_body, affiliate_event_payload->'_payload', affiliate_event_payload). amount_text = COALESCE(saved_payload->>'value', ->>'amount', ->>'sum'). currency = UPPER(COALESCE(saved_payload->>'currency', ->>'currencyCode', ->>'currency_code', affiliate_event_payload->'_conversion_metadata'->>'currencyCodeTo', substring(saved_payload->>'goal' from '_([A-Za-z]{3})$'))). Then GROUP BY COALESCE(NULLIF(currency, ''), 'UNKNOWN') WHERE affiliate_event_status = 'success' AND amount_text IS NOT NULL AND amount_text matches '^-?[0-9]+(\.[0-9]+)?$', returning ROUND(SUM(amount_text::numeric), 2) AS amount and COUNT(*) AS event_count.
Currency Basis
Reporting Currency: None imposed by the report. Each chip reports in the currency that was stored on the event payload. Currencies are grouped, never converted or summed across currencies. | Exchange Rate Source: Not applicable. This report performs no FX conversion. When an event payload carries `_conversion_metadata.currencyCodeTo`, that target currency is used as the grouping key, but the amount summed is still the stored amount value as recorded on the event; the report does not apply any rate itself. | Timing Basis: Transaction-time. The amount and currency are whatever were saved on the affiliate event at creation time. There is no period-average rate, no closing rate, and no current-snapshot remeasurement. | Rounding: SUM rounded to 2 decimals via ROUND(..., 2) in SQL, returned as text. | Missing Currency: Events with no recognizable currency are grouped under the literal 'UNKNOWN'.
Zero Value Behavior
Not a ratio, so there is no zero-denominator case. When no successful numeric-amount events match the filters, the totals array is empty and the FE shows `No successful sent amounts for current filters`.
Verification Status
verified_backend
Last Verified At
2026-06-29
metric

Events found

Count of all affiliate events matching the applied filters, regardless of status. Drives the `N events found` header line and table pagination.

Aliases
affiliate events count, total events found
Numerator
COUNT(*) over the filtered FROM/JOIN with the same WHERE clause as the table
Denominator
none
Backend Formula
SELECT COUNT(*) over nx.affiliate_events joined to affiliate_links/affiliates/users with the active filter conditions.
Verification Status
verified_backend
Last Verified At
2026-06-29
metric

Amount (per row)

The amount stored with a single affiliate event, shown with its currency. Same precedence as the totals aggregation; no conversion is applied.

Aliases
affiliate event amount, sent amount per event
Numerator
single stored value (value, then amount, then sum) from request body, then inner _payload, then full payload
Denominator
none
Backend Formula
extractAffiliateEventReportMoney reads firstPresent(request.value, request.amount, request.sum, payload.value, payload.amount, payload.sum) for amount and firstPresent of currency keys plus _conversion_metadata.currencyCodeTo and the goal suffix for currency, uppercasing the currency.
Currency Basis
Reporting Currency: The currency stored on the event; no conversion. | Timing Basis: Transaction-time stored value. | Missing Currency: Renders as UNKNOWN on the row when unresolved.
Verification Status
verified_backend
Last Verified At
2026-06-29
Operational notes

Notes

item

The list and CSV export share one route; csvDownload=true switches the service to the CSV branch, which bypasses pagination and the totals aggregation and streams up to CSV_EXPORT_LIMIT (50000) rows within the same filters.

item

There is no dedicated affiliate_events Sequelize model file; the report uses raw SQL against nx.affiliate_events. affiliateLinks.js and affiliates.js cover the joined tables.

item

Successful totals are per-currency sums (GROUP BY currency). No FX conversion is performed; currencies are never combined into a single total.

item

amount and currency are derived from the saved payload (request_body, then payload._payload, then full payload). The same precedence is used in the FE cell, the CSV builder, and the totals SQL.

item

The end-date filter uses ae.created_at < (endDate + interval '1 day'), so the selected end day is inclusive.

item

The FE page index is zero-based and the backend page is one-based; the hook sends page + 1. Backend limit defaults to 20 and is clamped to a maximum of 1000.

item

Event type and status dropdown option lists are FE-provided; the backend matches the raw string exactly and does not constrain to those enums.

item

The partner filter is an exact match against ae.pid, affiliate_link_external_id, and the link payload pid/stag, not a contains search.

Related references

Related pages

pageReporting

Canonical entrypoint for standalone reporting pages outside the main Dashboard widgets.

pageReporting / Bonus Performance

Grouped bonus performance report for activations, amounts, deposits, withdrawals, GGR, and NGR by bonus item.

pageReporting / Card Approval Rates

Snapshot report of card deposit approval rates for NetworxPay, Paydex, and Carouseller, split by Trusted and NonTrusted players, with today versus the previous 30 days and today top decline reasons.

pageReporting / Change Notification Detail

Detail page for one audit entry, including actor metadata, description, and before/after comparison views.

pageReporting / Change Notifications

Audit list for recorded configuration, administrator, and system change entries with filters for actor, entity, and change type.

pageReporting / Control Verification

Monitoring workspace for integrity verification runs, compliance scoring, baseline control, and component-by-component failure review.