All URIs are relative to https://api.criteo.com/marketing
Method | HTTP request | Description |
---|---|---|
createBudgets | POST /v1/sellers/budgets | Creates a budget for a seller/list of sellers. |
get | GET /v1/sellers | Gets sellers details. |
getCampaigns | GET /v1/sellers/campaigns | Gets campaigns |
getStats | POST /v1/sellers/stats | Generates a statistics report |
updateBids | PUT /v1/sellers/bids | Set or update a bid for a seller/list of sellers. |
updateBudgets | PUT /v1/sellers/budgets | Updates a budget for a seller/list of sellers. |
SellerBudgetsMessage createBudgets(authorization, sellerBudgets)
Creates a budget for a seller/list of sellers.
<b>Seller name</b>: can be retrieved from the /sellers/ endpoint. This value is case insensitive.<br /><b>Amount</b>: in your currency. Set it to "null" or leave empty to create an uncapped budget (with no limit).<br /><h4>Response</h4><p> The budget's start date will be set to:<br /> • today: in case no budget is currently set for this seller<br /> • tomorrow: in case your seller already has a budget running, ending at midnight. Note that start dates are UTC+00:00 based.<br /> The budget will remain active until being completely consumed or stopped.<br /></p><h4>Validation rules</h4><p> Budgets cannot <b>overlap</b> with each other for a specific seller.<br /></p><h4>Functional cases</h4><p> When a seller's budget is totally consumed, display delivery will automatically stop for this specific seller.<br /> If budget needs to be updated, by: adding fund, reducing a budget amount or stopping it, refer to the “update budget” endpoint.<br /></p>
// Import classes:
import com.criteo.marketing.ApiClient;
import com.criteo.marketing.ApiException;
import com.criteo.marketing.Configuration;
import com.criteo.marketing.auth.*;
import com.criteo.marketing.models.*;
import com.criteo.marketing.api.SellersApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.criteo.com/marketing");
// Configure API key authorization: Authorization
ApiKeyAuth Authorization = (ApiKeyAuth) defaultClient.getAuthentication("Authorization");
Authorization.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Authorization.setApiKeyPrefix("Token");
SellersApi apiInstance = new SellersApi(defaultClient);
String authorization = "\"Bearer VALID_JWT_TOKEN_BASE64\""; // String | JWT Bearer Token
SellerBudgetsCreateMessage sellerBudgets = new SellerBudgetsCreateMessage(); // SellerBudgetsCreateMessage |
try {
SellerBudgetsMessage result = apiInstance.createBudgets(authorization, sellerBudgets);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SellersApi#createBudgets");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
authorization | String | JWT Bearer Token | [default to "Bearer VALID_JWT_TOKEN_BASE64"] |
sellerBudgets | SellerBudgetsCreateMessage |
- Content-Type: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded, text/html
- Accept: application/json, text/json, application/xml, text/xml, text/html
Status code | Description | Response headers |
---|---|---|
200 | Seller budgets created successfully. | - |
400 | Bad request, invalid syntax or validation error (the whole batch will be dropped, no budget will be created). Response message will be different based on error. | - |
401 | Authentication failed. | - |
403 | The requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data. | - |
404 | One of the requested sellers is unknown. The whole batch will be dropped, no budget will be created. | - |
405 | Requested campaign isn't a Criteo Reseller Program one. | - |
429 | Throttling failure. Maximum sending rate exceeded. | - |
500 | Unknown error. | - |
List<SellerMessage> get(authorization, campaignIds, onlyActiveSellers, onlySellersWithProductsInCatalog, onlyActiveBudgets)
Gets sellers details.
Returns a list of sellers with all their details.<br /> By default, this list will contain all active sellers that have been on-boarded onto the Criteo Reseller Program.<br /> Note that (in the situation where you would have multiple Criteo Reseller Program campaigns running at the same time) campaign filter can be applied to restrict the response to one or multiple campaign ids.<br /><h4>Functional cases</h4><p> Only currently running and future seller budgets will be retrieved. Past sellers' budgets can be retrieved from the statistics endpoint.<br /> Seller's status has 2 possible values - Active or Inactive - which corresponds to:<br /> • <b>Active</b>: Seller in a running campaign, with a bid (CPC) and a budget > 0<br /> • <b>Inactive</b>: Seller with a budget consumed or that you explicitly stopped.<br /></p>
// Import classes:
import com.criteo.marketing.ApiClient;
import com.criteo.marketing.ApiException;
import com.criteo.marketing.Configuration;
import com.criteo.marketing.auth.*;
import com.criteo.marketing.models.*;
import com.criteo.marketing.api.SellersApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.criteo.com/marketing");
// Configure API key authorization: Authorization
ApiKeyAuth Authorization = (ApiKeyAuth) defaultClient.getAuthentication("Authorization");
Authorization.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Authorization.setApiKeyPrefix("Token");
SellersApi apiInstance = new SellersApi(defaultClient);
String authorization = "\"Bearer VALID_JWT_TOKEN_BASE64\""; // String | JWT Bearer Token
String campaignIds = "campaignIds_example"; // String | Optional. One or more campaign ids, E.g., 78, 12932, 45236. If any of the requested campaign ids are not Criteo Reseller Program or are not liked to advertisers in the user's portfolio, the call will fail.
Boolean onlyActiveSellers = true; // Boolean | Optional. Filters by seller status, allowing to only display active sellers or not. Default value is false.
Boolean onlySellersWithProductsInCatalog = true; // Boolean | Optional. Only return sellers that have currently products in the catalog. Default value is false.
Boolean onlyActiveBudgets = true; // Boolean | Optional. Will return only active budget for each seller. Default value is false
try {
List<SellerMessage> result = apiInstance.get(authorization, campaignIds, onlyActiveSellers, onlySellersWithProductsInCatalog, onlyActiveBudgets);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SellersApi#get");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
authorization | String | JWT Bearer Token | [default to "Bearer VALID_JWT_TOKEN_BASE64"] |
campaignIds | String | Optional. One or more campaign ids, E.g., 78, 12932, 45236. If any of the requested campaign ids are not Criteo Reseller Program or are not liked to advertisers in the user's portfolio, the call will fail. | [optional] |
onlyActiveSellers | Boolean | Optional. Filters by seller status, allowing to only display active sellers or not. Default value is false. | [optional] |
onlySellersWithProductsInCatalog | Boolean | Optional. Only return sellers that have currently products in the catalog. Default value is false. | [optional] |
onlyActiveBudgets | Boolean | Optional. Will return only active budget for each seller. Default value is false | [optional] |
- Content-Type: Not defined
- Accept: application/json, text/json, application/xml, text/xml, text/html
Status code | Description | Response headers |
---|---|---|
200 | List of sellers successfully fetched. | - |
400 | Bad request, invalid syntax. | - |
401 | Authentication failed. | - |
403 | One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data. | - |
405 | One of the requested campaigns isn't a Criteo Reseller Program one. | - |
429 | Throttling failure. Maximum sending rate exceeded. | - |
500 | Unknown error. | - |
List<MarketplaceCampaignMessage> getCampaigns(authorization, campaignIds, advertiserIds, status)
Gets campaigns
Get the list of campaigns with the specified filters. If a campaign is requested but is missing from current user's portfolio, it will not be included in the list. If neither campaign ids nor advertisers ids are provided, then the user's portfolio will be used.
// Import classes:
import com.criteo.marketing.ApiClient;
import com.criteo.marketing.ApiException;
import com.criteo.marketing.Configuration;
import com.criteo.marketing.auth.*;
import com.criteo.marketing.models.*;
import com.criteo.marketing.api.SellersApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.criteo.com/marketing");
// Configure API key authorization: Authorization
ApiKeyAuth Authorization = (ApiKeyAuth) defaultClient.getAuthentication("Authorization");
Authorization.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Authorization.setApiKeyPrefix("Token");
SellersApi apiInstance = new SellersApi(defaultClient);
String authorization = "\"Bearer VALID_JWT_TOKEN_BASE64\""; // String | JWT Bearer Token
String campaignIds = "campaignIds_example"; // String | Optional. One or more campaign ids, E.g. 78, 12932, 45236. If any of the requested campaign ids are not Criteo Reseller Program or are not liked to advertisers in the user's portfolio, the call will fail.
String advertiserIds = "advertiserIds_example"; // String | Optional. One or more advertiser ids, E.g. 78, 12932, 45236. If the requested advertiser ids are not part of the user's portfolio, the call will fail.
String status = "status_example"; // String | Optional. Status of the campaign. By default, all campaigns are returned, regardless of their status.
try {
List<MarketplaceCampaignMessage> result = apiInstance.getCampaigns(authorization, campaignIds, advertiserIds, status);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SellersApi#getCampaigns");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
authorization | String | JWT Bearer Token | [default to "Bearer VALID_JWT_TOKEN_BASE64"] |
campaignIds | String | Optional. One or more campaign ids, E.g. 78, 12932, 45236. If any of the requested campaign ids are not Criteo Reseller Program or are not liked to advertisers in the user's portfolio, the call will fail. | [optional] |
advertiserIds | String | Optional. One or more advertiser ids, E.g. 78, 12932, 45236. If the requested advertiser ids are not part of the user's portfolio, the call will fail. | [optional] |
status | String | Optional. Status of the campaign. By default, all campaigns are returned, regardless of their status. | [optional] [enum: Running, Archived, NotRunning] |
List<MarketplaceCampaignMessage>
- Content-Type: Not defined
- Accept: application/json, text/json, application/xml, text/xml, text/html
Status code | Description | Response headers |
---|---|---|
200 | Sellers campaigns returned OK. | - |
400 | API user's portfolio is empty and no campaignId/advertiserId is provided. | - |
401 | Authentication failed. | - |
403 | One of the requested campaigns doesn't belong to the API user's portfolio which prevents from accessing its data. | - |
405 | One of the requested campaigns isn't a Criteo Reseller Program one. | - |
429 | Throttling failure. Maximum sending rate exceeded. | - |
500 | Unknown error. | - |
getStats(authorization, statsQuery)
Generates a statistics report
<b>AdvertiserIds</b>: Optional. The list of advertiser ids, comma-separated. Advertisers not in your portfolio will be skipped. If not present, all the advertisers in the portfolio will be used.<br /><b>StartDate, EndDate</b>: Start date (beginning of day) and end date (end of day) to be used for the report generation. Format to use: yyyy-MM-dd (e.g. 2017-10-30).<br /><b>Dimensions</b>: The dimensions to be used in the report. Between one and three. Possible values: CampaignId, AdvertiserId, Seller, Day, Week, Month, Year.<br /><b>Metrics</b>: The metrics to be used in the report. Possible values: Clicks, AdvertiserCost, Displays.<br /><b>Format</b>: The file format of the generated report. Possible values: Csv, Excel, Xml, Json.<br /><b>Currency</b>: Optional. The currency to be used in the report. Three-letter capitals. For a list of possible values, please see the full documentation. If not set, the user's preference setting will be used.<br /><b>Timezone</b>: Optional. Timezone to be used in the report. Possible values: GMT, PST, JST. If not set, the user's preference setting will be used.<br /><h4>Validation rules</h4> StartDate and EndDate are mandatory.<br /> StartDate should come before, or be equal to EndDate.<br /> The requested dimensions must be in a supported combination.<br /> At least one metric must be provided.<br /> All metrics must be supported.<br /> The selected advertisers must have at least one campaign.<br /> Seller dimension is mandatory.<br />
// Import classes:
import com.criteo.marketing.ApiClient;
import com.criteo.marketing.ApiException;
import com.criteo.marketing.Configuration;
import com.criteo.marketing.auth.*;
import com.criteo.marketing.models.*;
import com.criteo.marketing.api.SellersApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.criteo.com/marketing");
// Configure API key authorization: Authorization
ApiKeyAuth Authorization = (ApiKeyAuth) defaultClient.getAuthentication("Authorization");
Authorization.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Authorization.setApiKeyPrefix("Token");
SellersApi apiInstance = new SellersApi(defaultClient);
String authorization = "\"Bearer VALID_JWT_TOKEN_BASE64\""; // String | JWT Bearer Token
StatsQueryMessage statsQuery = new StatsQueryMessage(); // StatsQueryMessage | The report query details
try {
apiInstance.getStats(authorization, statsQuery);
} catch (ApiException e) {
System.err.println("Exception when calling SellersApi#getStats");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
authorization | String | JWT Bearer Token | [default to "Bearer VALID_JWT_TOKEN_BASE64"] |
statsQuery | StatsQueryMessage | The report query details |
null (empty response body)
- Content-Type: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded, text/html
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
200 | Statistics report generated OK. | - |
400 | Bad request, invalid syntax or validation error. | - |
401 | Authentication failed. | - |
429 | Throttling failure. Maximum sending rate exceeded. | - |
500 | Unknown error. | - |
SellerBidsMessage updateBids(authorization, sellerBids)
Set or update a bid for a seller/list of sellers.
<b>Seller name</b>: can be retrieved from the /sellers/ endpoint. This value is case insensitive. <h4>Functional cases</h4><p> In case one of the bid values cannot be updated, the whole batch will be dropped.<br /></p>
// Import classes:
import com.criteo.marketing.ApiClient;
import com.criteo.marketing.ApiException;
import com.criteo.marketing.Configuration;
import com.criteo.marketing.auth.*;
import com.criteo.marketing.models.*;
import com.criteo.marketing.api.SellersApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.criteo.com/marketing");
// Configure API key authorization: Authorization
ApiKeyAuth Authorization = (ApiKeyAuth) defaultClient.getAuthentication("Authorization");
Authorization.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Authorization.setApiKeyPrefix("Token");
SellersApi apiInstance = new SellersApi(defaultClient);
String authorization = "\"Bearer VALID_JWT_TOKEN_BASE64\""; // String | JWT Bearer Token
SellerBidsMessage sellerBids = new SellerBidsMessage(); // SellerBidsMessage |
try {
SellerBidsMessage result = apiInstance.updateBids(authorization, sellerBids);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SellersApi#updateBids");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
authorization | String | JWT Bearer Token | [default to "Bearer VALID_JWT_TOKEN_BASE64"] |
sellerBids | SellerBidsMessage |
- Content-Type: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded, text/html
- Accept: application/json, text/json, application/xml, text/xml, text/html
Status code | Description | Response headers |
---|---|---|
200 | Sellers bids successfully updated. | - |
400 | Bad request, invalid syntax or validation error (the whole batch will be dropped, no bid will be updated). Response message will be different based on error. | - |
401 | Authentication failed. | - |
403 | The requested campaign doesn't belong to the API user's portfolio which prevents from accessing its data. | - |
404 | One of the requested sellers is unknown which prevents from updating bids. To get the list of sellers and their IDs you can use the /sellers endpoint. | - |
405 | Requested campaign isn't a Criteo Reseller Program one. | - |
429 | Throttling failure. Maximum sending rate exceeded. | - |
500 | Unknown error. | - |
SellerBudgetsMessage updateBudgets(authorization, sellerBudgets)
Updates a budget for a seller/list of sellers.
<b>Amount</b>: Optional. Uses the advertiser's currency. Set it to "null" or leave empty to create an uncapped budget (with no limit).<br /><b>Status</b>: Optional. Budget's status, possible values are: ["Inactive","Active"]. If set to null or undefined, status does not change. <h4>Validation rules</h4><p> Budgets cannot <b>overlap</b> with each other for a specific seller.<br /> Budget's <b>amount</b> can be decreased if it did not start yet.<br /> Budget's <b>status</b> can only be changed from "Active" to "Inactive", if budget already started.<br /><b>Inactive</b> budgets cannot be updated. </p><h4>Functional cases</h4><h5>Increase budget amount</h5><p> Budget can only be increased if its end date is not reached.<br /> Amount value must include the amount that has been already spent.<br /> Example: if you want to add 50€ to a 100€ budget, you should update the amount to 150€, regardless of the amount already spent.<br /> Or, alternatively, you can set it to "null" or leave empty to change the budget to uncapped.<br /></p><h5>Stop budget consumption</h5><p> Setting a currently running budget’s status to Inactive, result in:<br /> • Setting its end date to today (at 23:59:59, according to UTC+00:00)<br /> • Stopping its consumption instantly<br /></p><h5>Decrease budget amount</h5><p> In order to decrease the amount of a currently running budget, you have to:<br /> • Stop budget consumption (making the currently running budget to end at 23:59:59, according to UTC+00:00)<br /> • Create a new budget with a dedicated amount. (that will start the following day, according to UTC+00:00)<br /></p>
// Import classes:
import com.criteo.marketing.ApiClient;
import com.criteo.marketing.ApiException;
import com.criteo.marketing.Configuration;
import com.criteo.marketing.auth.*;
import com.criteo.marketing.models.*;
import com.criteo.marketing.api.SellersApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.criteo.com/marketing");
// Configure API key authorization: Authorization
ApiKeyAuth Authorization = (ApiKeyAuth) defaultClient.getAuthentication("Authorization");
Authorization.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Authorization.setApiKeyPrefix("Token");
SellersApi apiInstance = new SellersApi(defaultClient);
String authorization = "\"Bearer VALID_JWT_TOKEN_BASE64\""; // String | JWT Bearer Token
SellerBudgetsUpdateMessage sellerBudgets = new SellerBudgetsUpdateMessage(); // SellerBudgetsUpdateMessage |
try {
SellerBudgetsMessage result = apiInstance.updateBudgets(authorization, sellerBudgets);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SellersApi#updateBudgets");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
authorization | String | JWT Bearer Token | [default to "Bearer VALID_JWT_TOKEN_BASE64"] |
sellerBudgets | SellerBudgetsUpdateMessage |
- Content-Type: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded, text/html
- Accept: application/json, text/json, application/xml, text/xml, text/html
Status code | Description | Response headers |
---|---|---|
200 | Sellers budgets successfully updated. | - |
400 | Bad request, invalid syntax or validation error (the whole batch will be dropped, no budget will be updated). Response message will be different based on error. | - |
401 | Authentication failed. | - |
403 | The requested campaign doesn't belong to the API user's portfolio which prevents from updating budgets. | - |
404 | One of the requested budgets is unknown. The whole batch will be dropped, no budget will be updated. | - |
405 | Requested campaign isn't a Criteo Reseller Program one. | - |
429 | Throttling failure. Maximum sending rate exceeded. | - |
500 | Unknown error. | - |