MngUpdateAffiliate¶
Updates the profile of an existing affiliate. The update is partial: only the fields present in the request are changed, all other fields keep their current values.
{"command":"MngUpdateAffiliate","extID":"1","data":{"id":7,"brand":"default","company_name":"Partner Ltd","contact_name":"Jane Doe","email":"[email protected]","phone":"+35700000000","country":"CY","status":0}}
| Field | Type | Required | Description |
|---|---|---|---|
id |
int | Yes | Existing affiliate id |
brand |
string | Admin: yes | Effective brand scope; the affiliate must have access to this brand |
company_name |
string | No | Company / affiliate name |
contact_name |
string | No | Contact person |
email |
string | No | Contact email, also the affiliate cabinet login; empty string clears it |
phone |
string | No | Contact phone |
country |
string | No | ISO 3166-1 alpha-2 code (CY), case-insensitive; empty string clears it |
status |
int | No | 0 active, 1 disabled, 2 archived |
Requires access_crm and set_marketing.
Immutable fields¶
code is never changed and is ignored if sent. The code is the affiliate's
public attribution identifier: customers, tracking touches, link utm_source
values and cabinet login refer to it, so it stays exactly as generated at
creation. id, parent_affiliate_id, meta_json, created_time and
created_by are not editable either; updated_time and updated_by are set by
the server.
Email uniqueness¶
The affiliate cabinet accepts either the affiliate code or the email as login.
A non-empty email must therefore not match, case-insensitively, the email or
the code of any other affiliate. Otherwise the command fails with
RET_DUPLICATE_RECORD.
Status¶
Setting status to disabled or archived switches the affiliate off for new
activity:
- new visits and registrations are no longer attributed to the affiliate;
- cabinet login and affiliate API token requests are rejected;
- new links and API tokens cannot be created for it;
- customers cannot be assigned to it.
Customers already linked to the affiliate and its history are not changed.
Response¶
{"affiliate":{"id":7,"code":"AFF-3f9c2a1b7d4e","company_name":"Partner Ltd","contact_name":"Jane Doe","email":"[email protected]","phone":"+35700000000","country":"CY","status":0,"created_time":1761696000,"updated_time":1761739200,"updated_by":12}}
| Error | HTTP | Reason |
|---|---|---|
RET_INVALID_DATA |
400 | Missing id, invalid country or status, admin request without brand |
RET_NOT_FOUND |
404 | Affiliate does not exist |
RET_NOT_ENOUGH_RIGHTS |
403 | Affiliate has no access to the brand in scope |
RET_DUPLICATE_RECORD |
409 | email is used by another affiliate as email or code |