> ## Documentation Index
> Fetch the complete documentation index at: https://docs.invoca.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Affiliate Campaigns

Affiliate Campaign status can be replicated using this API. You are not allowed to delete affiliate campaigns.

Relationship properties are shown below

<table><thead><tr><th>Property</th><th>Type</th><th>Value</th></tr></thead><tbody><tr><td>affiliate\_id\_from\_network</td><td>string (read only)</td><td>Network specific id of the affiliate.</td></tr><tr><td>status</td><td>string (read and write)</td><td>One of: Applied, Approved, Suspended, Declined.</td></tr><tr><td>id</td><td>integer (read-only)</td><td>The internal Invoca id of the affiliate campaign.</td></tr><tr><td>id\_from\_network</td><td>string (read and write)</td><td>Network specific id of the affiliate campaign.</td></tr><tr><td>max\_promo\_numbers</td><td>integer (read only)</td><td>Promo number limit.</td></tr><tr><td>object\_url</td><td>string (read-only)</td><td>URL for reaching the affiliate campaign in the UI.</td></tr><tr><td>current\_terms</td><td>(read only)</td><td /></tr><tr><td>**advertiser\_payin**</td><td /><td /></tr><tr><td>max</td><td>decimal</td><td>Maximum payin amount (base + bonuses). `null` when any row in `policies` is formula-driven.</td></tr><tr><td>min</td><td>decimal</td><td>Minimum payin amount (base).</td></tr><tr><td>pricing</td><td>string</td><td>Human‐friendly representation of the payin pricing (eg. “$5.07 per call”). Includes the raw formula text for formula-driven rows. For example, when the list has more than one row: “Base: $4.50 per call” followed by a newline and “Bonus: \<formula text> if \<condition>”.</td></tr><tr><td>currency</td><td>string</td><td>USD, GBP, EUR.</td></tr><tr><td>range</td><td>string</td><td>Formatted string including min and max payin values. `"Dynamic"` when any row in `policies` is formula-driven.</td></tr><tr><td>**policies**</td><td /><td /></tr><tr><td>amount</td><td>decimal</td><td>Payin policy amount. `0` for a formula-driven policy row. See `formula` below.</td></tr><tr><td>currency</td><td>string</td><td>USD, GBP, EUR.</td></tr><tr><td>type</td><td>string</td><td>Base, Bonus.</td></tr><tr><td>condition</td><td>string</td><td>Condition options used to determine the base or bonus payout (eg. “duration >= 1 min 30 sec”).</td></tr><tr><td>formula</td><td>string (read-only)</td><td>Only present at API version `2026-02-01` or later. At earlier versions, including the `2022-08-01` version shown in the examples on this page, Invoca omits this key entirely rather than returning `null`. When present, contains the raw formula text for a formula-driven policy row, or `null` for a fixed-amount row. The Formula Payouts feature flag controls whether a formula row can be authored for the network. It does not control this field's serialization, so a row authored as a formula continues to report its formula here even if the flag is later disabled.</td></tr><tr><td>pricing\_type</td><td>string</td><td>Fixed, OverallMargin, IndividualMargin.</td></tr><tr><td>ivr\_tree</td><td>hash</td><td>Interactive Voice Response tree.</td></tr><tr><td>**affiliate\_payout**</td><td /><td /></tr><tr><td>max</td><td>decimal</td><td>Maximum payout amount (base + bonuses). `null` when any row in `policies` is formula-driven.</td></tr><tr><td>min</td><td>decimal</td><td>Minimum payout amount (base).</td></tr><tr><td>pricing</td><td>string</td><td>Human‐friendly representation of the payout pricing (eg. “$5.07 per call”). Includes the raw formula text for formula-driven rows. For example, when the list has more than one row: “Base: $4.50 per call” followed by a newline and “Bonus: \<formula text> if \<condition>”.</td></tr><tr><td>currency</td><td>string</td><td>USD, GBP, EUR.</td></tr><tr><td>range</td><td>string</td><td>Formatted string including min and max payin values policies. `"Dynamic"` when any row in `policies` is formula-driven.</td></tr><tr><td>**policies**</td><td /><td /></tr><tr><td>amount</td><td>decimal</td><td>Payout policy amount. `0` for a formula-driven policy row. See `formula` below.</td></tr><tr><td>currency</td><td>string</td><td>USD, GBP, EUR.</td></tr><tr><td>type</td><td>string</td><td>Base, Bonus.</td></tr><tr><td>condition</td><td>string</td><td>Condition options used to determine the base or bonus payout (eg. “duration >= 1 min 30 sec”).</td></tr><tr><td>formula</td><td>string (read-only)</td><td>Only present at API version `2026-02-01` or later. At earlier versions, including the `2022-08-01` version shown in the examples on this page, Invoca omits this key entirely rather than returning `null`. When present, contains the raw formula text for a formula-driven policy row, or `null` for a fixed-amount row. The Formula Payouts feature flag controls whether a formula row can be authored for the network. It does not control this field's serialization, so a row authored as a formula continues to report its formula here even if the flag is later disabled.</td></tr></tbody></table>

