Skip to content

Latest commit

 

History

History
440 lines (297 loc) · 14.7 KB

CategoriesApi.md

File metadata and controls

440 lines (297 loc) · 14.7 KB

voucherify.CategoriesApi

All URIs are relative to https://api.voucherify.io

Method HTTP request Description
create_category POST /v1/categories Create Category
delete_category DELETE /v1/categories/{categoryId} Delete Category
get_category GET /v1/categories/{categoryId} Get Category
list_categories GET /v1/categories List Categories
update_category PUT /v1/categories/{categoryId} Update Category

create_category

CategoriesCreateResponseBody create_category(categories_create_request_body=categories_create_request_body)

Create Category

Create category with a specific name and hierarchy.

Example

  • Api Key Authentication (X-App-Id):
  • Api Key Authentication (X-App-Token):
import voucherify
from voucherify.models.categories_create_request_body import CategoriesCreateRequestBody
from voucherify.models.categories_create_response_body import CategoriesCreateResponseBody
from voucherify.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.voucherify.io
# See configuration.py for a list of all supported configuration parameters.
configuration = voucherify.Configuration(
    host = "https://api.voucherify.io"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: X-App-Id
configuration.api_key['X-App-Id'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-App-Id'] = 'Bearer'

# Configure API key authorization: X-App-Token
configuration.api_key['X-App-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-App-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with voucherify.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = voucherify.CategoriesApi(api_client)
    categories_create_request_body = {"name":"Eighth","hierarchy":8} # CategoriesCreateRequestBody | Specify the details of the category that you would like to create. (optional)

    try:
        # Create Category
        api_response = api_instance.create_category(categories_create_request_body=categories_create_request_body)
        print("The response of CategoriesApi->create_category:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CategoriesApi->create_category: %s\n" % e)

Parameters

Name Type Description Notes
categories_create_request_body CategoriesCreateRequestBody Specify the details of the category that you would like to create. [optional]

Return type

CategoriesCreateResponseBody

Authorization

X-App-Id, X-App-Token

HTTP request headers

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

HTTP response details

Status code Description Response headers
2XX Returns a newly created category object. -

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

delete_category

delete_category(category_id)

Delete Category

Delete a category by the category ID.

Example

  • Api Key Authentication (X-App-Id):
  • Api Key Authentication (X-App-Token):
import voucherify
from voucherify.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.voucherify.io
# See configuration.py for a list of all supported configuration parameters.
configuration = voucherify.Configuration(
    host = "https://api.voucherify.io"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: X-App-Id
configuration.api_key['X-App-Id'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-App-Id'] = 'Bearer'

# Configure API key authorization: X-App-Token
configuration.api_key['X-App-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-App-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with voucherify.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = voucherify.CategoriesApi(api_client)
    category_id = 'category_id_example' # str | Unique category ID assigned by Voucherify.

    try:
        # Delete Category
        api_instance.delete_category(category_id)
    except Exception as e:
        print("Exception when calling CategoriesApi->delete_category: %s\n" % e)

Parameters

Name Type Description Notes
category_id str 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

HTTP response details

Status code Description Response headers
2XX No content is returned. -

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

get_category

CategoriesGetResponseBody get_category(category_id)

Get Category

Retrieve a category by the category ID.

Example

  • Api Key Authentication (X-App-Id):
  • Api Key Authentication (X-App-Token):
import voucherify
from voucherify.models.categories_get_response_body import CategoriesGetResponseBody
from voucherify.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.voucherify.io
# See configuration.py for a list of all supported configuration parameters.
configuration = voucherify.Configuration(
    host = "https://api.voucherify.io"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: X-App-Id
configuration.api_key['X-App-Id'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-App-Id'] = 'Bearer'

# Configure API key authorization: X-App-Token
configuration.api_key['X-App-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-App-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with voucherify.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = voucherify.CategoriesApi(api_client)
    category_id = 'category_id_example' # str | Unique category ID assigned by Voucherify.

    try:
        # Get Category
        api_response = api_instance.get_category(category_id)
        print("The response of CategoriesApi->get_category:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CategoriesApi->get_category: %s\n" % e)

Parameters

Name Type Description Notes
category_id str Unique category ID assigned by Voucherify.

Return type

CategoriesGetResponseBody

Authorization

X-App-Id, X-App-Token

HTTP request headers

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

HTTP response details

Status code Description Response headers
2XX Returns a category object. -

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

list_categories

CategoriesListResponseBody list_categories()

List Categories

List all categories.

Example

  • Api Key Authentication (X-App-Id):
  • Api Key Authentication (X-App-Token):
import voucherify
from voucherify.models.categories_list_response_body import CategoriesListResponseBody
from voucherify.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.voucherify.io
# See configuration.py for a list of all supported configuration parameters.
configuration = voucherify.Configuration(
    host = "https://api.voucherify.io"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: X-App-Id
configuration.api_key['X-App-Id'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-App-Id'] = 'Bearer'

# Configure API key authorization: X-App-Token
configuration.api_key['X-App-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-App-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with voucherify.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = voucherify.CategoriesApi(api_client)

    try:
        # List Categories
        api_response = api_instance.list_categories()
        print("The response of CategoriesApi->list_categories:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CategoriesApi->list_categories: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

CategoriesListResponseBody

Authorization

X-App-Id, X-App-Token

HTTP request headers

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

HTTP response details

Status code Description Response headers
2XX Returns a dictionary of category objects. -

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

update_category

CategoriesUpdateResponseBody update_category(category_id, categories_update_request_body=categories_update_request_body)

Update Category

Update category using the category ID.

Example

  • Api Key Authentication (X-App-Id):
  • Api Key Authentication (X-App-Token):
import voucherify
from voucherify.models.categories_update_request_body import CategoriesUpdateRequestBody
from voucherify.models.categories_update_response_body import CategoriesUpdateResponseBody
from voucherify.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.voucherify.io
# See configuration.py for a list of all supported configuration parameters.
configuration = voucherify.Configuration(
    host = "https://api.voucherify.io"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: X-App-Id
configuration.api_key['X-App-Id'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-App-Id'] = 'Bearer'

# Configure API key authorization: X-App-Token
configuration.api_key['X-App-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-App-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with voucherify.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = voucherify.CategoriesApi(api_client)
    category_id = 'category_id_example' # str | Unique category ID assigned by Voucherify.
    categories_update_request_body = {"name":"Summer","hierarchy":1} # CategoriesUpdateRequestBody | Specify the details of the category that you would like to update. (optional)

    try:
        # Update Category
        api_response = api_instance.update_category(category_id, categories_update_request_body=categories_update_request_body)
        print("The response of CategoriesApi->update_category:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CategoriesApi->update_category: %s\n" % e)

Parameters

Name Type Description Notes
category_id str Unique category ID assigned by Voucherify.
categories_update_request_body CategoriesUpdateRequestBody Specify the details of the category that you would like to update. [optional]

Return type

CategoriesUpdateResponseBody

Authorization

X-App-Id, X-App-Token

HTTP request headers

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

HTTP response details

Status code Description Response headers
2XX Returns a category object with a refreshed `updated_at` property. -

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