Marketing Attribution API¶
ScaleTrade attribution is brand-scoped and uses the common customer registration endpoint.
- A visitor opens a normal brand page with campaign, affiliate, link, UTM, or sub-id query values.
- The static-page handler records the touch using the brand resolved from the request host.
- Registration resolves the latest valid touch and snapshots it into the customer.
- An external landing page can pass the same public attribution values directly in the registration body.
- Mobile installations use
/appand/app/activatebefore registering withinstallation_id.
Public campaign and affiliate codes are attribution values, not credentials.
Affiliate cabinet¶
The affiliate cabinet is served from the root of the brand's affiliate_host.
For example, affiliate_host: "affiliate.example.com" exposes the cabinet at
https://affiliate.example.com/, with SPA routes such as /login, /links,
and /conversions. affiliate_host is a hostname without a scheme, port, or path;
the cabinet is no longer served from terminal_host/affiliate.
Cabinet assets use root paths (/bundle.js, /bundle.css, and /assets/...).
Credentials are configured per affiliate and brand by CRM. Authentication
accepts the affiliate email or code and returns a dedicated affiliate JWT;
manager and customer tokens are not accepted. The HTTP API keeps its existing
/api/affiliate namespace.
| Method | Path | Purpose |
|---|---|---|
POST |
/api/affiliate/login |
Authenticate with login and password |
POST |
/api/affiliate/logout |
End the browser session |
GET |
/api/affiliate/me |
Current affiliate profile |
GET |
/api/affiliate/dashboard?range=30d |
Brand-scoped funnel totals |
GET |
/api/affiliate/links |
Affiliate tracking links |
GET |
/api/affiliate/conversions?range=30d |
Recent attributed conversions |
A conversion row carries value, currency, reference_id and event_time. Registration,
KYC approval, first deposit and active trader exist at most once per customer, so their row
records the first occurrence: once a field is filled it is never replaced, and later events
of the same kind only fill fields that are still empty. The Deposit row is the exception — it
is keyed per cashier transaction, so every deposit has its own row and the funnel's deposit
volume sums them.
For first deposits that means value and reference_id identify the customer's earliest
credited cashier deposit, not the most recent one. Before 1.25.244 they held whichever deposit
was written last, which after a restart could be an arbitrary one; those rows are corrected
automatically on upgrade.
See: