Skip to content

Latest commit

 

History

History
327 lines (224 loc) · 8.38 KB

VouchersApi.md

File metadata and controls

327 lines (224 loc) · 8.38 KB

Spy\SitooClient\VouchersApi

All URIs are relative to https://api.mysitoo.com/v2/accounts/1500, except if the operation defines another base path.

Method HTTP request Description
addVoucher() POST /sites/{siteid}/vouchers.json
deleteVoucher() DELETE /sites/{siteid}/vouchers/{voucherid}.json
getVoucher() GET /sites/{siteid}/vouchers/{voucherid}.json
getVouchers() GET /sites/{siteid}/vouchers.json
updateVoucher() PUT /sites/{siteid}/vouchers/{voucherid}.json

addVoucher()

addVoucher($siteid, $voucherWrite)

Example

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


// Configure HTTP basic authorization: basicAuth
$config = Spy\SitooClient\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');


$apiInstance = new Spy\SitooClient\Api\VouchersApi(
    // 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
);
$siteid = 56; // int
$voucherWrite = {vouchertype=200, vouchername=Resellers, value_x=30}; // \Spy\SitooClient\Model\VoucherWrite

try {
    $apiInstance->addVoucher($siteid, $voucherWrite);
} catch (Exception $e) {
    echo 'Exception when calling VouchersApi->addVoucher: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
siteid int
voucherWrite \Spy\SitooClient\Model\VoucherWrite

Return type

void (empty response body)

Authorization

basicAuth

HTTP request headers

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

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

deleteVoucher()

deleteVoucher($siteid, $voucherid): bool

Example

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


// Configure HTTP basic authorization: basicAuth
$config = Spy\SitooClient\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');


$apiInstance = new Spy\SitooClient\Api\VouchersApi(
    // 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
);
$siteid = 56; // int
$voucherid = 56; // int

try {
    $result = $apiInstance->deleteVoucher($siteid, $voucherid);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VouchersApi->deleteVoucher: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
siteid int
voucherid int

Return type

bool

Authorization

basicAuth

HTTP request headers

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

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

getVoucher()

getVoucher($siteid, $voucherid): \Spy\SitooClient\Model\VoucherRead

Example

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


// Configure HTTP basic authorization: basicAuth
$config = Spy\SitooClient\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');


$apiInstance = new Spy\SitooClient\Api\VouchersApi(
    // 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
);
$siteid = 56; // int
$voucherid = 56; // int

try {
    $result = $apiInstance->getVoucher($siteid, $voucherid);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VouchersApi->getVoucher: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
siteid int
voucherid int

Return type

\Spy\SitooClient\Model\VoucherRead

Authorization

basicAuth

HTTP request headers

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

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

getVouchers()

getVouchers($siteid, $start, $num, $fields): \Spy\SitooClient\Model\GetVouchersResponse

Example

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


// Configure HTTP basic authorization: basicAuth
$config = Spy\SitooClient\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');


$apiInstance = new Spy\SitooClient\Api\VouchersApi(
    // 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
);
$siteid = 56; // int
$start = 56; // int
$num = 56; // int
$fields = array('fields_example'); // string[] | list of fields, comma-separated

try {
    $result = $apiInstance->getVouchers($siteid, $start, $num, $fields);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VouchersApi->getVouchers: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
siteid int
start int [optional]
num int [optional]
fields string[] list of fields, comma-separated [optional]

Return type

\Spy\SitooClient\Model\GetVouchersResponse

Authorization

basicAuth

HTTP request headers

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

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

updateVoucher()

updateVoucher($siteid, $voucherid, $voucherWrite): bool

Example

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


// Configure HTTP basic authorization: basicAuth
$config = Spy\SitooClient\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');


$apiInstance = new Spy\SitooClient\Api\VouchersApi(
    // 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
);
$siteid = 56; // int
$voucherid = 56; // int
$voucherWrite = {vouchername=Voucher for Resellers}; // \Spy\SitooClient\Model\VoucherWrite

try {
    $result = $apiInstance->updateVoucher($siteid, $voucherid, $voucherWrite);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VouchersApi->updateVoucher: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
siteid int
voucherid int
voucherWrite \Spy\SitooClient\Model\VoucherWrite

Return type

bool

Authorization

basicAuth

HTTP request headers

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

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