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 pagex-user-id: Your User ID, found on the Security page
GET Parameters:
- Required:
id: offer ID
Returned values:
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 adailyBudgetsetspentTotal: total payout for the offer, only if the offer has atotalBudgetsetconvToday: total conversions for today, only if the offer has adailyCapsetconvTotal: total conversions for the offer, only if the offer has atotalCapsetconvUserToday: total conversions for today for the current user, if the offer has acapModeset toconversions.
If the offer has a cap mode set topayout, this is the payout paid today today to the current user.
If the offer has a cap mode set tocost, this is the amount spent today by the advertiser today for the current user.settings: object with the following fields:capMode: cap mode (can beconversions,payoutorcost)cap:- if
capModeisconversions, this is the maximum number of daily conversions allowed for the current user - if
capModeispayout, this is the maximum daily payout allowed for the current user - if
capModeiscost, this is the maximum daily amount spent allowed for the current user
- if
dailyCap: maximum number of daily conversions allowed for the offer, across all affiliatestotalCap: maximum number of conversions allowed for the offer, across all affiliatesdailyBudget: maximum daily budget allowed for the offer, across all affiliatestotalBudget: maximum total budget allowed for the offer, across all affiliates
Request example
GET https://demo.trafficmanager.com/api/v1/offers/35/cap
Response example
| 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 affiliatestotalBudget: maximum total budget for the offer, across all affiliatesdailyCap: 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 found403: User does not have access to the offer400: Invalid PUT body parameters
English
العربية
Dansk
Deutsch
Español
Suomi
Italiano
한국어
Português
Українська
Русский
Svenska
中文