MngGetAffiliatesByFilter¶
Returns a paginated affiliate table in the columnar structure + rows +
count form, the same contract as
MngGetCustomersByFilter. Brand scope
is applied through the affiliate-to-brand access relation before pagination.
Request¶
{
"command":"MngGetAffiliatesByFilter",
"extID":"1",
"data":{
"brand":"default",
"limit":50,
"offset":0,
"where":[["status","=",0]],
"orderBy":[["company_name","asc"]]
}
}
Filterable fields: id, code, company_name, contact_name, email,
country, parent_affiliate_id, status, created_time, and updated_time.
Response Format¶
The response is a column table: field names appear once in structure, and each
row is a flat array of values in that same order. count is calculated after
scope and filters but before limit and offset.
{
"structure": [
"id", "code", "company_name", "contact_name", "email", "phone", "country",
"parent_affiliate_id", "status", "meta_json", "created_time",
"updated_time", "created_by", "updated_by",
"brand", "manager_id", "default_campaign_id", "primary_link_id",
"primary_link", "has_password", "cabinet_enabled", "password_updated_time",
"last_login_time",
"visits", "unique_visitors", "registrations", "kyc_approved",
"first_deposits", "deposits", "active_traders", "deposit_value",
"visit_to_registration_rate"
],
"rows": [
[
7, "PARTNER7", "Seven Media", "Ivan Petrov", "[email protected]",
"+35700000000", "CY", 0, 0, "", 1777600000, 1777600000, 10, 10,
"default", 42, 0, 15, "https://terminal.example.com/?aff=PARTNER7",
true, true, 1777600000, 1777690000,
1000, 820, 120, 64, 48, 190, 35, 412500.75, 12.0
]
],
"count": 31
}
Clients must read values positionally against structure rather than relying on
fixed indices.
Columns¶
Thirty-two columns in three blocks. The order below is the order in structure
and in every row.
Affiliate record, columns 1 to 14:
idcodecompany_namecontact_nameemailphonecountryparent_affiliate_idstatusmeta_jsoncreated_timeupdated_timecreated_byupdated_by
code is a public attribution identifier, not a secret or API credential; see
MngAddAffiliate. created_by and updated_by hold
manager ids, not names.
Brand access, columns 15 to 23:
| # | Column | Type | Description |
|---|---|---|---|
| 15 | brand |
string | Effective brand |
| 16 | manager_id |
int | Responsible CRM manager |
| 17 | default_campaign_id |
int | Default campaign or 0. Deprecated on write, see MngSetAffiliateBrandAccess |
| 18 | primary_link_id |
int | Primary marketing-link id or 0 |
| 19 | primary_link |
string | Complete server-generated URL or an empty string |
| 20 | has_password |
bool | Whether a cabinet password is configured. The hash itself is never returned |
| 21 | cabinet_enabled |
bool | Current affiliate cabinet access state |
| 22 | password_updated_time |
int64 | Last password set or rotation timestamp |
| 23 | last_login_time |
int64 | Last affiliate cabinet sign-in timestamp |
These nine columns are always present. When no brand is resolved they are filled
with "", 0, and false rather than being omitted, so the key set is
constant across every response. A brand is absent only for a super administrator
who did not pass one, and the caller already knows whether it did.
The CRM affiliate table should copy primary_link directly. It must not derive
the URL from frontend host or UTM configuration. For an empty link, call
MngGetOrCreateAffiliateLink.
Statistics, columns 24 to 32:
| # | Column | Type | Description |
|---|---|---|---|
| 24 | visits |
int | Recorded visits |
| 25 | unique_visitors |
int | Distinct visitors |
| 26 | registrations |
int | Registrations attributed to the affiliate |
| 27 | kyc_approved |
int | Registered customers with an approved KYC |
| 28 | first_deposits |
int | Customers with an initial credited deposit |
| 29 | deposits |
int | Count of all credited Cashier deposits |
| 30 | active_traders |
int | Customers currently counted as active traders |
| 31 | deposit_value |
double | Cumulative value of all credited Cashier deposits |
| 32 | visit_to_registration_rate |
double | registrations over visits, as a percentage |
The statistics block does not depend on brand access and is filled in every case.