Skip to content

Latest commit

 

History

History
319 lines (221 loc) · 10.6 KB

ProductsApi.md

File metadata and controls

319 lines (221 loc) · 10.6 KB

FattureInCloud\ProductsApi

All URIs are relative to https://api-v2.fattureincloud.it, except if the operation defines another base path.

Method HTTP request Description
createProduct() POST /c/{company_id}/products Create Product
deleteProduct() DELETE /c/{company_id}/products/{product_id} Delete Product
getProduct() GET /c/{company_id}/products/{product_id} Get Product
listProducts() GET /c/{company_id}/products List Products
modifyProduct() PUT /c/{company_id}/products/{product_id} Modify Product

createProduct()

createProduct($company_id, $create_product_request): \FattureInCloud\Model\CreateProductResponse

Create Product

Creates a new product.

Example

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


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


$apiInstance = new FattureInCloud\Api\ProductsApi(
    // 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
);
    $company_id = 12345; // int | The ID of the company.$create_product_request = new \FattureInCloud\Model\CreateProductRequest; // \FattureInCloud\Model\CreateProductRequest | 
try {
    $result = $apiInstance->createProduct($company_id, $create_product_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductsApi->createProduct: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
company_id int The ID of the company.
create_product_request \FattureInCloud\Model\CreateProductRequest [optional]

Return type

\FattureInCloud\Model\CreateProductResponse

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

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

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

deleteProduct()

deleteProduct($company_id, $product_id)

Delete Product

Deletes the specified product.

Example

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


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


$apiInstance = new FattureInCloud\Api\ProductsApi(
    // 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
);
    $company_id = 12345; // int | The ID of the company.$product_id = 56; // int | The ID of the product.
try {
    $apiInstance->deleteProduct($company_id, $product_id);
} catch (Exception $e) {
    echo 'Exception when calling ProductsApi->deleteProduct: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
company_id int The ID of the company.
product_id int The ID of the product.

Return type

void (empty response body)

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

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

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

getProduct()

getProduct($company_id, $product_id, $fields, $fieldset): \FattureInCloud\Model\GetProductResponse

Get Product

Gets the specified product.

Example

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


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


$apiInstance = new FattureInCloud\Api\ProductsApi(
    // 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
);
    $company_id = 12345; // int | The ID of the company.$product_id = 56; // int | The ID of the product.$fields = 'fields_example'; // string | List of comma-separated fields.$fieldset = 'fieldset_example'; // string | Name of the fieldset.
try {
    $result = $apiInstance->getProduct($company_id, $product_id, $fields, $fieldset);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductsApi->getProduct: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
company_id int The ID of the company.
product_id int The ID of the product.
fields string List of comma-separated fields. [optional]
fieldset string Name of the fieldset. [optional]

Return type

\FattureInCloud\Model\GetProductResponse

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

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

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

listProducts()

listProducts($company_id, $fields, $fieldset, $sort, $page, $per_page, $q): \FattureInCloud\Model\ListProductsResponse

List Products

Lists the products.

Example

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


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


$apiInstance = new FattureInCloud\Api\ProductsApi(
    // 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
);
    $company_id = 12345; // int | The ID of the company.$fields = 'fields_example'; // string | List of comma-separated fields.$fieldset = 'fieldset_example'; // string | Name of the fieldset.$sort = 'sort_example'; // string | List of comma-separated fields for result sorting (minus for desc sorting).$page = 1; // int | The page to retrieve.$per_page = 5; // int | The size of the page.$q = 'q_example'; // string | Query for filtering the results.
try {
    $result = $apiInstance->listProducts($company_id, $fields, $fieldset, $sort, $page, $per_page, $q);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductsApi->listProducts: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
company_id int The ID of the company.
fields string List of comma-separated fields. [optional]
fieldset string Name of the fieldset. [optional]
sort string List of comma-separated fields for result sorting (minus for desc sorting). [optional]
page int The page to retrieve. [optional] [default to 1]
per_page int The size of the page. [optional] [default to 5]
q string Query for filtering the results. [optional]

Return type

\FattureInCloud\Model\ListProductsResponse

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

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

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

modifyProduct()

modifyProduct($company_id, $product_id, $modify_product_request): \FattureInCloud\Model\ModifyProductResponse

Modify Product

Modifies the specified product.

Example

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


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


$apiInstance = new FattureInCloud\Api\ProductsApi(
    // 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
);
    $company_id = 12345; // int | The ID of the company.$product_id = 56; // int | The ID of the product.$modify_product_request = new \FattureInCloud\Model\ModifyProductRequest; // \FattureInCloud\Model\ModifyProductRequest | Modified product details.
try {
    $result = $apiInstance->modifyProduct($company_id, $product_id, $modify_product_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ProductsApi->modifyProduct: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
company_id int The ID of the company.
product_id int The ID of the product.
modify_product_request \FattureInCloud\Model\ModifyProductRequest Modified product details. [optional]

Return type

\FattureInCloud\Model\ModifyProductResponse

Authorization

OAuth2AuthenticationCodeFlow

HTTP request headers

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

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