CAKE API — Sub Affiliates

This article will cover the following:

Why use this API?
Use the Sub Affiliates API to manage sub-affiliate relationships within CAKE — allowing affiliates to recruit and track their own downstream partners while preserving accurate attribution and payout hierarchies.
Authentication: All CAKE API requests require your api_key parameter. Find yours under Setup → System Access → API Keys.

Overview

Sub affiliates in CAKE represent a downstream partner layer within an affiliate's own network. When an affiliate recruits publishers or sub-partners to drive traffic on their behalf, those entities can be tracked as sub affiliates within CAKE — giving the parent affiliate visibility into sub-partner performance while preserving the network's ability to report accurately at every level.

Sub affiliate relationships are attached to a parent affiliate account. The parent affiliate earns a payout on conversions generated by their sub affiliates, while CAKE records the sub-affiliate source for reporting purposes. Sub affiliate IDs are passed through the tracking link via the sub_affiliate parameter and appear in conversion reports.

Sub affiliates are managed through the CAKE UI under Affiliates → Sub Affiliates and via the API, enabling networks that operate tiered publisher programs to automate sub-affiliate setup and reporting.


Key Concepts

  • Sub Affiliate — A downstream publisher partner who drives traffic through a parent affiliate's tracking links. Sub affiliates are tracked within CAKE for attribution and payout purposes but do not have their own CAKE login accounts.
  • Parent Affiliate — The primary affiliate account that recruits and manages sub affiliates. The parent affiliate receives credit for conversions generated by their sub affiliates.
  • Sub Affiliate ID — A unique identifier assigned to each sub affiliate within CAKE. Passed via the sub_affiliate parameter in tracking URLs for click and conversion attribution.
  • Payout Split — The revenue sharing arrangement between the parent affiliate and the network when sub affiliates generate conversions. Configured per parent affiliate account.
  • Sub Affiliate Report — A report available in CAKE that breaks down clicks, conversions, and payouts by sub affiliate ID, giving parent affiliates visibility into their downstream partner performance.

Available Actions


Get Sub Affiliates

When to use: Retrieve all sub affiliates registered under a parent affiliate — use when building a sub-affiliate management portal, syncing sub-affiliate data to an external system, or auditing sub-affiliate configurations.
GET/api/2/sub_affiliates.json
ParameterTypeRequiredDescription
api_keystringYesYour CAKE API key.
affiliate_idintegerYesThe parent affiliate ID to retrieve sub affiliates for.
sub_affiliate_idintegerNoFilter to a single sub affiliate by ID.
sub_affiliate_statusstringNoFilter by status: active, inactive.
start_at_rowintegerNoPagination offset. Default 0.
row_limitintegerNoMax records. Default 100, max 500.

Sample request

GET https://yourdomain.cakemarketing.com/api/2/sub_affiliates.json?api_key=YOUR_API_KEY&affiliate_id=67890&sub_affiliate_status=active

Sample response

{ "request_status": "Success", "response": { "sub_affiliates": [ { "sub_affiliate_id": 901, "sub_affiliate_name": "West Coast Leads LLC", "parent_affiliate_id": 67890, "sub_affiliate_status": "active", "date_created": "2025-02-10T11:00:00Z" } ], "total_rows": 1 } }

Create Sub Affiliate

When to use: Register a new sub affiliate under a parent affiliate account — use when automating sub-affiliate onboarding as part of a managed publisher program, or when migrating existing sub-affiliate data into CAKE.
POST/api/2/sub_affiliate.json
ParameterTypeRequiredDescription
api_keystringYesYour CAKE API key.
affiliate_idintegerYesThe parent affiliate ID to register the sub affiliate under.
sub_affiliate_namestringYesDisplay name for the sub affiliate.
sub_affiliate_statusstringNoactive | inactive. Default: active.
websitestringNoSub affiliate's website URL.

Sample request

POST https://yourdomain.cakemarketing.com/api/2/sub_affiliate.json { "api_key": "YOUR_API_KEY", "affiliate_id": 67890, "sub_affiliate_name": "Pacific Leads Co", "sub_affiliate_status": "active", "website": "https://pacificleads.example.com" }

Sample response

{ "request_status": "Success", "response": { "sub_affiliate_id": 902, "sub_affiliate_name": "Pacific Leads Co", "parent_affiliate_id": 67890, "sub_affiliate_status": "active", "date_created": "2026-06-19T10:00:00Z" } }

Sub Affiliate Report

When to use: Retrieve click and conversion performance broken down by sub affiliate — use when generating sub-affiliate earnings summaries for parent affiliates, or when building sub-publisher performance dashboards.
GET/api/2/report/sub_affiliate.json
ParameterTypeRequiredDescription
api_keystringYesYour CAKE API key.
start_datedateYesReport start date (YYYY-MM-DD).
end_datedateYesReport end date (YYYY-MM-DD).
affiliate_idintegerNoFilter to a specific parent affiliate.
sub_affiliate_idintegerNoFilter to a specific sub affiliate.
offer_idintegerNoFilter to a specific offer.
start_at_rowintegerNoPagination offset.
row_limitintegerNoMax rows. Default 100, max 10000.

Sample request

GET https://yourdomain.cakemarketing.com/api/2/report/sub_affiliate.json?api_key=YOUR_API_KEY&start_date=2026-06-01&end_date=2026-06-19&affiliate_id=67890

Sample response

{ "request_status": "Success", "response": { "data": { "rows": [ { "sub_affiliate_id": 901, "sub_affiliate_name": "West Coast Leads LLC", "clicks": 1240, "conversions": 38, "payout": 684.00, "epc": 0.552 } ] } } }


If you have any questions, please reach out to your dedicated CAKE Client Success Manager/Account Manager or contact the CAKE Support Team at support@getCAKE.com.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.