All URIs are relative to https://api.voucherify.io
Method | HTTP request | Description |
---|---|---|
createReward | POST /v1/rewards | Create Reward |
createRewardAssignment | POST /v1/rewards/{rewardId}/assignments | Create Reward Assignment |
deleteReward | DELETE /v1/rewards/{rewardId} | Delete Reward |
deleteRewardAssignment | DELETE /v1/rewards/{rewardId}/assignments/{assignmentId} | Delete Reward Assignment |
getReward | GET /v1/rewards/{rewardId} | Get Reward |
getRewardAssignment | GET /v1/rewards/{rewardId}/assignments/{assignmentId} | Get Reward Assignment |
listRewardAssignments | GET /v1/rewards/{rewardId}/assignments | List Reward Assignments |
listRewards | GET /v1/rewards | List Rewards |
updateReward | PUT /v1/rewards/{rewardId} | Update Reward |
updateRewardAssignment | PUT /v1/rewards/{rewardId}/assignments/{assignmentId} | Update Reward Assignment |
RewardsCreateResponseBody createReward(rewardsCreateRequestBody)
Create Reward
Create a new reward.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.RewardsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.voucherify.io");
// Configure API key authorization: X-App-Id
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
RewardsApi apiInstance = new RewardsApi(defaultClient);
RewardsCreateRequestBody rewardsCreateRequestBody = new RewardsCreateRequestBody(); // RewardsCreateRequestBody | Define parameters of the new reward.
try {
RewardsCreateResponseBody result = apiInstance.createReward(rewardsCreateRequestBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RewardsApi#createReward");
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 |
---|---|---|
rewardsCreateRequestBody | RewardsCreateRequestBody | Define parameters of the new reward. |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Returns a reward object. | - |
RewardsAssignmentsCreateResponseBody createRewardAssignment(rewardId, rewardsAssignmentsCreateRequestBody)
Create Reward Assignment
Assigns a reward to a specified loyalty campaign.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.RewardsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.voucherify.io");
// Configure API key authorization: X-App-Id
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
RewardsApi apiInstance = new RewardsApi(defaultClient);
String rewardId = "rewardId_example"; // String | A unique reward ID.
RewardsAssignmentsCreateRequestBody rewardsAssignmentsCreateRequestBody = new RewardsAssignmentsCreateRequestBody(); // RewardsAssignmentsCreateRequestBody | Provide the campaign ID of the campaign to which the reward is to be assigned and define the cost of the reward in terms of loyalty points.
try {
RewardsAssignmentsCreateResponseBody result = apiInstance.createRewardAssignment(rewardId, rewardsAssignmentsCreateRequestBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RewardsApi#createRewardAssignment");
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 |
---|---|---|
rewardId | String | A unique reward ID. |
rewardsAssignmentsCreateRequestBody | RewardsAssignmentsCreateRequestBody | Provide the campaign ID of the campaign to which the reward is to be assigned and define the cost of the reward in terms of loyalty points. |
RewardsAssignmentsCreateResponseBody
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Returns a reward assignment object. | - |
deleteReward(rewardId)
Delete Reward
Delete a reward.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.RewardsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.voucherify.io");
// Configure API key authorization: X-App-Id
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
RewardsApi apiInstance = new RewardsApi(defaultClient);
String rewardId = "rewardId_example"; // String | A unique reward ID.
try {
apiInstance.deleteReward(rewardId);
} catch (ApiException e) {
System.err.println("Exception when calling RewardsApi#deleteReward");
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 |
---|---|---|
rewardId | String | A unique reward ID. |
null (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
204 | Returns no content if deletion is successful. | - |
deleteRewardAssignment(rewardId, assignmentId)
Delete Reward Assignment
This method deletes a reward assignment for a particular reward.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.RewardsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.voucherify.io");
// Configure API key authorization: X-App-Id
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
RewardsApi apiInstance = new RewardsApi(defaultClient);
String rewardId = "rewardId_example"; // String | A unique reward ID.
String assignmentId = "assignmentId_example"; // String | A unique reward assignment ID.
try {
apiInstance.deleteRewardAssignment(rewardId, assignmentId);
} catch (ApiException e) {
System.err.println("Exception when calling RewardsApi#deleteRewardAssignment");
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 |
---|---|---|
rewardId | String | A unique reward ID. |
assignmentId | String | A unique reward assignment ID. |
null (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
204 | Returns no content if deletion is successful. | - |
Reward getReward(rewardId)
Get Reward
Retrieve a reward by the reward ID.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.RewardsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.voucherify.io");
// Configure API key authorization: X-App-Id
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
RewardsApi apiInstance = new RewardsApi(defaultClient);
String rewardId = "rewardId_example"; // String | A unique reward ID.
try {
Reward result = apiInstance.getReward(rewardId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RewardsApi#getReward");
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 |
---|---|---|
rewardId | String | A unique reward ID. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Returns a reward object if a valid identifier was provided. | - |
RewardsAssignmentsGetResponseBody getRewardAssignment(rewardId, assignmentId)
Get Reward Assignment
Retrieve a reward assignment.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.RewardsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.voucherify.io");
// Configure API key authorization: X-App-Id
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
RewardsApi apiInstance = new RewardsApi(defaultClient);
String rewardId = "rewardId_example"; // String | A unique reward ID.
String assignmentId = "assignmentId_example"; // String | A unique reward assignment ID.
try {
RewardsAssignmentsGetResponseBody result = apiInstance.getRewardAssignment(rewardId, assignmentId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RewardsApi#getRewardAssignment");
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 |
---|---|---|
rewardId | String | A unique reward ID. |
assignmentId | String | A unique reward assignment ID. |
RewardsAssignmentsGetResponseBody
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Returns a reward assignment object. | - |
RewardsAssignmentsListResponseBody listRewardAssignments(rewardId, limit, page)
List Reward Assignments
Retrieve reward assignments by the reward ID.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.RewardsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.voucherify.io");
// Configure API key authorization: X-App-Id
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
RewardsApi apiInstance = new RewardsApi(defaultClient);
String rewardId = "rewardId_example"; // String | A unique reward ID.
Integer limit = 56; // Integer | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.
Integer page = 56; // Integer | Which page of results to return. The lowest value is 1.
try {
RewardsAssignmentsListResponseBody result = apiInstance.listRewardAssignments(rewardId, limit, page);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RewardsApi#listRewardAssignments");
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 |
---|---|---|
rewardId | String | A unique reward ID. |
limit | Integer | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. |
page | Integer | Which page of results to return. The lowest value is 1. |
RewardsAssignmentsListResponseBody
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Returns a dictionary of reward assignment objects. Each object contains information regarding the resource to which the reward was assigned and the cost in loyalty points for the reward. | - |
RewardsListResponseBody listRewards(limit, page, assignmentId)
List Rewards
Retrieve rewards.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.RewardsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.voucherify.io");
// Configure API key authorization: X-App-Id
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
RewardsApi apiInstance = new RewardsApi(defaultClient);
Integer limit = 56; // Integer | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.
Integer page = 56; // Integer | Which page of results to return. The lowest value is 1.
String assignmentId = "assignmentId_example"; // String | A unique reward assignment ID. Use this parameter to get the reward details in the context of an assignment ID.
try {
RewardsListResponseBody result = apiInstance.listRewards(limit, page, assignmentId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RewardsApi#listRewards");
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 |
---|---|---|
limit | Integer | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. |
page | Integer | Which page of results to return. The lowest value is 1. |
assignmentId | String | A unique reward assignment ID. Use this parameter to get the reward details in the context of an assignment ID. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Returns a dictionary of reward objects. | - |
RewardsUpdateResponseBody updateReward(rewardId, rewardsUpdateRequestBody)
Update Reward
Update the details of a reward.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.RewardsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.voucherify.io");
// Configure API key authorization: X-App-Id
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
RewardsApi apiInstance = new RewardsApi(defaultClient);
String rewardId = "rewardId_example"; // String | A unique reward ID.
RewardsUpdateRequestBody rewardsUpdateRequestBody = new RewardsUpdateRequestBody(); // RewardsUpdateRequestBody | Define the parameters to be updated for the reward.
try {
RewardsUpdateResponseBody result = apiInstance.updateReward(rewardId, rewardsUpdateRequestBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RewardsApi#updateReward");
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 |
---|---|---|
rewardId | String | A unique reward ID. |
rewardsUpdateRequestBody | RewardsUpdateRequestBody | Define the parameters to be updated for the reward. |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Returns an updated reward object. | - |
RewardsAssignmentsUpdateResponseBody updateRewardAssignment(rewardId, assignmentId, rewardsAssignmentsUpdateRequestBody)
Update Reward Assignment
Update the number of points needed to successfully redeem the reward.
// Import classes:
import io.voucherify.client.ApiClient;
import io.voucherify.client.ApiException;
import io.voucherify.client.Configuration;
import io.voucherify.client.auth.*;
import io.voucherify.client.models.*;
import io.voucherify.client.api.RewardsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.voucherify.io");
// Configure API key authorization: X-App-Id
defaultClient.setAuthentication("X-App-Id", "YOUR API KEY");
// Configure API key authorization: X-App-Token
defaultClient.setAuthentication("X-App-Token", "YOUR API KEY");
RewardsApi apiInstance = new RewardsApi(defaultClient);
String rewardId = "rewardId_example"; // String | A unique reward ID.
String assignmentId = "assignmentId_example"; // String | A unique reward assignment ID.
RewardsAssignmentsUpdateRequestBody rewardsAssignmentsUpdateRequestBody = new RewardsAssignmentsUpdateRequestBody(); // RewardsAssignmentsUpdateRequestBody | Define the number of points required to exchange for the reward.
try {
RewardsAssignmentsUpdateResponseBody result = apiInstance.updateRewardAssignment(rewardId, assignmentId, rewardsAssignmentsUpdateRequestBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RewardsApi#updateRewardAssignment");
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 |
---|---|---|
rewardId | String | A unique reward ID. |
assignmentId | String | A unique reward assignment ID. |
rewardsAssignmentsUpdateRequestBody | RewardsAssignmentsUpdateRequestBody | Define the number of points required to exchange for the reward. |
RewardsAssignmentsUpdateResponseBody
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Returns the updated reward assignment object. | - |