Skip to content

Latest commit

 

History

History
316 lines (218 loc) · 11.8 KB

File metadata and controls

316 lines (218 loc) · 11.8 KB

Keap\Core\V2\OrderTotalDiscountsApi

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

Method HTTP request Description
createOrderTotalDiscount() POST /rest/v2/discounts/orderTotals Create an Order Total Discount
deleteOrderTotalDiscount() DELETE /rest/v2/discounts/orderTotals/{discount_id} Delete an Order Total Discount
getOrderTotalDiscount() GET /rest/v2/discounts/orderTotals/{discount_id} Retrieve an Order Total Discount
listOrderTotalDiscounts() GET /rest/v2/discounts/orderTotals List all Order Total Discounts
updateOrderTotalDiscount() PATCH /rest/v2/discounts/orderTotals/{discount_id} Update an Order Total Discount

createOrderTotalDiscount()

createOrderTotalDiscount($create_order_total_discount_request): \Keap\Core\V2\Model\OrderTotalDiscount

Create an Order Total Discount

Creates an Order Total 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\OrderTotalDiscountsApi(
    // 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_order_total_discount_request = new \Keap\Core\V2\Model\CreateOrderTotalDiscountRequest(); // \Keap\Core\V2\Model\CreateOrderTotalDiscountRequest

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

Parameters

Name Type Description Notes
create_order_total_discount_request \Keap\Core\V2\Model\CreateOrderTotalDiscountRequest

Return type

\Keap\Core\V2\Model\OrderTotalDiscount

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]

deleteOrderTotalDiscount()

deleteOrderTotalDiscount($discount_id)

Delete an Order Total Discount

Deletes a specified Order Total 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\OrderTotalDiscountsApi(
    // 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->deleteOrderTotalDiscount($discount_id);
} catch (Exception $e) {
    echo 'Exception when calling OrderTotalDiscountsApi->deleteOrderTotalDiscount: ', $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]

getOrderTotalDiscount()

getOrderTotalDiscount($discount_id): \Keap\Core\V2\Model\OrderTotalDiscount

Retrieve an Order Total Discount

Retrieves an Order Total 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\OrderTotalDiscountsApi(
    // 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->getOrderTotalDiscount($discount_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OrderTotalDiscountsApi->getOrderTotalDiscount: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
discount_id string

Return type

\Keap\Core\V2\Model\OrderTotalDiscount

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]

listOrderTotalDiscounts()

listOrderTotalDiscounts($filter, $order_by, $page_size, $page_token): \Keap\Core\V2\Model\ListOrderTotalDiscountsResponse

List all Order Total Discounts

Retrieves a list of Order Total 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\OrderTotalDiscountsApi(
    // 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, allowed fields are: - (Boolean) `apply_to_commissions` - (DiscountStrategy) `discount_strategy`: GROSS or NET - (DiscountType) `discount_type`: AMOUNT or PERCENT - (Double) `discount_value`  You will need to apply the `==` operator to check the equality of one of the filters with your searched word, in the encoded form `%3D%3D`. For the filters listed above, here are some examples: - `filter=apply_to_commissions%3D%3Dtrue` - `filter=discount_strategy%3D%3DGROSS` - `filter=discount_type%3D%3DAMOUNT` - `filter=discount_value%3D%3D10.0` - `filter=discount_type%3D%3DAMOUNT%3Bdiscount_strategy%3D%3DNET`
$order_by = 'order_by_example'; // string | Attribute and direction to order items. One of the following fields: - `apply_to_commissions` - `discount_strategy` - `discount_type` - `discount_value` - `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->listOrderTotalDiscounts($filter, $order_by, $page_size, $page_token);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OrderTotalDiscountsApi->listOrderTotalDiscounts: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
filter string Filter to apply, allowed fields are: - (Boolean) `apply_to_commissions` - (DiscountStrategy) `discount_strategy`: GROSS or NET - (DiscountType) `discount_type`: AMOUNT or PERCENT - (Double) `discount_value` You will need to apply the `==` operator to check the equality of one of the filters with your searched word, in the encoded form `%3D%3D`. For the filters listed above, here are some examples: - `filter=apply_to_commissions%3D%3Dtrue` - `filter=discount_strategy%3D%3DGROSS` - `filter=discount_type%3D%3DAMOUNT` - `filter=discount_value%3D%3D10.0` - `filter=discount_type%3D%3DAMOUNT%3Bdiscount_strategy%3D%3DNET` [optional]
order_by string Attribute and direction to order items. One of the following fields: - `apply_to_commissions` - `discount_strategy` - `discount_type` - `discount_value` - `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\ListOrderTotalDiscountsResponse

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]

updateOrderTotalDiscount()

updateOrderTotalDiscount($discount_id, $update_order_total_discount_request, $update_mask): \Keap\Core\V2\Model\OrderTotalDiscount

Update an Order Total Discount

Updates an Order Total 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\OrderTotalDiscountsApi(
    // 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_order_total_discount_request = new \Keap\Core\V2\Model\UpdateOrderTotalDiscountRequest(); // \Keap\Core\V2\Model\UpdateOrderTotalDiscountRequest
$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->updateOrderTotalDiscount($discount_id, $update_order_total_discount_request, $update_mask);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling OrderTotalDiscountsApi->updateOrderTotalDiscount: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
discount_id string
update_order_total_discount_request \Keap\Core\V2\Model\UpdateOrderTotalDiscountRequest
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\OrderTotalDiscount

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]