All URIs are relative to https://api.voucherify.io, except if the operation defines another base path.
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 |
createCategory($categoriesCreateRequestBody): \OpenAPI\Client\Model\CategoriesCreateResponseBody
Create Category
Create category with a specific name and hierarchy.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: X-App-Id
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-App-Id', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-App-Id', 'Bearer');
// Configure API key authorization: X-App-Token
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-App-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-App-Token', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\CategoriesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$categoriesCreateRequestBody = {"name":"Eighth","hierarchy":8}; // \OpenAPI\Client\Model\CategoriesCreateRequestBody | Specify the details of the category that you would like to create.
try {
$result = $apiInstance->createCategory($categoriesCreateRequestBody);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CategoriesApi->createCategory: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
categoriesCreateRequestBody | \OpenAPI\Client\Model\CategoriesCreateRequestBody | Specify the details of the category that you would like to create. | [optional] |
\OpenAPI\Client\Model\CategoriesCreateResponseBody
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteCategory($categoryId)
Delete Category
Delete a category by the category ID.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: X-App-Id
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-App-Id', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-App-Id', 'Bearer');
// Configure API key authorization: X-App-Token
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-App-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-App-Token', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\CategoriesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$categoryId = 'categoryId_example'; // string | Unique category ID assigned by Voucherify.
try {
$apiInstance->deleteCategory($categoryId);
} catch (Exception $e) {
echo 'Exception when calling CategoriesApi->deleteCategory: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
categoryId | string | Unique category ID assigned by Voucherify. |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getCategory($categoryId): \OpenAPI\Client\Model\CategoriesGetResponseBody
Get Category
Retrieve a category by the category ID.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: X-App-Id
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-App-Id', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-App-Id', 'Bearer');
// Configure API key authorization: X-App-Token
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-App-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-App-Token', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\CategoriesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$categoryId = 'categoryId_example'; // string | Unique category ID assigned by Voucherify.
try {
$result = $apiInstance->getCategory($categoryId);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CategoriesApi->getCategory: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
categoryId | string | Unique category ID assigned by Voucherify. |
\OpenAPI\Client\Model\CategoriesGetResponseBody
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listCategories(): \OpenAPI\Client\Model\CategoriesListResponseBody
List Categories
List all categories.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: X-App-Id
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-App-Id', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-App-Id', 'Bearer');
// Configure API key authorization: X-App-Token
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-App-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-App-Token', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\CategoriesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
try {
$result = $apiInstance->listCategories();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CategoriesApi->listCategories: ', $e->getMessage(), PHP_EOL;
}
This endpoint does not need any parameter.
\OpenAPI\Client\Model\CategoriesListResponseBody
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updateCategory($categoryId, $categoriesUpdateRequestBody): \OpenAPI\Client\Model\CategoriesUpdateResponseBody
Update Category
Update category using the category ID.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: X-App-Id
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-App-Id', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-App-Id', 'Bearer');
// Configure API key authorization: X-App-Token
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('X-App-Token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-App-Token', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\CategoriesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$categoryId = 'categoryId_example'; // string | Unique category ID assigned by Voucherify.
$categoriesUpdateRequestBody = {"name":"Summer","hierarchy":1}; // \OpenAPI\Client\Model\CategoriesUpdateRequestBody | Specify the details of the category that you would like to update.
try {
$result = $apiInstance->updateCategory($categoryId, $categoriesUpdateRequestBody);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CategoriesApi->updateCategory: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
categoryId | string | Unique category ID assigned by Voucherify. | |
categoriesUpdateRequestBody | \OpenAPI\Client\Model\CategoriesUpdateRequestBody | Specify the details of the category that you would like to update. | [optional] |
\OpenAPI\Client\Model\CategoriesUpdateResponseBody
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]