API documentation  GET /offers/{id}/cap

Get information about the budget and capping for the given offer.

GET 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 in the Security page
  • x-user-id: Your User ID, found in 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
    }
  }
}
    

Error codes:

  • 404: Offer not found
  • 403: User does not have access to the offer