PHP Classes

File: docs/Api/LoyaltyProgramPrizesApi.md

Recommend this page to a friend!
  Classes of Francesco Danti   Scloby Client API   docs/Api/LoyaltyProgramPrizesApi.md   Download  
File: docs/Api/LoyaltyProgramPrizesApi.md
Role: Example script
Content type: text/markdown
Description: Example script
Class: Scloby Client API
Client to call Scloby cloud POS API
Author: By
Last change:
Date: 11 days ago
Size: 9,122 bytes
 

Contents

Class file image Download

Swagger\Client\LoyaltyProgramPrizesApi

All URIs are relative to https://api.scloby.com/v2

Method | HTTP request | Description ------------- | ------------- | ------------- prizesGet | GET /prizes | Get All Prizes prizesIdDelete | DELETE /prizes/{id} | Delete existing Prize prizesIdGet | GET /prizes/{id} | Get existing Prize prizesIdPut | PUT /prizes/{id} | Edit existing Prize prizesPost | POST /prizes | Add new Prize

prizesGet

> \Swagger\Client\Model\ChainsRules prizesGet($pagination, $per_page, $page)

Get All Prizes

Returns a Json with data about all prizes of selected shop.

Example

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

// Configure OAuth2 access token for authorization: oAuth2AuthCode
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\Client\Api\LoyaltyProgramPrizesApi(
    // 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
);
$pagination = true; // bool | Pagination parameter
$per_page = 56; // int | Results_per_page
$page = 56; // int | PAGE_NUMBER(starting from 0 to TOTAL_PAGE-1)

try {
    $result = $apiInstance->prizesGet($pagination, $per_page, $page);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling LoyaltyProgramPrizesApi->prizesGet: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- pagination | bool| Pagination parameter | [optional] per_page | int| Results_per_page | [optional] page | int| PAGE_NUMBER(starting from 0 to TOTAL_PAGE-1) | [optional]

Return type

\Swagger\Client\Model\ChainsRules

Authorization

oAuth2AuthCode

HTTP request headers

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

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

prizesIdDelete

> prizesIdDelete($id)

Delete existing Prize

In this case you must specify the id in the URL, but it is no necessary in the request body

Example

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

// Configure OAuth2 access token for authorization: oAuth2AuthCode
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\Client\Api\LoyaltyProgramPrizesApi(
    // 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 = "id_example"; // string | id of the Prize that need to be deleted

try {
    $apiInstance->prizesIdDelete($id);
} catch (Exception $e) {
    echo 'Exception when calling LoyaltyProgramPrizesApi->prizesIdDelete: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- id | string| id of the Prize that need to be deleted |

Return type

void (empty response body)

Authorization

oAuth2AuthCode

HTTP request headers

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

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

prizesIdGet

> \Swagger\Client\Model\ChainsPrizes prizesIdGet($id)

Get existing Prize

In this case you must specify the id in the URL

Example

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

// Configure OAuth2 access token for authorization: oAuth2AuthCode
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\Client\Api\LoyaltyProgramPrizesApi(
    // 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 = "id_example"; // string | id of the Prize

try {
    $result = $apiInstance->prizesIdGet($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling LoyaltyProgramPrizesApi->prizesIdGet: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- id | string| id of the Prize |

Return type

\Swagger\Client\Model\ChainsPrizes

Authorization

oAuth2AuthCode

HTTP request headers

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

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

prizesIdPut

> \Swagger\Client\Model\ChainsPrizes prizesIdPut($body, $id)

Edit existing Prize

In this case you must specify the id in the URL and change the data you wanna update

Example

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

// Configure OAuth2 access token for authorization: oAuth2AuthCode
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\Client\Api\LoyaltyProgramPrizesApi(
    // 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
);
$body = new \Swagger\Client\Model\ChainsPrizes(); // \Swagger\Client\Model\ChainsPrizes | Object data that need to be updated
$id = "id_example"; // string | id of the Prize that need to be updated

try {
    $result = $apiInstance->prizesIdPut($body, $id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling LoyaltyProgramPrizesApi->prizesIdPut: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- body | \Swagger\Client\Model\ChainsPrizes| Object data that need to be updated | id | string| id of the Prize that need to be updated |

Return type

\Swagger\Client\Model\ChainsPrizes

Authorization

oAuth2AuthCode

HTTP request headers

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

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

prizesPost

> \Swagger\Client\Model\InlineResponse2012 prizesPost($body)

Add new Prize

Returns a Json with the data of the new Prize

Example

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

// Configure OAuth2 access token for authorization: oAuth2AuthCode
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Swagger\Client\Api\LoyaltyProgramPrizesApi(
    // 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
);
$body = new \Swagger\Client\Model\ChainsPrizes(); // \Swagger\Client\Model\ChainsPrizes | Prize object that needs to be added.

try {
    $result = $apiInstance->prizesPost($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling LoyaltyProgramPrizesApi->prizesPost: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- body | \Swagger\Client\Model\ChainsPrizes| Prize object that needs to be added. |

Return type

\Swagger\Client\Model\InlineResponse2012

Authorization

oAuth2AuthCode

HTTP request headers

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

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)