Skip to content

Latest commit

 

History

History
386 lines (270 loc) · 12.5 KB

CartRulesApi.md

File metadata and controls

386 lines (270 loc) · 12.5 KB

CartRulesApi

All URIs are relative to https://api.kinow.com/api

Method HTTP request Description
attachCartRuleToCart POST /carts/{cart_id}/cart-rules
createCartRule POST /cart-rules
deleteCartRule DELETE /cart-rules/{cart_rule_id}
detachCartRuleFromCart DELETE /carts/{cart_id}/cart-rules/{cart_rule_id}
getCartRule GET /cart-rules/{cart_rule_id}
getCartRules GET /cart-rules
updateCartRule PUT /cart-rules/{cart_rule_id}

attachCartRuleToCart

attachCartRuleToCart($cart_id, $code, $ip)

Attach cart rule to cart

Example

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

// Configure API key authorization: ApiClientId
Kinow\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Client-Id', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Kinow\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Client-Id', 'Bearer');
// Configure API key authorization: ApiClientSecret
Kinow\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Client-Secret', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Kinow\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Client-Secret', 'Bearer');

$api_instance = new Kinow\Client\Api\CartRulesApi();
$cart_id = 789; // int | Cart ID to fetch
$code = "code_example"; // string | Code of the cart rule to attach
$ip = "ip_example"; // string | Filter by user IP

try {
    $api_instance->attachCartRuleToCart($cart_id, $code, $ip);
} catch (Exception $e) {
    echo 'Exception when calling CartRulesApi->attachCartRuleToCart: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
cart_id int Cart ID to fetch
code string Code of the cart rule to attach
ip string Filter by user IP [optional]

Return type

void (empty response body)

Authorization

ApiClientId, ApiClientSecret

HTTP request headers

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

createCartRule

createCartRule($body)

Create new cart rule

Example

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

// Configure API key authorization: ApiClientId
Kinow\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Client-Id', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Kinow\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Client-Id', 'Bearer');
// Configure API key authorization: ApiClientSecret
Kinow\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Client-Secret', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Kinow\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Client-Secret', 'Bearer');

$api_instance = new Kinow\Client\Api\CartRulesApi();
$body = new \Kinow\Client\Model\CreateCartRuleRequest(); // \Kinow\Client\Model\CreateCartRuleRequest | 

try {
    $api_instance->createCartRule($body);
} catch (Exception $e) {
    echo 'Exception when calling CartRulesApi->createCartRule: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
body \Kinow\Client\Model\CreateCartRuleRequest

Return type

void (empty response body)

Authorization

ApiClientId, ApiClientSecret

HTTP request headers

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

deleteCartRule

deleteCartRule($cart_rule_id)

Delete cart rule

Example

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

// Configure API key authorization: ApiClientId
Kinow\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Client-Id', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Kinow\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Client-Id', 'Bearer');
// Configure API key authorization: ApiClientSecret
Kinow\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Client-Secret', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Kinow\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Client-Secret', 'Bearer');

$api_instance = new Kinow\Client\Api\CartRulesApi();
$cart_rule_id = 56; // int | 

try {
    $api_instance->deleteCartRule($cart_rule_id);
} catch (Exception $e) {
    echo 'Exception when calling CartRulesApi->deleteCartRule: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
cart_rule_id int

Return type

void (empty response body)

Authorization

ApiClientId, ApiClientSecret

HTTP request headers

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

detachCartRuleFromCart

detachCartRuleFromCart($cart_id, $cart_rule_id)

Detach Cart rule from Cart

Example

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

// Configure API key authorization: ApiClientId
Kinow\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Client-Id', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Kinow\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Client-Id', 'Bearer');
// Configure API key authorization: ApiClientSecret
Kinow\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Client-Secret', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Kinow\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Client-Secret', 'Bearer');

$api_instance = new Kinow\Client\Api\CartRulesApi();
$cart_id = 789; // int | Cart ID to fetch
$cart_rule_id = 789; // int | Cart rule ID to detach