## Custom Data

Affiliate campaigns may have Custom Data Fields applied to them, which will be applied to calls originating through the affiliate campaign. To apply Custom Data Values to an affiliate campaign, the top level parameter `custom_data` should be assigned a hash with each pair’s key corresponding to a partner name. The value of the pair should be the value to be applied.

For the following example, we would apply the value “Offline newspaper” to the Custom Data Field “channel”.

```json theme={null}
{
  "custom_data": {
    "channel": "Offline newspaper"
  }
}
```

Endpoint:

`https://invoca.net/api/2022-08-01/<network_id>/advertisers/<advertiser_id_from_network>/advertiser_campaigns/<advertiser_campaign_id_from_network>/affiliates/<affiliate_id_from_network>/affiliate_campaigns.json`

> [accordion] Get all Affiliate Campaigns
>
> #### Examples
>
> Get all Affiliate Campaigns
>
> Endpoint:
>
> `https://invoca.net/api/2022-08-01/<network_id>/advertisers/<advertiser_id_from_network>/advertiser_campaigns/<advertiser_campaign_id_from_network>/affiliate_campaigns.json`

> [accordion] Get an Affiliate Campaign
>
> #### Examples
>
> GET of Affiliate Campaign status for Advertiser 354 Campaign 12 to Affiliate 976
>
> Endpoint:
>
> `https://invoca.net/api/2022-08-01/<network_id>/advertisers/354/advertiser_campaigns/12/affiliates/976/affiliate_campaigns.json`
>
> Format: application/json
>
> Response Body:
>
> ```json theme={null}
> {
>   "max_promo_numbers": 10,
>   "current_terms": {
>     "advertiser_payin": {
>       "max": 3.5,
>       "min": 3.5,
>       "pricing": "$3.50 per call",
>       "currency": "USD",
>       "range": "$3.50 per call",
>       "policies": [
>         {
>           "amount": 3.5,
>           "currency": "USD",
>           "type": "Base",
>           "condition": ""
>         }
>       ]
>     },
>     "pricing_type": "Fixed",
>     "ivr_tree": {
>       "root": {
>         "children": [
>           {
>             "destination_country_code": "",
>             "destination_phone_number": "",
>             "node_type": "Connect",
>             "prompt": ""
>           },
>           {
>             "destination_country_code": "",
>             "destination_phone_number": "",
>             "node_type": "Connect",
>             "prompt": ""
>           }
>         ],
>         "node_type": "Menu",
>         "prompt": "Press one for transfer to a normal campaign (scottad pro 0903), press two for normal campaign (scott ad pro 3122), press three for transfer to a syndicated campaign!"
>       },
>       "record_calls": false
>     },
>     "affiliate_payout": {
>       "max": 3.5,
>       "min": 3.5,
>       "pricing": "$3.50 per call",
>       "currency": "USD",
>       "range": "$3.50 per call",
>       "policies": [
>         {
>           "amount": 3.5,
>           "currency": "USD",
>           "type": "Base",
>           "condition": ""
>         }
>       ]
>     }
>   },
>   "status": "Approved_NotActive",
>   "id": 1,
>   "id_from_network": "11",
>   "affiliate_id_from_network": "976",
>   "object_url": "https://invoca.net/p_campaigns/terms/19/11",
>   "custom_data": {
>     "channel": "Online lead"
>   }
> }
> ```
>
> A policy row can also be **formula-driven** instead of a fixed amount. Invoca computes its payout from a formula rather than a static number. Formula-driven rows require the Formula Payouts feature to be enabled for the network. When any row in a `policies` list is formula-driven, that list's `max` becomes `null` and `range` becomes `"Dynamic"`. The formula-driven row's own `amount` is `0`. This behavior applies at every API version, including the `2022-08-01` version shown above.
>
> The per-row `formula` key is only present at API version `2026-02-01` or later. To receive it, request the endpoint above with `2026-02-01` in place of `2022-08-01` (for example, `.../api/2026-02-01/...`). At earlier versions, `policies` rows never include a `formula` key. Invoca omits it entirely rather than returning `null`.
>
> Example: an `affiliate_payout` block at API version `2026-02-01`, with a formula-driven Bonus row
>
> ```json theme={null}
> {
>   "max": null,
>   "min": 3.5,
>   "pricing": "Base: $3.50 per call\nBonus: =invoca.duration * 0.05 if duration > 60",
>   "currency": "USD",
>   "range": "Dynamic",
>   "policies": [
>     {
>       "amount": 3.5,
>       "currency": "USD",
>       "type": "Base",
>       "condition": "",
>       "formula": null
>     },
>     {
>       "amount": 0,
>       "currency": "USD",
>       "type": "Bonus",
>       "condition": "duration > 60",
>       "formula": "=invoca.duration * 0.05"
>     }
>   ]
> }
> ```

