API documentation  GET | PUT /offers/{id}/cap

Get or update the budget and capping of the given offer.

GET https://demo.trafficmanager.com/api/v1/offers/{id}/cap
PUT https://demo.trafficmanager.com/api/v1/offers/{id}/cap

Authentication:

The request must be authenticated with the following HTTP headers:
  • x-api-key: Your API key, found on the Security page
  • x-user-id: Your User ID, found on the Security page
If the HTTP headers are not passed, but you are logged in to the TrafficManager panel, the current user is used instead (so you can easily preview or download the data using your browser)

GET Parameters:

  • Required:
  • id: offer ID

Returned values:

The response is a JSON object that can contain the following fields.
Each field will be present only if the offer has a cap for that parameter.
  • spentToday: total payout for today, only if the offer has a dailyBudget set
  • spentTotal: total payout for the offer, only if the offer has a totalBudget set
  • convToday: total conversions for today, only if the offer has a dailyCap set
  • convTotal: total conversions for the offer, only if the offer has a totalCap set
  • convUserToday: total conversions for today for the current user, if the offer has a capMode set to conversions.
    If the offer has a cap mode set to payout, this is the payout paid today today to the current user.
    If the offer has a cap mode set to cost, this is the amount spent today by the advertiser today for the current user.
  • settings: object with the following fields:
    • capMode: cap mode (can be conversions, payout or cost)
    • cap:
      • if capMode is conversions, this is the maximum number of daily conversions allowed for the current user
      • if capMode is payout, this is the maximum daily payout allowed for the current user
      • if capMode is cost, this is the maximum daily amount spent allowed for the current user
    • dailyCap: maximum number of daily conversions allowed for the offer, across all affiliates
    • totalCap: maximum number of conversions allowed for the offer, across all affiliates
    • dailyBudget: maximum daily budget allowed for the offer, across all affiliates
    • totalBudget: maximum total budget allowed for the offer, across all affiliates

Request example

GET https://demo.trafficmanager.com/api/v1/offers/35/cap

Response example

This is the equivalent of the following information in the offer page:
Daily budget (All network) 100.00 € Payout today: 32.00 €
Total budget (All network) 500.00 € Total payout: 128.00 €
Daily cap (All network) 10 conv. Conversions today: 7
Total cap (All network) 100 conv. Total conversions: 15
Daily cap per user 2 Conversions / day Conversions today: 1
{
  "status": 200,
  "data": {
    "spentToday": "32.00",
    "spentTotal": "128.00",
    "convToday": "7",
    "convTotal": "15",
    "convUserToday": "1.000000",
    "settings": {
      "capMode": "conversions",
      "cap": 2,
      "dailyCap": 10,
      "totalCap": 100,
      "dailyBudget": 100,
      "totalBudget": 500
    }
  }
}
    

Updating the caps (PUT)

The PUT method updates the network-wide limits. It is available only for admin and advertiser accounts allowed to edit the offer. Only the fields present in the request body are updated; sending null (or 0) removes that limit, like leaving the field empty in the offer edit page. The per-affiliate cap (capMode/cap) is read-only for now. The limits of an offer synchronized from another platform are controlled by the source platform and cannot be changed while the auto-sync is active (pause the auto-sync first).

Body Parameters (all optional, JSON):

  • dailyBudget: maximum daily budget for the offer, across all affiliates
  • totalBudget: maximum total budget for the offer, across all affiliates
  • dailyCap: maximum number of daily conversions for the offer, across all affiliates (integer)
  • totalCap: maximum number of conversions for the offer, across all affiliates (integer)

Note: reaching a limit changes the offer status automatically, but raising a limit does not reactivate the offer by itself: reactivate it with PUT /api/v1/offers/{id} and {"status": 1}.

Request example

curl --location --request PUT 'https://demo.trafficmanager.com/api/v1/offers/35/cap' \
    --header 'X-User-ID: __USER_UUID__' \
    --header 'X-Api-Key: __API_KEY__' \
    --header 'Content-Type: application/json' \
    --data '{
        "dailyBudget": 150,
        "totalCap": null
    }'

The success response contains the same data object returned by the GET method, updated with the new limits.

Error codes:

  • 404: Offer not found
  • 403: User does not have access to the offer
  • 400: Invalid PUT body parameters