try {
    $api_instance->detachCartRuleFromCart($cart_id, $cart_rule_id);
} catch (Exception $e) {
    echo 'Exception when calling CartRulesApi->detachCartRuleFromCart: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
cart_id int Cart ID to fetch
cart_rule_id int Cart rule ID to detach

Return type

void (empty response body)

Authorization

ApiClientId, ApiClientSecret

HTTP request headers

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

getCartRule

\Kinow\Client\Model\CartRuleResponse getCartRule($cart_rule_id)

Get cart rule by id

Example

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

// Configure API key authorization: ApiClientId
Kinow\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Client-Id', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Kinow\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Client-Id', 'Bearer');
// Configure API key authorization: ApiClientSecret
Kinow\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Client-Secret', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Kinow\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Client-Secret', 'Bearer');

$api_instance = new Kinow\Client\Api\CartRulesApi();
$cart_rule_id = 789; // int | Cart rule ID to fetch

try {
    $result = $api_instance->getCartRule($cart_rule_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CartRulesApi->getCartRule: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
cart_rule_id int Cart rule ID to fetch

Return type

\Kinow\Client\Model\CartRuleResponse

Authorization

ApiClientId, ApiClientSecret

HTTP request headers

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

getCartRules

\Kinow\Client\Model\CartRuleListResponse getCartRules($page, $per_page, $filters)

Get cart rules list

Example

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

// Configure API key authorization: ApiClientId
Kinow\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Client-Id', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Kinow\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Client-Id', 'Bearer');
// Configure API key authorization: ApiClientSecret
Kinow\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Client-Secret', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Kinow\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Client-Secret', 'Bearer');

$api_instance = new Kinow\Client\Api\CartRulesApi();
$page = 789; // int | 
$per_page = 789; // int | 
$filters = "filters_example"; // string | ``` name[value]=string&name[operator]=contains&date_add[value]=string&date_add[operator]=lt _______________  { \"name\": { \"value\": \"string\", \"operator\": \"contains\" }, \"date_add\": { \"value\": \"string\", \"operator\": \"lt\" } } ``` Operator can be: strict, contains, between, in, gt (greater than), lt (lower than).

try {
    $result = $api_instance->getCartRules($page, $per_page, $filters);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CartRulesApi->getCartRules: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
page int [optional]
per_page int [optional]
filters string ``` name[value]=string&name[operator]=contains&date_add[value]=string&date_add[operator]=lt _______________ { &quot;name&quot;: { &quot;value&quot;: &quot;string&quot;, &quot;operator&quot;: &quot;contains&quot; }, &quot;date_add&quot;: { &quot;value&quot;: &quot;string&quot;, &quot;operator&quot;: &quot;lt&quot; } } ``` Operator can be: strict, contains, between, in, gt (greater than), lt (lower than). [optional]

Return type

\Kinow\Client\Model\CartRuleListResponse

Authorization

ApiClientId, ApiClientSecret

HTTP request headers

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

updateCartRule

updateCartRule($cart_rule_id, $body)

Update cart rule

Example

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

// Configure API key authorization: ApiClientId
Kinow\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Client-Id', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Kinow\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Client-Id', 'Bearer');
// Configure API key authorization: ApiClientSecret
Kinow\Client\Configuration::getDefaultConfiguration()->setApiKey('X-Client-Secret', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Kinow\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Client-Secret', 'Bearer');

$api_instance = new Kinow\Client\Api\CartRulesApi();
$cart_rule_id = 56; // int | 
$body = new \Kinow\Client\Model\UpdateCartRuleRequest(); // \Kinow\Client\Model\UpdateCartRuleRequest | 

try {
    $api_instance->updateCartRule($cart_rule_id, $body);
} catch (Exception $e) {
    echo 'Exception when calling CartRulesApi->updateCartRule: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
cart_rule_id int
body \Kinow\Client\Model\UpdateCartRuleRequest

Return type

void (empty response body)

Authorization

ApiClientId, ApiClientSecret

HTTP request headers

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