Skip to content

Latest commit

 

History

History
316 lines (218 loc) · 10.7 KB

File metadata and controls

316 lines (218 loc) · 10.7 KB

Keap\Core\V2\CategoryDiscountsApi

All URIs are relative to https://api.keap.com/crm, except if the operation defines another base path.

Method HTTP request Description
createCategoryDiscount() POST /rest/v2/discounts/productCategories Create a Category Discount
deleteCategoryDiscount() DELETE /rest/v2/discounts/productCategories/{discount_id} Delete a Category Discount
getCategoryDiscount() GET /rest/v2/discounts/productCategories/{discount_id} Retrieve a Category Discount
listCategoryDiscounts() GET /rest/v2/discounts/productCategories List Category Discounts
updateCategoryDiscount() PATCH /rest/v2/discounts/productCategories/{discount_id} Update a Category Discount

createCategoryDiscount()

createCategoryDiscount($create_category_discount_request): \Keap\Core\V2\Model\CategoryDiscount

Create a Category Discount

Creates a Category Discount

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Keap\Core\V2\Api\CategoryDiscountsApi(
    // 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
);
$create_category_discount_request = new \Keap\Core\V2\Model\CreateCategoryDiscountRequest(); // \Keap\Core\V2\Model\CreateCategoryDiscountRequest

try {
    $result = $apiInstance->createCategoryDiscount($create_category_discount_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CategoryDiscountsApi->createCategoryDiscount: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
create_category_discount_request \Keap\Core\V2\Model\CreateCategoryDiscountRequest

Return type

\Keap\Core\V2\Model\CategoryDiscount

Authorization

oauth2

HTTP request headers

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

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

deleteCategoryDiscount()

deleteCategoryDiscount($discount_id)

Delete a Category Discount

Deletes a specified Category Discount

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Keap\Core\V2\Api\CategoryDiscountsApi(
    // 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
);
$discount_id = 'discount_id_example'; // string

try {
    $apiInstance->deleteCategoryDiscount($discount_id);
} catch (Exception $e) {
    echo 'Exception when calling CategoryDiscountsApi->deleteCategoryDiscount: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
discount_id string

Return type

void (empty response body)

Authorization

oauth2

HTTP request headers

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

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

getCategoryDiscount()

getCategoryDiscount($discount_id): \Keap\Core\V2\Model\CategoryDiscount

Retrieve a Category Discount

Retrieves a single Category Discount

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Keap\Core\V2\Api\CategoryDiscountsApi(
    // 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
);
$discount_id = 'discount_id_example'; // string

try {
    $result = $apiInstance->getCategoryDiscount($discount_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CategoryDiscountsApi->getCategoryDiscount: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
discount_id string

Return type

\Keap\Core\V2\Model\CategoryDiscount

Authorization

oauth2

HTTP request headers

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

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

listCategoryDiscounts()

listCategoryDiscounts($filter, $order_by, $page_size, $page_token): \Keap\Core\V2\Model\ListCategoryDiscountsResponse

List Category Discounts

Retrieves a list of Category Discounts

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Keap\Core\V2\Api\CategoryDiscountsApi(
    // 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
);
$filter = 'filter_example'; // string | Filter to apply, the allowed field is: - (String) `product_category_id`  You will need to apply the `==` operator to check the equality of the filter with your searched word, in the encoded form `%3D%3D`. For the filters listed above, here are some examples: - `filter=product_category_id%3D%3D4`
$order_by = 'order_by_example'; // string | Attribute and direction to order items. One of the following fields: - `id` - `name`  One of the following directions: - `asc` - `desc`
$page_size = 0; // int | Total number of items to return per page
$page_token = 'page_token_example'; // string | Page token

try {
    $result = $apiInstance->listCategoryDiscounts($filter, $order_by, $page_size, $page_token);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CategoryDiscountsApi->listCategoryDiscounts: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
filter string Filter to apply, the allowed field is: - (String) `product_category_id` You will need to apply the `==` operator to check the equality of the filter with your searched word, in the encoded form `%3D%3D`. For the filters listed above, here are some examples: - `filter=product_category_id%3D%3D4` [optional]
order_by string Attribute and direction to order items. One of the following fields: - `id` - `name` One of the following directions: - `asc` - `desc` [optional]
page_size int Total number of items to return per page [optional]
page_token string Page token [optional]

Return type

\Keap\Core\V2\Model\ListCategoryDiscountsResponse

Authorization

oauth2

HTTP request headers

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

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

updateCategoryDiscount()

updateCategoryDiscount($discount_id, $update_category_discount_request, $update_mask): \Keap\Core\V2\Model\CategoryDiscount

Update a Category Discount

Updates a Category Discount

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Keap\Core\V2\Api\CategoryDiscountsApi(
    // 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
);
$discount_id = 'discount_id_example'; // string
$update_category_discount_request = new \Keap\Core\V2\Model\UpdateCategoryDiscountRequest(); // \Keap\Core\V2\Model\UpdateCategoryDiscountRequest
$update_mask = NULL; // mixed | An optional list of properties to be updated. If set, only the provided properties will be updated and others will be skipped.

try {
    $result = $apiInstance->updateCategoryDiscount($discount_id, $update_category_discount_request, $update_mask);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CategoryDiscountsApi->updateCategoryDiscount: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
discount_id string
update_category_discount_request \Keap\Core\V2\Model\UpdateCategoryDiscountRequest
update_mask mixed An optional list of properties to be updated. If set, only the provided properties will be updated and others will be skipped. [optional]

Return type

\Keap\Core\V2\Model\CategoryDiscount

Authorization

oauth2

HTTP request headers

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

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