Skip to content

Marketing and Affiliates TCP API

The marketing subsystem tracks acquisition from the first brand-host visit to customer registration.

Data model

Entity Purpose
Campaign Brand-scoped acquisition campaign and channel metadata
Affiliate Global partner identity with a public affiliate code
Affiliate brand access Makes an affiliate available to one brand and stores its default campaign, manager, and primary link
Marketing link Long tracking URL generated from the brand terminal_host
Brand app App Store or Google Play destination and attribution window
Touch Captured page visit, app click, app activation, or external registration
Customer attribution Attribution selected when a customer is registered

Affiliate and campaign codes are public identifiers. They are not authentication credentials. The server persists a code only if the record is active and valid in the resolved brand.

Brand scope

CRM managers are restricted to the brand from their current staff access record. Admin-scoped managers may address an explicit brand or list records across brands where the command allows an empty filter.

Generated links always use the configured BrandRecord.terminal_host. A caller cannot supply a replacement host.

Access

Marketing management commands accept SESSION_MANAGER, SESSION_ADMIN, SESSION_CRM_MANAGER, and SESSION_CRM_ADMIN.

  • read commands require access_crm and see_customers;
  • write commands require access_crm and set_customers;
  • delete commands require access_crm and del_customers.

Commands

Attribution flows

For browser and external-landing registration, see Customer registration attribution.

For store redirects and first app launch, see Mobile app attribution.

CRM tables should use the ByFilter commands. The older list commands remain available for compatibility with integrations that load small dictionaries.

The default user journey is:

  1. Call MngCreateAffiliateReferral from the Add affiliate dialog.
  2. Display and copy the returned url.
  3. Load the affiliate table through MngGetAffiliatesByFilter; it includes the primary URL for the effective brand.
  4. For legacy rows without a primary URL, call MngGetOrCreateAffiliateLink from the Generate link action.

Campaign, manual link, UTM, and sub-ID commands remain available as advanced operations. They are not prerequisites for normal affiliate onboarding.