> ## Documentation Index
> Fetch the complete documentation index at: https://invoca-5bd45748-mintlify-8d5425ca.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Advertisers

> Create, read, update, and delete advertiser (merchant) records on your Invoca network, including contact and payout settings, via the Network Integration API.

The operations on Advertiser are similar to Network, in that the interface is fully idempotent, and the create and update commands both expect the full set of advertiser sites and users each time. You are not allowed to delete an advertiser if it has one or more campaigns.

## Advertiser Properties

| Property                                            | Type                                                                        | Description                                                                                                                                                                                                                                                                                                                              |
| --------------------------------------------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                                                  | integer (read-only)                                                         | The internal Invoca id for this Advertiser.                                                                                                                                                                                                                                                                                              |
| id\_from\_network                                   | string (required)                                                           | The network id for this Advertiser. Unique within network. Not required when auto-generation is enabled at network level.                                                                                                                                                                                                                |
| name                                                | string (required)                                                           | The name of the Advertiser. Unique within network.                                                                                                                                                                                                                                                                                       |
| oauth\_refresh\_token                               | string                                                                      | For internal use only.                                                                                                                                                                                                                                                                                                                   |
| approval\_status                                    | string (one of): Applied, Approved (default), Declined, Suspended, Archived | Approval status for this advertiser.                                                                                                                                                                                                                                                                                                     |
| web\_integration\_phone\_number                     | string                                                                      |                                                                                                                                                                                                                                                                                                                                          |
| default\_creative\_id\_from\_network                | integer                                                                     |                                                                                                                                                                                                                                                                                                                                          |
| object\_url                                         | string (read-only)                                                          | URL for reaching the advertiser in the UI.                                                                                                                                                                                                                                                                                               |
| **sites**                                           | json array of hashes                                                        | 1 or more pairs of id\_from\_network \[and name].                                                                                                                                                                                                                                                                                        |
| id\_from\_network                                   | integer site\_id (PID)                                                      | The site\_id (PID). At least one is required. The first becomes the default.                                                                                                                                                                                                                                                             |
| name                                                | string                                                                      | The site name that matches site\_id.                                                                                                                                                                                                                                                                                                     |
| **users**                                           | JSON array of hashes                                                        | 0 or more users for the organization. Each must have first 5 fields below.                                                                                                                                                                                                                                                               |
| id\_from\_network                                   | string                                                                      | The network id for this User.                                                                                                                                                                                                                                                                                                            |
| email\_settings                                     | JSON array of hashes                                                        | Each hash has two required fields: `email_address` (string in RFC 2822 addr-spec format, the user's email address, unique for this user) and `use_for_notifications` (boolean used to indicate if notifications should be sent to the email address). A user must have at least one email address where `use_for_notifications` is true. |
| first\_name                                         | string (Required)                                                           | The user's first name.                                                                                                                                                                                                                                                                                                                   |
| last\_name                                          | string (Required)                                                           | The user's last name.                                                                                                                                                                                                                                                                                                                    |
| contact\_phone\_number                              | string in ITU E.164 format or 10-digit US form (no punctuation)             | The user's phone number.                                                                                                                                                                                                                                                                                                                 |
| oauth\_refresh\_token                               | string                                                                      | Not used. Reserved.                                                                                                                                                                                                                                                                                                                      |
| role                                                | One of: Super (default), Manager, Member, Observer                          | This user's role in this organization. (A user may have different roles in different organizations)                                                                                                                                                                                                                                      |
| notify\_on\_budgets                                 | boolean, optional, defaults to false                                        |                                                                                                                                                                                                                                                                                                                                          |
| notify\_on\_campaign\_applications                  | boolean, optional, defaults to false                                        |                                                                                                                                                                                                                                                                                                                                          |
| notify\_on\_campaign\_expirations                   | boolean, optional, defaults to false                                        |                                                                                                                                                                                                                                                                                                                                          |
| notify\_on\_creative\_duplication\_requests         | boolean, optional, defaults to false                                        |                                                                                                                                                                                                                                                                                                                                          |
| notify\_on\_network\_announcements                  | boolean, optional, defaults to false                                        |                                                                                                                                                                                                                                                                                                                                          |
| notify\_on\_performance\_notifications              | Deprecated, always returns false                                            |                                                                                                                                                                                                                                                                                                                                          |
| notify\_on\_monthly\_campaign\_performance\_reports | Deprecated, always returns false                                            |                                                                                                                                                                                                                                                                                                                                          |
| notify\_on\_weekly\_campaign\_performance\_reports  | Deprecated, always returns false                                            |                                                                                                                                                                                                                                                                                                                                          |
| notify\_on\_call\_activities                        | boolean, optional, defaults to false                                        |                                                                                                                                                                                                                                                                                                                                          |
| can\_login\_via\_platform                           | boolean (read-only)                                                         | Indicates if user can directly login with username and password. If false, the user is managed via SSO.                                                                                                                                                                                                                                  |

### Custom Data

Advertisers may have Custom Data Fields applied to them, which will be applied to calls originating through the advertiser. To apply Custom Data Values to an advertiser, 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/@@NETWORK_API_VERSION/<network_id>/advertisers/<advertiser_id_from_network>.json`

***

## GET All Advertisers

Read all advertisers for this network.

**Endpoint:** `https://invoca.net/api/@@NETWORK_API_VERSION/<network_id>/advertisers.json`

**Format:** application/json

**Response Code:** 200

### Response Example

```json theme={null}
[
  {
    "id": 43838,
    "id_from_network": "cFUyYnFHy",
    "web_integration_phone_number": "8004377950",
    "approval_status": "Approved",
    "object_url": "https://invoca.net/as/43838/dashboards/ui",
    "sites": [
      {
        "id_from_network": "315",
        "name": "315.blog.com"
      }
    ],
    "name": "NFL Tickets Exchange",
    "users": [
      {
        "id_from_network": "549494858585cFUyYnFHyiYA42TrpM",
        "email_settings": [
          { "email_address": "chris@nfltix.com", "use_for_notifications": true }
        ],
        "first_name": "Chris",
        "phone_number": "888-603-3760",
        "last_name": "Dean",
        "role": "Manager",
        "oauth_refresh_token": "556588585858585858585858858",
        "notify_on_budgets": true,
        "notify_on_campaign_applications": false,
        "notify_on_campaign_expirations": false,
        "notify_on_creative_duplication_requests": true,
        "notify_on_network_announcements": true,
        "notify_on_performance_notifications": false,
        "notify_on_monthly_campaign_performance_reports": false,
        "notify_on_weekly_campaign_performance_reports": false,
        "notify_on_call_activities": true,
        "can_login_via_platform": true
      }
    ],
    "default_creative_id_from_network": "222",
    "oauth_refresh_token": "7464644784457575757494930303",
    "custom_data": {
      "channel": "Online lead"
    }
  }
]
```

***

## GET an Advertiser

Read a single advertiser.

**Endpoint:** `https://invoca.net/api/@@NETWORK_API_VERSION/<network_id>/advertisers/cFUyYnFHy.json`

**Format:** application/json

**Response Code:** 200

### Response Example

```json theme={null}
{
  "id": 43838,
  "id_from_network": "cFUyYnFHy",
  "web_integration_phone_number": "8004377950",
  "approval_status": "Approved",
  "object_url": "https://invoca.net/as/43838/dashboards/ui",
  "sites": [
    {
      "id_from_network": "315",
      "name": "315.blog.com"
    },
    {
      "id_from_network": "996",
      "name": "996.blog.com"
    }
  ],
  "name": "NFL Tickets Exchange",
  "users": [
    {
      "id_from_network": "549494858585cFUyYnFHyiYA42TrpM",
      "email_settings": [
        { "email_address": "chris@nfltix.com", "use_for_notifications": true }
      ],
      "first_name": "Chris",
      "phone_number": "888-603-3760",
      "last_name": "Dean",
      "role": "Manager",
      "oauth_refresh_token": "556588585858585858585858858",
      "notify_on_budgets": true,
      "notify_on_campaign_applications": false,
      "notify_on_campaign_expirations": false,
      "notify_on_creative_duplication_requests": true,
      "notify_on_network_announcements": true,
      "notify_on_performance_notifications": false,
      "notify_on_monthly_campaign_performance_reports": false,
      "notify_on_weekly_campaign_performance_reports": false,
      "notify_on_call_activities": true,
      "can_login_via_platform": false
    },
    {
      "id_from_network": "694940505055cFUyYnFHyiYA42TrpM",
      "email_settings": [
        { "email_address": "jim@nfltix.com", "use_for_notifications": true }
      ],
      "first_name": "Jim",
      "phone_number": "888-603-3760",
      "last_name": "Williams",
      "role": "Observer",
      "oauth_refresh_token": "4222424241628298228222",
      "notify_on_budgets": true,
      "notify_on_campaign_applications": false,
      "notify_on_campaign_expirations": false,
      "notify_on_creative_duplication_requests": true,
      "notify_on_network_announcements": true,
      "notify_on_performance_notifications": false,
      "notify_on_monthly_campaign_performance_reports": false,
      "notify_on_weekly_campaign_performance_reports": false,
      "notify_on_call_activities": true,
      "can_login_via_platform": true
    }
  ],
  "default_creative_id_from_network": "222",
  "oauth_refresh_token": "7464644784457575757494930303",
  "custom_data": {
    "channel": "Online lead"
  }
}
```

***

## POST Create an Advertiser

Create an advertiser with users.

**Endpoint:** `https://invoca.net/api/@@NETWORK_API_VERSION/<network_id>/advertisers.json`

**Format:** application/json

### Request Example

```json theme={null}
{
  "name": "NFL Tickets Exchange",
  "id_from_network": "cFUyYnFHy",
  "oauth_refresh_token": "7464644784457575757494930303",
  "approval_status": "Approved",
  "web_integration_phone_number": "8004377950",
  "default_creative_id_from_network": "222",
  "users": [
    {
      "id_from_network": "549494858585cFUyYnFHyiYA42TrpM",
      "email_settings": [
        { "email_address": "chris@nfltix.com", "use_for_notifications": true }
      ],
      "first_name": "Chris",
      "last_name": "Dean",
      "contact_phone_number": "805-555-5555",
      "oauth_refresh_token": "556588585858585858585858858",
      "role": "Manager",
      "notify_on_budgets": true,
      "notify_on_campaign_applications": false,
      "notify_on_campaign_expirations": false,
      "notify_on_creative_duplication_requests": true,
      "notify_on_network_announcements": true,
      "notify_on_call_activities": true
    },
    {
      "id_from_network": "694940505055cFUyYnFHyiYA42TrpM",
      "email_settings": [
        { "email_address": "jim@nfltix.com", "use_for_notifications": true }
      ],
      "first_name": "Jim",
      "last_name": "Williams",
      "contact_phone_number": "2135555555",
      "oauth_refresh_token": "4222424241628298228222",
      "role": "Observer",
      "notify_on_budgets": true,
      "notify_on_campaign_applications": false,
      "notify_on_campaign_expirations": false,
      "notify_on_creative_duplication_requests": true,
      "notify_on_network_announcements": true,
      "notify_on_call_activities": true
    }
  ],
  "sites": [
    {
      "id_from_network": "315",
      "name": "315.blog.com"
    },
    {
      "id_from_network": "996",
      "name": "996.blog.com"
    }
  ],
  "custom_data": {
    "channel": "Offline lead"
  }
}
```

### Response Example

Same as a GET response, includes all the advertiser properties.

***

## PUT Update an Advertiser

Update a user from advertiser.

**Endpoint:** `https://invoca.net/api/@@NETWORK_API_VERSION/<network_id>/advertisers/cFUyYnFHy.json`

**Format:** application/json

### Request Example

```json theme={null}
{
  "name": "NFL Tickets Exchange",
  "oauth_refresh_token": "7464644784457575757494930303",
  "approval_status": "Approved",
  "web_integration_phone_number": "8004377950",
  "default_creative_id_from_network": "222",
  "users": [
    {
      "id_from_network": "549494858585cFUyYnFHyiYA42TrpM",
      "email_settings": [
        { "email_address": "chris@nfltix.com", "use_for_notifications": true }
      ],
      "first_name": "Chris",
      "last_name": "Dean",
      "contact_phone_number": "805-555-5555",
      "oauth_refresh_token": "556588585858585858585858858",
      "role": "Manager",
      "notify_on_budgets": true,
      "notify_on_campaign_applications": false,
      "notify_on_campaign_expirations": false,
      "notify_on_creative_duplication_requests": true,
      "notify_on_network_announcements": true,
      "notify_on_call_activities": true
    }
  ],
  "sites": [
    {
      "id_from_network": "315",
      "name": "315.blog.com"
    }
  ],
  "custom_data": {
    "channel": "Offline lead"
  }
}
```

### Response Example

Same as a GET response, includes all the advertiser properties.

***

## DELETE an Advertiser

Delete a single advertiser.

<Note>You are not allowed to delete an advertiser if it has one or more campaigns.</Note>

**Endpoint:** `https://invoca.net/api/@@NETWORK_API_VERSION/<network_id>/advertisers/cFUyYnFHy.json`

**Format:** application/json

**Response Code:** 200

### Response Example

```json theme={null}
{}
```
