All URIs are relative to https://api.voucherify.io
Method | HTTP request | Description |
---|---|---|
createCategory | POST /v1/categories | Create Category |
deleteCategory | DELETE /v1/categories/{categoryId} | Delete Category |
getCategory | GET /v1/categories/{categoryId} | Get Category |
listCategories | GET /v1/categories | List Categories |
updateCategory | PUT /v1/categories/{categoryId} | Update Category |
CategoriesCreateResponseBody createCategory(categoriesCreateRequestBody)
Create Category
Create category with a specific name and hierarchy.
// 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.CategoriesApi;
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");
CategoriesApi apiInstance = new CategoriesApi(defaultClient);
CategoriesCreateRequestBody categoriesCreateRequestBody = new CategoriesCreateRequestBody(); // CategoriesCreateRequestBody | Specify the details of the category that you would like to create.
try {
CategoriesCreateResponseBody result = apiInstance.createCategory(categoriesCreateRequestBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CategoriesApi#createCategory");
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 |
---|---|---|
categoriesCreateRequestBody | CategoriesCreateRequestBody | Specify the details of the category that you would like to create. |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Returns a newly created category object. | - |
deleteCategory(categoryId)
Delete Category
Delete a category by the category 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.CategoriesApi;
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");
CategoriesApi apiInstance = new CategoriesApi(defaultClient);
String categoryId = "categoryId_example"; // String | Unique category ID assigned by Voucherify.
try {
apiInstance.deleteCategory(categoryId);
} catch (ApiException e) {
System.err.println("Exception when calling CategoriesApi#deleteCategory");
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 |
---|---|---|
categoryId | String | Unique category ID assigned by Voucherify. |
null (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
204 | No content is returned. | - |
CategoriesGetResponseBody getCategory(categoryId)
Get Category
Retrieve a category by the category 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.CategoriesApi;
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");
CategoriesApi apiInstance = new CategoriesApi(defaultClient);
String categoryId = "categoryId_example"; // String | Unique category ID assigned by Voucherify.
try {
CategoriesGetResponseBody result = apiInstance.getCategory(categoryId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CategoriesApi#getCategory");
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 |
---|---|---|
categoryId | String | Unique category ID assigned by Voucherify. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Returns a category object. | - |
CategoriesListResponseBody listCategories()
List Categories
List all categories.
// 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.CategoriesApi;
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");
CategoriesApi apiInstance = new CategoriesApi(defaultClient);
try {
CategoriesListResponseBody result = apiInstance.listCategories();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CategoriesApi#listCategories");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Returns a dictionary of category objects. | - |
CategoriesUpdateResponseBody updateCategory(categoryId, categoriesUpdateRequestBody)
Update Category
Update category using the category 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.CategoriesApi;
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");
CategoriesApi apiInstance = new CategoriesApi(defaultClient);
String categoryId = "categoryId_example"; // String | Unique category ID assigned by Voucherify.
CategoriesUpdateRequestBody categoriesUpdateRequestBody = new CategoriesUpdateRequestBody(); // CategoriesUpdateRequestBody | Specify the details of the category that you would like to update.
try {
CategoriesUpdateResponseBody result = apiInstance.updateCategory(categoryId, categoriesUpdateRequestBody);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CategoriesApi#updateCategory");
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 |
---|---|---|
categoryId | String | Unique category ID assigned by Voucherify. |
categoriesUpdateRequestBody | CategoriesUpdateRequestBody | Specify the details of the category that you would like to update. |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Returns a category object with a refreshed `updated_at` property. | - |