# SmartVolution\V1taxesApi

All URIs are relative to http://dev.smartvolution.com:9003.

Method | HTTP request | Description
------------- | ------------- | -------------
[**createTax()**](V1taxesApi.md#createTax) | **POST** /v1/taxes | Create a tax in the system
[**deleteTaxById()**](V1taxesApi.md#deleteTaxById) | **DELETE** /v1/taxes/{id} | Deletes a tax by their id
[**findTaxById()**](V1taxesApi.md#findTaxById) | **GET** /v1/taxes/{id} | Gets tax details by their id
[**getAllTaxes()**](V1taxesApi.md#getAllTaxes) | **GET** /v1/taxes | Gets a list of all the taxes for a tenant
[**updateTax()**](V1taxesApi.md#updateTax) | **PATCH** /v1/taxes | edit an existing tax in the system


## `createTax()`

```php
createTax($tax)
```

Create a tax in the system

This is not finalised as there is no authentication

### Example

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



$apiInstance = new SmartVolution\Api\V1taxesApi(
    // 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()
);
$tax = new \SmartVolution\Model\TaxIn(); // \SmartVolution\Model\TaxIn | Tax object that need to be created

try {
    $apiInstance->createTax($tax);
} catch (Exception $e) {
    echo 'Exception when calling V1taxesApi->createTax: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **tax** | [**\SmartVolution\Model\TaxIn**](../Model/TaxIn.md)| Tax object that need to be created |

### Return type

void (empty response body)

### Authorization

No authorization required

### HTTP request headers

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

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

## `deleteTaxById()`

```php
deleteTaxById($id)
```

Deletes a tax by their id

Non-Destructive in the database (Tax are flagged as deleted)

### Example

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



$apiInstance = new SmartVolution\Api\V1taxesApi(
    // 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()
);
$id = 56; // int | Id of user to delete

try {
    $apiInstance->deleteTaxById($id);
} catch (Exception $e) {
    echo 'Exception when calling V1taxesApi->deleteTaxById: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **int**| Id of user to delete |

### Return type

void (empty response body)

### Authorization

No authorization required

### HTTP request headers

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

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

## `findTaxById()`

```php
findTaxById($id): \SmartVolution\Model\Tax
```

Gets tax details by their id

Authenticated Devices do not have access to this call

### Example

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



$apiInstance = new SmartVolution\Api\V1taxesApi(
    // 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()
);
$id = 56; // int | Id of tax to query

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **int**| Id of tax to query |

### Return type

[**\SmartVolution\Model\Tax**](../Model/Tax.md)

### Authorization

No authorization required

### HTTP request headers

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

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

## `getAllTaxes()`

```php
getAllTaxes($tenant, $since, $deleted): \SmartVolution\Model\Tax[]
```

Gets a list of all the taxes for a tenant

if no tenant id is passed then will default to the user/device tenant

### Example

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



$apiInstance = new SmartVolution\Api\V1taxesApi(
    // 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()
);
$tenant = 56; // int | Id of Tenant to query
$since = 56; // int | a time in seconds since midnight January 1st 1970 UTC
$deleted = True; // bool | Shows only records that have been deleted

try {
    $result = $apiInstance->getAllTaxes($tenant, $since, $deleted);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling V1taxesApi->getAllTaxes: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **tenant** | **int**| Id of Tenant to query | [optional]
 **since** | **int**| a time in seconds since midnight January 1st 1970 UTC | [optional]
 **deleted** | **bool**| Shows only records that have been deleted | [optional]

### Return type

[**\SmartVolution\Model\Tax[]**](../Model/Tax.md)

### Authorization

No authorization required

### HTTP request headers

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

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

## `updateTax()`

```php
updateTax($tax)
```

edit an existing tax in the system

This is not finalised as there is no security

### Example

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



$apiInstance = new SmartVolution\Api\V1taxesApi(
    // 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()
);
$tax = new \SmartVolution\Model\TaxInEdit(); // \SmartVolution\Model\TaxInEdit | User object containing edited fields

try {
    $apiInstance->updateTax($tax);
} catch (Exception $e) {
    echo 'Exception when calling V1taxesApi->updateTax: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **tax** | [**\SmartVolution\Model\TaxInEdit**](../Model/TaxInEdit.md)| User object containing edited fields |

### Return type

void (empty response body)

### Authorization

No authorization required

### HTTP request headers

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

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