> [accordion] Create an Affiliate Campaign
>
> #### Examples
>
> Create Affiliate Campaign with status for Advertiser 354 Campaign 12 to Affiliate 975
>
> Please note - The Network Integration API only provides the ability to create an affiliate campaign with status “Applied”. If the Advertiser Campaign is set to “Approve All”, the campaign will automatically transition to “Approved”.
>
> Endpoint:
>
> `https://invoca.net/api/2022-08-01/<network_id>/advertisers/354/advertiser_campaigns/12/affiliates/975/affiliate_campaigns.json`
>
> Format: application/json
>
> Request Body:
>
> ```json theme={null}
> {
>   "status": "Applied",
>   "id_from_network": "2234",
>   "custom_data": {
>     "channel": "Offline lead"
>   }
> }
> ```
>
> Response Body:
>
> Same as a GET response, includes all the affiliate campaign properties.
>
> ***
>
> Not Found - 404
>
> Endpoint:
>
> `https://invoca.net/api/api/2022-08-01/<network_id>/advertisers/354/advertiser_campaigns/13/affiliates/976/affiliate_campaigns.json`
>
> Format: application/json
>
> Request Body:
>
> ```json theme={null}
> {
>   "status": "Approved"
> }
> ```
>
> Response Code: 403
>
> Response Body:
>
> ```json theme={null}
> {
>   "errors": {
>     "status": [
>       "cannot transition from 'Approved'"
>     ]
>   },
>   "status": "Applied"
> }
> ```

> [accordion] Update an Affiliate Campaign
>
> #### Examples
>
> Update Affiliate Campaign status for Advertiser 354 Campaign 12 to Affiliate 976
>
> Endpoint:
>
> `https://invoca.net/api/2022-08-01/<network_id>/advertisers/354/advertiser_campaigns/12/affiliates/976/affiliate_campaigns.json`
>
> Format: application/json
>
> Request Body:
>
> ```json theme={null}
> {
>   "status": "Approved"
> }
> ```
>
> Response Body:
>
> Same as a GET response, includes all the affiliate campaign properties.

> [accordion] Delete an Affiliate Campaign
>
> #### Examples
>
> You are not allowed to delete an Affiliate Campaign.


## Related topics

- [Auto-Approve Affiliate to Campaigns](https://docs.invoca.com/developers/2026-02-01/api_documentation/network_integration/advertiser_affiliate_relationships/index.md)
- [How to Approve a Publisher to Your Affiliate Campaign](https://docs.invoca.com/s/article/approve-publisher-affiliate-campaign.md)
- [How Do I Pay Out Affiliates Based on the Region of the Caller?](https://docs.invoca.com/s/article/payout-affiliates-by-region.md)
- [Static Number Migration: Inter-Campaign Transfers](https://docs.invoca.com/s/article/static-number-migration-inter-campaign.md)
- [Calls In Progress API](https://docs.invoca.com/developers/2026-02-01/api_documentation/calls_in_progress_api/index.md)
