All URIs are relative to https://api.brevo.com/v3
Method | HTTP request | Description |
---|---|---|
createCouponCollection | POST /couponCollections | Create а coupon collection |
createCoupons | POST /coupons | Create coupons for a coupon collection |
getCouponCollection | GET /couponCollections/{id} | Get a coupon collection by id |
getCouponCollections | GET /couponCollections | Get all your coupon collections |
updateCouponCollection | PATCH /couponCollections/{id} | Update a coupon collection by id |
InlineResponse2013 createCouponCollection(createCouponCollection)
Create а coupon collection
// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.CouponsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");
// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");
CouponsApi apiInstance = new CouponsApi();
CreateCouponCollection createCouponCollection = new CreateCouponCollection(); // CreateCouponCollection | Values to create a coupon collection
try {
InlineResponse2013 result = apiInstance.createCouponCollection(createCouponCollection);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CouponsApi#createCouponCollection");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
createCouponCollection | CreateCouponCollection | Values to create a coupon collection |
- Content-Type: application/json
- Accept: application/json
createCoupons(createCoupons)
Create coupons for a coupon collection
// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.CouponsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");
// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");
CouponsApi apiInstance = new CouponsApi();
CreateCoupons createCoupons = new CreateCoupons(); // CreateCoupons | Values to create coupons
try {
apiInstance.createCoupons(createCoupons);
} catch (ApiException e) {
System.err.println("Exception when calling CouponsApi#createCoupons");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
createCoupons | CreateCoupons | Values to create coupons |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
GetCouponCollection getCouponCollection(id)
Get a coupon collection by id
// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.CouponsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");
// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");
CouponsApi apiInstance = new CouponsApi();
String id = "id_example"; // String | Id of the collection to return
try {
GetCouponCollection result = apiInstance.getCouponCollection(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CouponsApi#getCouponCollection");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | Id of the collection to return |
- Content-Type: application/json
- Accept: application/json
GetCouponCollection getCouponCollections(limit, offset, sort, sortBy)
Get all your coupon collections
// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.CouponsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");
// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");
CouponsApi apiInstance = new CouponsApi();
Long limit = 50L; // Long | Number of documents returned per page
Long offset = 0L; // Long | Index of the first document on the page
String sort = "desc"; // String | Sort the results by creation time in ascending/descending order
Object sortBy = null; // Object | The field used to sort coupon collections
try {
GetCouponCollection result = apiInstance.getCouponCollections(limit, offset, sort, sortBy);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CouponsApi#getCouponCollections");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
limit | Long | Number of documents returned per page | [optional] [default to 50] |
offset | Long | Index of the first document on the page | [optional] [default to 0] |
sort | String | Sort the results by creation time in ascending/descending order | [optional] [default to desc] [enum: asc, desc] |
sortBy | Object | The field used to sort coupon collections | [optional] |
- Content-Type: application/json
- Accept: application/json
InlineResponse2003 updateCouponCollection(id, updateCouponCollection)
Update a coupon collection by id
// Import classes:
//import brevo.ApiClient;
//import brevo.ApiException;
//import brevo.Configuration;
//import brevo.auth.*;
//import brevoApi.CouponsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: api-key
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
apiKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.setApiKeyPrefix("Token");
// Configure API key authorization: partner-key
ApiKeyAuth partnerKey = (ApiKeyAuth) defaultClient.getAuthentication("partner-key");
partnerKey.setApiKey("YOUR PARTNER KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//partnerKey.setApiKeyPrefix("Token");
CouponsApi apiInstance = new CouponsApi();
String id = "id_example"; // String | Id of the collection to update
UpdateCouponCollection updateCouponCollection = new UpdateCouponCollection(); // UpdateCouponCollection | Values to update the coupon collection
try {
InlineResponse2003 result = apiInstance.updateCouponCollection(id, updateCouponCollection);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CouponsApi#updateCouponCollection");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | Id of the collection to update | |
updateCouponCollection | UpdateCouponCollection | Values to update the coupon collection | [optional] |
- Content-Type: application/json
- Accept: application/json