Skip to content

Latest commit

 

History

History
345 lines (237 loc) · 11.6 KB

CategoriesApi.md

File metadata and controls

345 lines (237 loc) · 11.6 KB

OpenAPI\Client\CategoriesApi

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()

createCategory($categoriesCreateRequestBody): \OpenAPI\Client\Model\CategoriesCreateResponseBody

Create Category

Create category with a specific name and hierarchy.

Example

<?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;
}

Parameters

Name Type Description Notes
categoriesCreateRequestBody \OpenAPI\Client\Model\CategoriesCreateRequestBody Specify the details of the category that you would like to create. [optional]

Return type

\OpenAPI\Client\Model\CategoriesCreateResponseBody

Authorization

X-App-Id, X-App-Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteCategory()

deleteCategory($categoryId)

Delete Category

Delete a category by the category ID.

Example

<?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;
}

Parameters

Name Type Description Notes
categoryId string Unique category ID assigned by Voucherify.

Return type

void (empty response body)

Authorization

X-App-Id, X-App-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getCategory()

getCategory($categoryId): \OpenAPI\Client\Model\CategoriesGetResponseBody

Get Category

Retrieve a category by the category ID.

Example

<?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;
}

Parameters

Name Type Description Notes
categoryId string Unique category ID assigned by Voucherify.

Return type

\OpenAPI\Client\Model\CategoriesGetResponseBody

Authorization

X-App-Id, X-App-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listCategories()

listCategories(): \OpenAPI\Client\Model\CategoriesListResponseBody

List Categories

List all categories.

Example

<?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;
}

Parameters

This endpoint does not need any parameter.

Return type

\OpenAPI\Client\Model\CategoriesListResponseBody

Authorization

X-App-Id, X-App-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateCategory()

updateCategory($categoryId, $categoriesUpdateRequestBody): \OpenAPI\Client\Model\CategoriesUpdateResponseBody

Update Category

Update category using the category ID.

Example

<?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;
}

Parameters

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]

Return type

\OpenAPI\Client\Model\CategoriesUpdateResponseBody

Authorization

X-App-Id, X-App-Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]