Skip to content

Latest commit

 

History

History
350 lines (247 loc) · 13.5 KB

DiscountsApi.md

File metadata and controls

350 lines (247 loc) · 13.5 KB

Conekta\DiscountsApi

All URIs are relative to https://api.conekta.io, except if the operation defines another base path.

Method HTTP request Description
ordersCreateDiscountLine() POST /orders/{id}/discount_lines Create Discount
ordersDeleteDiscountLines() DELETE /orders/{id}/discount_lines/{discount_lines_id} Delete Discount
ordersGetDiscountLine() GET /orders/{id}/discount_lines/{discount_lines_id} Get Discount
ordersGetDiscountLines() GET /orders/{id}/discount_lines Get a List of Discount
ordersUpdateDiscountLines() PUT /orders/{id}/discount_lines/{discount_lines_id} Update Discount

ordersCreateDiscountLine()

ordersCreateDiscountLine($id, $order_discount_lines_request, $accept_language, $x_child_company_id): \Conekta\Model\DiscountLinesResponse

Create Discount

Create discount lines for an existing orden

Example

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


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\Api\DiscountsApi(
    // 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
);
$id = 6307a60c41de27127515a575; // string | Identifier of the resource
$order_discount_lines_request = new \Conekta\Model\OrderDiscountLinesRequest(); // \Conekta\Model\OrderDiscountLinesRequest | requested field for a discount lines
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.

try {
    $result = $apiInstance->ordersCreateDiscountLine($id, $order_discount_lines_request, $accept_language, $x_child_company_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DiscountsApi->ordersCreateDiscountLine: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
id string Identifier of the resource
order_discount_lines_request \Conekta\Model\OrderDiscountLinesRequest requested field for a discount lines
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

\Conekta\Model\DiscountLinesResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/vnd.conekta-v2.1.0+json

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

ordersDeleteDiscountLines()

ordersDeleteDiscountLines($id, $discount_lines_id, $accept_language, $x_child_company_id): \Conekta\Model\DiscountLinesResponse

Delete Discount

Delete an existing discount lines for an existing orden

Example

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


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\Api\DiscountsApi(
    // 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
);
$id = 6307a60c41de27127515a575; // string | Identifier of the resource
$discount_lines_id = dis_lin_2tQ974hSHcsdeSZHG; // string | discount line id identifier
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.

try {
    $result = $apiInstance->ordersDeleteDiscountLines($id, $discount_lines_id, $accept_language, $x_child_company_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DiscountsApi->ordersDeleteDiscountLines: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
id string Identifier of the resource
discount_lines_id string discount line id identifier
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

\Conekta\Model\DiscountLinesResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.1.0+json

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

ordersGetDiscountLine()

ordersGetDiscountLine($id, $discount_lines_id, $accept_language, $x_child_company_id): \Conekta\Model\DiscountLinesResponse

Get Discount

Get an existing discount lines for an existing orden

Example

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


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\Api\DiscountsApi(
    // 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
);
$id = 6307a60c41de27127515a575; // string | Identifier of the resource
$discount_lines_id = dis_lin_2tQ974hSHcsdeSZHG; // string | discount line id identifier
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.

try {
    $result = $apiInstance->ordersGetDiscountLine($id, $discount_lines_id, $accept_language, $x_child_company_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DiscountsApi->ordersGetDiscountLine: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
id string Identifier of the resource
discount_lines_id string discount line id identifier
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

\Conekta\Model\DiscountLinesResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.1.0+json

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

ordersGetDiscountLines()

ordersGetDiscountLines($id, $accept_language, $x_child_company_id, $limit, $search, $next, $previous): \Conekta\Model\GetOrderDiscountLinesResponse

Get a List of Discount

Get discount lines for an existing orden

Example

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


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\Api\DiscountsApi(
    // 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
);
$id = 6307a60c41de27127515a575; // string | Identifier of the resource
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.
$limit = 20; // int | The numbers of items to return, the maximum value is 250
$search = 'search_example'; // string | General order search, e.g. by mail, reference etc.
$next = 'next_example'; // string | next page
$previous = 'previous_example'; // string | previous page

try {
    $result = $apiInstance->ordersGetDiscountLines($id, $accept_language, $x_child_company_id, $limit, $search, $next, $previous);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DiscountsApi->ordersGetDiscountLines: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
id string Identifier of the resource
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]
limit int The numbers of items to return, the maximum value is 250 [optional] [default to 20]
search string General order search, e.g. by mail, reference etc. [optional]
next string next page [optional]
previous string previous page [optional]

Return type

\Conekta\Model\GetOrderDiscountLinesResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.conekta-v2.1.0+json

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

ordersUpdateDiscountLines()

ordersUpdateDiscountLines($id, $discount_lines_id, $update_order_discount_lines_request, $accept_language, $x_child_company_id): \Conekta\Model\DiscountLinesResponse

Update Discount

Update an existing discount lines for an existing orden

Example

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


// Configure Bearer authorization: bearerAuth
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Conekta\Api\DiscountsApi(
    // 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
);
$id = 6307a60c41de27127515a575; // string | Identifier of the resource
$discount_lines_id = dis_lin_2tQ974hSHcsdeSZHG; // string | discount line id identifier
$update_order_discount_lines_request = new \Conekta\Model\UpdateOrderDiscountLinesRequest(); // \Conekta\Model\UpdateOrderDiscountLinesRequest | requested field for a discount lines
$accept_language = es; // string | Use for knowing which language to use
$x_child_company_id = 6441b6376b60c3a638da80af; // string | In the case of a holding company, the company id of the child company to which will process the request.

try {
    $result = $apiInstance->ordersUpdateDiscountLines($id, $discount_lines_id, $update_order_discount_lines_request, $accept_language, $x_child_company_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DiscountsApi->ordersUpdateDiscountLines: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
id string Identifier of the resource
discount_lines_id string discount line id identifier
update_order_discount_lines_request \Conekta\Model\UpdateOrderDiscountLinesRequest requested field for a discount lines
accept_language string Use for knowing which language to use [optional] [default to 'es']
x_child_company_id string In the case of a holding company, the company id of the child company to which will process the request. [optional]

Return type

\Conekta\Model\DiscountLinesResponse

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/vnd.conekta-v2.1.0+json

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