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

# Migrating from the legacy API

> How to move an integration from partner.onlytraffic.com (including the ?do= format) to the Marketer API v2 on partners.onlytraffic.com: new URLs, authentication and field mapping.

The Marketer API has moved to a new host. The legacy API on `partner.onlytraffic.com` will be switched off, including the old `?do=` request format. Requests to the old host will not be redirected: integrations have to be updated.

| | Legacy | New |
| - | - | - |
| Host | `https://partner.onlytraffic.com` | `https://partners.onlytraffic.com` |
| Format | `/api/marketer?do=campaigns` or `/api/marketer/...` | `/api/marketer/...` only |

<Warning>Don't rely on HTTP redirects from the old host. Most HTTP clients turn a redirected `POST` into a `GET` without a body and drop the `Authorization` header when the host changes, so a redirected request loses your parameters and your key.</Warning>

## What to change

<Steps>
  <Step title="Switch the host">
    If you already call `/api/marketer/...` paths, only the host changes: `partner.onlytraffic.com` → `partners.onlytraffic.com`. The paths, parameters and responses are the same. Use `/api/marketer/cpl/campaigns` instead of the old `/api/marketer/cpl/orders`.

    If you use `?do=...`, see the [mapping below](#legacy-do-format): the endpoints and the response fields have changed.
  </Step>

  <Step title="Send the key in the header">
    Create a new key in **Tools -> API** ([partners.onlytraffic.com/tools/api](https://partners.onlytraffic.com/tools/api)) and send it in the `Authorization` header (raw or `Bearer`). Use a **Read-only** key if your integration only reads data.

    Your old key (`XXXXX-XXXXX-XXXXX-XXXXX`) keeps working on the new host until you delete it, but we recommend moving to a new key. See [Authentication](/docs/partners/api/authentication).
  </Step>

  <Step title="Update parameters and response parsing">
    Only needed for the `?do=` format. Follow the per-endpoint tables below.
  </Step>
</Steps>

## Legacy `?do=` format

### Endpoints

| Legacy (`?do=`) | New endpoint |
| - | - |
| `campaigns` | [`GET /api/marketer/revshare/campaigns`](/docs/partners/api/campaigns) for RevShare campaigns, [`GET /api/marketer/cpl/campaigns`](/docs/partners/api/cpl-campaigns) for CPL campaigns |
| `transactions` | [`GET /api/marketer/revshare/transactions`](/docs/partners/api/transactions) |
| `subscribers` | [`GET /api/marketer/subscribers`](/docs/partners/api/referred-subscribers) |
| `cpc_orders`, `ppc_orders` | [`GET /api/marketer/cpc/orders`](/docs/partners/api/cpc-orders) |
| `cpl_orders` | [`GET /api/marketer/cpl/campaigns`](/docs/partners/api/cpl-campaigns) |

### Common changes

* **Methods.** Read endpoints accept both `GET` (parameters in the query string) and `POST` (JSON or form body), so you can keep sending a JSON body.
* **Pagination.** `limit` now defaults to `50` and accepts `1`–`1000` (was `10` and `10`–`1000`). Pass `limit` explicitly if you rely on the page size.
* **Model filter.** `onlyfans_id` is now `of_account_id`, both as a parameter and in responses.
* **Identifiers.** Objects are identified by public string ids (`revc_…`, `cplo_…` and so on) instead of numeric internal ids. Write endpoints accept only public ids.
* **Dates.** Every date has two fields: an ISO 8601 string (`created_at`) and a Unix timestamp (`created_at_ts`). The legacy integer fields (`date_create`, `date_add`, ...) are gone.
* **Response envelope and error codes** are unchanged: `status`, `data`, `error_code`, `message`.

### Campaigns

Legacy `campaigns` returned RevShare and CPL campaigns in one list, split by `commission_type`. They are now separate endpoints: RevShare in `/revshare/campaigns`, CPL in `/cpl/campaigns`. The `offer_id` filter applies to `/cpl/campaigns`.

**RevShare** (`/api/marketer/revshare/campaigns`):

| Legacy field | New field |
| - | - |
| `id` (int) | removed, use `campaign_id` |
| `public_id` | `campaign_id` |
| `onlyfans_id` | `of_account_id` |
| `onlyfans_url` | `of_username` |
| `commission_type` | removed (always RevShare here) |
| `commission_data.income` | `income` |
| `commission_data.income_today` | `income_today` |
| `commission_data.revenue` | `revenue` |
| `date_create` | `created_at` / `created_at_ts` |
| `date_finish` | `finished_at` / `finished_at_ts` |
| `date_update` | `changed_at` / `changed_at_ts` |
| `name`, `url`, `visits`, `subscribers`, `subscribers_today`, `tags`, `onlyfans_account` | unchanged |
| — | new: `status` (`active` / `completed`), `revshare_percent` |

Campaign `type` values were renamed:

| Legacy | New |
| - | - |
| `by_date` | `date` |
| `by_link` | `link` |
| `free_trial` | `trial` |
| `smart_link` | `smartlink` |
| `ot_tracking_ftl` | `smartlink_trial` |
| `ot_tracking_trial` | `smartlink_tracking` |
| `limited_link` | `shared_link` |
| `limited_free_trial` | `shared_trial` |

The `status` parameter (`active` / `completed`) is new; without it, only active campaigns are returned, as before.

**CPL** (`/api/marketer/cpl/campaigns`):

| Legacy field (`commission_type: cpl`) | New field |
| - | - |
| `commission_data.order_public_id` | `order_id` |
| `commission_data.order_id` (int) | removed, use `order_id` |
| `commission_data.offer_id` | `offer_id` |
| `commission_data.quantity` | `quantity_ordered` |
| `commission_data.price` | `price_per_subscriber` |
| `commission_data.autorenewal_enabled` | `auto_renewal.enabled` |
| `onlyfans_id` | `of_account_id` |
| `onlyfans_url` | `of_username` |

See [CPL Campaigns](/docs/partners/api/cpl-campaigns) for the full object, including delivery progress and earnings.

### Transactions

| Legacy field | New field |
| - | - |
| `id` (int, internal) | `of_transaction_id` (string, the OnlyFans transaction id) |
| `campaign_id` (int) | removed, use `campaign_id` |
| `campaign_public_id` | `campaign_id` |
| `subscriber_id` | `of_user_id` |
| `onlyfans_id` | `of_account_id` |
| `is_undo` | `is_refunded`, plus `status` (`processed` / `refunded`) and `refunded_at` / `refunded_at_ts` |
| `date` (int) | `date` (ISO string) / `date_ts` |
| `type`, `amount`, `revenue` | unchanged |
| — | new: `of_user_name` |

New filters: `of_account_id`, `campaign_id`, `from`, `to`, `status`.

### Subscribers

| Legacy field | New field |
| - | - |
| `id` | `of_user_id` |
| `campaign_id` (int) | removed |
| `campaign_public_id` | `campaign.public_id` (for CPL subscribers it is the CPL campaign id, `cplo_…`) |
| — | `campaign.type` (`revshare` / `cpl`) |
| `onlyfans_id` | `of_account_id` |
| `url` | removed, the profile is `https://onlyfans.com/u{of_user_id}` |
| `revenue` | `amount_spent` |
| `date_subscribe` | `subscribed_at` / `subscribed_at_ts` |
| `name` | unchanged |
| — | new: `badges` |

Sorting: the `sort` + `order` pair is replaced by one `sort` parameter: `subscribed_at_desc` (default) or `subscribed_at_asc`. Sorting by `revenue` is no longer available. New filters: `of_account_id`, `campaign_id`, `campaign_type`, `from`, `to`.

### CPC orders

| Legacy field | New field |
| - | - |
| `id` (int) | removed, use `order_id` |
| `public_id` | `order_id` |
| `model` | `creative` |
| `model.onlyfans_id` | `creative.of_account_id` (also `of_account_id` on the order) |
| `model.likes` | removed |
| `campaign.url` | `url` |
| `campaign.clicks_ordered` | `clicks.ordered` |
| `campaign.clicks_delivered` | `clicks.delivered` |
| `campaign.price_per_click` | `price_per_click` |
| `campaign.date_start` | `date_start` |
| `campaign.date_finish` | `date_finish` |
| `date_add` | `created_at` / `created_at_ts` |
| — | new: `status`, `total_earned` |

Without a `status` filter, only active orders are returned, as before. New filters: `status` (`waiting` / `active` / `rejected` / `completed`) and `creative_public_id`.

## Example

<CodeGroup>
  ```bash Legacy theme={null}
  curl -X POST "https://partner.onlytraffic.com/api/marketer?do=cpc_orders" \
    -H "Authorization: XXXXX-XXXXX-XXXXX-XXXXX" \
    -H "Content-Type: application/json" \
    -d '{"offset": 0, "limit": 100}'
  ```

  ```bash New theme={null}
  curl "https://partners.onlytraffic.com/api/marketer/cpc/orders?offset=0&limit=100" \
    -H "Authorization: ot_partners_your-new-key"
  ```
</CodeGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.