# Fortnox\WarehouseStockTakingApi



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

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**addStockTakingRows()**](WarehouseStockTakingApi.md#addStockTakingRows) | **POST** /api/warehouse/stocktaking-v1/{id}/rows | Add rows |
| [**addStockTakingRowsByFilter()**](WarehouseStockTakingApi.md#addStockTakingRowsByFilter) | **POST** /api/warehouse/stocktaking-v1/{id}/addrows | Add rows by filter |
| [**create2()**](WarehouseStockTakingApi.md#create2) | **POST** /api/warehouse/stocktaking-v1 | Create stock taking |
| [**deleteStockTaking()**](WarehouseStockTakingApi.md#deleteStockTaking) | **DELETE** /api/warehouse/stocktaking-v1/{id} | Delete Stock Taking document |
| [**deleteStockTakingRow()**](WarehouseStockTakingApi.md#deleteStockTakingRow) | **DELETE** /api/warehouse/stocktaking-v1/{id}/rows/{rowId} | Delete row |
| [**deleteStockTakingRowByFilter()**](WarehouseStockTakingApi.md#deleteStockTakingRowByFilter) | **DELETE** /api/warehouse/stocktaking-v1/{id}/rows | Delete rows by filter |
| [**get2()**](WarehouseStockTakingApi.md#get2) | **GET** /api/warehouse/stocktaking-v1/{id} | Get Stock Taking document |
| [**getAll1()**](WarehouseStockTakingApi.md#getAll1) | **GET** /api/warehouse/stocktaking-v1 | List stock takings |
| [**getCandidateRows()**](WarehouseStockTakingApi.md#getCandidateRows) | **GET** /api/warehouse/stocktaking-v1/{id}/candidates | Get candidate rows |
| [**getRows()**](WarehouseStockTakingApi.md#getRows) | **GET** /api/warehouse/stocktaking-v1/{id}/rows | Get Stock Taking Rows |
| [**release2()**](WarehouseStockTakingApi.md#release2) | **PUT** /api/warehouse/stocktaking-v1/{id}/release | Release Stock Taking document |
| [**update2()**](WarehouseStockTakingApi.md#update2) | **PUT** /api/warehouse/stocktaking-v1/{id} | Update a stock taking |
| [**voidStockTaking()**](WarehouseStockTakingApi.md#voidStockTaking) | **PUT** /api/warehouse/stocktaking-v1/{id}/void | Void Stock Taking document |


## `addStockTakingRows()`

```php
addStockTakingRows($id, $rows)
```

Add rows

<p>  Add rows to a stock taking.  If you add an already existing row noting happens.

### Example

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



$apiInstance = new Fortnox\Api\WarehouseStockTakingApi(
    // 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 | Stock Taking document id.
$rows = array(new \Fortnox\Model\WarehouseStockTakingRow()); // \Fortnox\Model\WarehouseStockTakingRow[] | A list of <code>StockTakingRows</code>.

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **int**| Stock Taking document id. | |
| **rows** | [**\Fortnox\Model\WarehouseStockTakingRow[]**](../Model/WarehouseStockTakingRow.md)| A list of &lt;code&gt;StockTakingRows&lt;/code&gt;. | [optional] |

### Return type

void (empty response body)

### 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)

## `addStockTakingRowsByFilter()`

```php
addStockTakingRowsByFilter($id, $item_ids, $supplier_numbers, $stock_point_ids, $stock_location_ids, $transaction_date, $item_id_search, $item_description_search, $exclude_zero_balance_items, $exclude_non_inbound_items): int
```

Add rows by filter

<p>  Add all matching candidate rows to a stock taking, as specified by filters.

### Example

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



$apiInstance = new Fortnox\Api\WarehouseStockTakingApi(
    // 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 | Stock Taking document id.
$item_ids = array('item_ids_example'); // string[]
$supplier_numbers = array('supplier_numbers_example'); // string[]
$stock_point_ids = array('stock_point_ids_example'); // string[]
$stock_location_ids = array('stock_location_ids_example'); // string[]
$transaction_date = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime
$item_id_search = 'item_id_search_example'; // string
$item_description_search = 'item_description_search_example'; // string
$exclude_zero_balance_items = True; // bool
$exclude_non_inbound_items = True; // bool

try {
    $result = $apiInstance->addStockTakingRowsByFilter($id, $item_ids, $supplier_numbers, $stock_point_ids, $stock_location_ids, $transaction_date, $item_id_search, $item_description_search, $exclude_zero_balance_items, $exclude_non_inbound_items);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WarehouseStockTakingApi->addStockTakingRowsByFilter: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **int**| Stock Taking document id. | |
| **item_ids** | [**string[]**](../Model/string.md)|  | [optional] |
| **supplier_numbers** | [**string[]**](../Model/string.md)|  | [optional] |
| **stock_point_ids** | [**string[]**](../Model/string.md)|  | [optional] |
| **stock_location_ids** | [**string[]**](../Model/string.md)|  | [optional] |
| **transaction_date** | **\DateTime**|  | [optional] |
| **item_id_search** | **string**|  | [optional] |
| **item_description_search** | **string**|  | [optional] |
| **exclude_zero_balance_items** | **bool**|  | [optional] |
| **exclude_non_inbound_items** | **bool**|  | [optional] |

### Return type

**int**

### 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)

## `create2()`

```php
create2($stock_taking): \Fortnox\Model\WarehouseStockTaking
```

Create stock taking

<p>  Create a new Stock Taking document.  The only mandatory fields are <code>name</code> and <code>responsible</code>.  <code>state</code> will be set to <code>planning</code> for a newly created document.  <p>  The <code>date</code>-field is not mandatory for documents in state <code>planning</code>.  However, when you update the state to <code>started</code> you have to provide a date.   <code>name</code> is a descriptive name of the stock taking.   <code>responsible</code> is the name of the responsible for the stock taking.   <code>rows</code> are added after creation by using the addRows-method.   <code>projectId</code> and <code>costCenterCode</code> are used for book-keeping, when the  Stock Taking document is released.  <p>  The field <code>usingStockPoints</code> is set from Warehouse system settings upon creation.  If multiple stockpoints is used, then the rows will be per item-stockPoint-stockLocation.  If multiple stockpoints is NOT used, then the rows will be per item-stockLocation.

### Example

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



$apiInstance = new Fortnox\Api\WarehouseStockTakingApi(
    // 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()
);
$stock_taking = new \Fortnox\Model\WarehouseStockTaking(); // \Fortnox\Model\WarehouseStockTaking | stock taking

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **stock_taking** | [**\Fortnox\Model\WarehouseStockTaking**](../Model/WarehouseStockTaking.md)| stock taking | [optional] |

### Return type

[**\Fortnox\Model\WarehouseStockTaking**](../Model/WarehouseStockTaking.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)

## `deleteStockTaking()`

```php
deleteStockTaking($id)
```

Delete Stock Taking document

<p>  Permanently deletes a Stock Taking document and its rows.  <p>  Only for documents in state <code>planning</code> and <code>started</code>.

### Example

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



$apiInstance = new Fortnox\Api\WarehouseStockTakingApi(
    // 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 | Stock Taking document id.

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **int**| Stock Taking document id. | |

### Return type

void (empty response body)

### 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)

## `deleteStockTakingRow()`

```php
deleteStockTakingRow($id, $row_id): int
```

Delete row

<p>  Remove single row by id from the Stock Taking document.

### Example

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



$apiInstance = new Fortnox\Api\WarehouseStockTakingApi(
    // 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 | Stock Taking document id.
$row_id = 'row_id_example'; // string | row id

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **int**| Stock Taking document id. | |
| **row_id** | **string**| row id | |

### Return type

**int**

### 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)

## `deleteStockTakingRowByFilter()`

```php
deleteStockTakingRowByFilter($id, $item_ids, $supplier_numbers, $stock_point_ids, $stock_location_ids, $transaction_date, $item_id_search, $item_description_search, $exclude_zero_balance_items): int
```

Delete rows by filter

<p>  Remove all rows matching the filter parameters from the Stock Taking document.

### Example

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



$apiInstance = new Fortnox\Api\WarehouseStockTakingApi(
    // 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 | Stock Taking document id.
$item_ids = array('item_ids_example'); // string[]
$supplier_numbers = array('supplier_numbers_example'); // string[]
$stock_point_ids = array('stock_point_ids_example'); // string[]
$stock_location_ids = array('stock_location_ids_example'); // string[]
$transaction_date = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime
$item_id_search = 'item_id_search_example'; // string
$item_description_search = 'item_description_search_example'; // string
$exclude_zero_balance_items = True; // bool

try {
    $result = $apiInstance->deleteStockTakingRowByFilter($id, $item_ids, $supplier_numbers, $stock_point_ids, $stock_location_ids, $transaction_date, $item_id_search, $item_description_search, $exclude_zero_balance_items);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WarehouseStockTakingApi->deleteStockTakingRowByFilter: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **int**| Stock Taking document id. | |
| **item_ids** | [**string[]**](../Model/string.md)|  | [optional] |
| **supplier_numbers** | [**string[]**](../Model/string.md)|  | [optional] |
| **stock_point_ids** | [**string[]**](../Model/string.md)|  | [optional] |
| **stock_location_ids** | [**string[]**](../Model/string.md)|  | [optional] |
| **transaction_date** | **\DateTime**|  | [optional] |
| **item_id_search** | **string**|  | [optional] |
| **item_description_search** | **string**|  | [optional] |
| **exclude_zero_balance_items** | **bool**|  | [optional] |

### Return type

**int**

### 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)

## `get2()`

```php
get2($id): \Fortnox\Model\WarehouseStockTaking
```

Get Stock Taking document

### Example

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



$apiInstance = new Fortnox\Api\WarehouseStockTakingApi(
    // 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 | Stock Taking document id.

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **int**| Stock Taking document id. | |

### Return type

[**\Fortnox\Model\WarehouseStockTaking**](../Model/WarehouseStockTaking.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)

## `getAll1()`

```php
getAll1($state, $item_id): \Fortnox\Model\WarehouseStockTaking
```

List stock takings

<p>  Sortable fields:  <code>id</code>,  <code>name</code>,  <code>date</code>,  <code>responsible</code>,  <code>state</code>  </p>

### Example

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



$apiInstance = new Fortnox\Api\WarehouseStockTakingApi(
    // 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()
);
$state = 'state_example'; // string | Include only stock takings with the given state.
$item_id = 'item_id_example'; // string | Include only stock takings with the given item.

try {
    $result = $apiInstance->getAll1($state, $item_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WarehouseStockTakingApi->getAll1: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **state** | **string**| Include only stock takings with the given state. | [optional] |
| **item_id** | **string**| Include only stock takings with the given item. | [optional] |

### Return type

[**\Fortnox\Model\WarehouseStockTaking**](../Model/WarehouseStockTaking.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)

## `getCandidateRows()`

```php
getCandidateRows($id, $item_ids, $supplier_numbers, $stock_point_ids, $stock_location_ids, $transaction_date, $item_id_search, $item_description_search, $exclude_zero_balance_items, $include_non_inbound_items): \Fortnox\Model\WarehouseStockTakingRow
```

Get candidate rows

<p>  A candidate row is a combination of itemId, stockPointId and stockLocationId  that can be added to the Stock Taking document.  <p>  Rows already added to the Stock Taking are excluded from this list.

### Example

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



$apiInstance = new Fortnox\Api\WarehouseStockTakingApi(
    // 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 | Stock Taking document id.
$item_ids = array('item_ids_example'); // string[]
$supplier_numbers = array('supplier_numbers_example'); // string[]
$stock_point_ids = array('stock_point_ids_example'); // string[]
$stock_location_ids = array('stock_location_ids_example'); // string[]
$transaction_date = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime
$item_id_search = 'item_id_search_example'; // string
$item_description_search = 'item_description_search_example'; // string
$exclude_zero_balance_items = True; // bool
$include_non_inbound_items = True; // bool | Include items that do not exist on inbound deliveries.

try {
    $result = $apiInstance->getCandidateRows($id, $item_ids, $supplier_numbers, $stock_point_ids, $stock_location_ids, $transaction_date, $item_id_search, $item_description_search, $exclude_zero_balance_items, $include_non_inbound_items);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WarehouseStockTakingApi->getCandidateRows: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **int**| Stock Taking document id. | |
| **item_ids** | [**string[]**](../Model/string.md)|  | [optional] |
| **supplier_numbers** | [**string[]**](../Model/string.md)|  | [optional] |
| **stock_point_ids** | [**string[]**](../Model/string.md)|  | [optional] |
| **stock_location_ids** | [**string[]**](../Model/string.md)|  | [optional] |
| **transaction_date** | **\DateTime**|  | [optional] |
| **item_id_search** | **string**|  | [optional] |
| **item_description_search** | **string**|  | [optional] |
| **exclude_zero_balance_items** | **bool**|  | [optional] |
| **include_non_inbound_items** | **bool**| Include items that do not exist on inbound deliveries. | [optional] |

### Return type

[**\Fortnox\Model\WarehouseStockTakingRow**](../Model/WarehouseStockTakingRow.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)

## `getRows()`

```php
getRows($id, $item_ids, $supplier_numbers, $stock_point_ids, $stock_location_ids, $transaction_date, $item_id_search, $item_description_search, $exclude_zero_balance_items, $secondarysortby, $secondaryorder, $state_filter, $starting_row_no, $starting_item_id): \Fortnox\Model\WarehouseStockTakingRow
```

Get Stock Taking Rows

### Example

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



$apiInstance = new Fortnox\Api\WarehouseStockTakingApi(
    // 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 | Stock Taking document id.
$item_ids = array('item_ids_example'); // string[]
$supplier_numbers = array('supplier_numbers_example'); // string[]
$stock_point_ids = array('stock_point_ids_example'); // string[]
$stock_location_ids = array('stock_location_ids_example'); // string[]
$transaction_date = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime
$item_id_search = 'item_id_search_example'; // string
$item_description_search = 'item_description_search_example'; // string
$exclude_zero_balance_items = True; // bool
$secondarysortby = 'secondarysortby_example'; // string | Secondary sorting column
$secondaryorder = 'secondaryorder_example'; // string | Secondary sorting order
$state_filter = 'state_filter_example'; // string
$starting_row_no = 56; // int | the row number to start the search from, used with startingItemId to jump to specific rows, can be empty
$starting_item_id = 'starting_item_id_example'; // string | the itemId that should be on top of the rows list (used to jump to specific row), can be empty

try {
    $result = $apiInstance->getRows($id, $item_ids, $supplier_numbers, $stock_point_ids, $stock_location_ids, $transaction_date, $item_id_search, $item_description_search, $exclude_zero_balance_items, $secondarysortby, $secondaryorder, $state_filter, $starting_row_no, $starting_item_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling WarehouseStockTakingApi->getRows: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **int**| Stock Taking document id. | |
| **item_ids** | [**string[]**](../Model/string.md)|  | [optional] |
| **supplier_numbers** | [**string[]**](../Model/string.md)|  | [optional] |
| **stock_point_ids** | [**string[]**](../Model/string.md)|  | [optional] |
| **stock_location_ids** | [**string[]**](../Model/string.md)|  | [optional] |
| **transaction_date** | **\DateTime**|  | [optional] |
| **item_id_search** | **string**|  | [optional] |
| **item_description_search** | **string**|  | [optional] |
| **exclude_zero_balance_items** | **bool**|  | [optional] |
| **secondarysortby** | **string**| Secondary sorting column | [optional] |
| **secondaryorder** | **string**| Secondary sorting order | [optional] |
| **state_filter** | **string**|  | [optional] |
| **starting_row_no** | **int**| the row number to start the search from, used with startingItemId to jump to specific rows, can be empty | [optional] |
| **starting_item_id** | **string**| the itemId that should be on top of the rows list (used to jump to specific row), can be empty | [optional] |

### Return type

[**\Fortnox\Model\WarehouseStockTakingRow**](../Model/WarehouseStockTakingRow.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)

## `release2()`

```php
release2($id)
```

Release Stock Taking document

<p>  The document will be locked and bookkept.  The Stock Taking document state will be set to <code>completed</code>.  The stock amount will be adjusted according to the stock taken quantity.

### Example

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



$apiInstance = new Fortnox\Api\WarehouseStockTakingApi(
    // 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 | Stock Taking document id.

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **int**| Stock Taking document id. | |

### Return type

void (empty response body)

### 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)

## `update2()`

```php
update2($id, $stock_taking): \Fortnox\Model\WarehouseStockTaking
```

Update a stock taking

<p>  Updates can only be done when state is <code>planning</code> or <code>started</code>.  <p>  All updatable fields (<code>date</code>, <code>name</code>, <code>responsible</code>,  <code>state</code>, <code>sortingId</code>, <code>costCenterCode</code>, <code>projectId</code>)  in the document head are set to supplied values.  <p>  You cannot set <code>state</code> to <code>completed</code> or <code>voided</code>. Use endpoints  release or void for this.  <p>  The <code>date</code>-field is mandatory for documents in state <code>started</code>.  <p>  When state is <code>started</code> you use this endpoint for setting the stock taken quantity.  Only existing rows can be updated - no new rows will be created (use the addRows endpoint for this).  Only the supplied rows will be updated. I.e. you don't have to send in <strong>all</strong>  document rows - just supply the rows you want to set stockTakenQuantity for. Just make sure  to always include all the fields from the document head as mentioned above.  <p>  The mandatory fields on the (optionally supplied) rows are: <code>itemId</code>,  <code>stockPointId</code>, <code>stockLocationId</code>.  Fields <code>countedBy</code> and <code>stockTakenQuantity</code> are technically  not mandatory, but will be set to null if you don't supply them.

### Example

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



$apiInstance = new Fortnox\Api\WarehouseStockTakingApi(
    // 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 | Stock Taking document id.
$stock_taking = new \Fortnox\Model\WarehouseStockTaking(); // \Fortnox\Model\WarehouseStockTaking | stock taking

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **int**| Stock Taking document id. | |
| **stock_taking** | [**\Fortnox\Model\WarehouseStockTaking**](../Model/WarehouseStockTaking.md)| stock taking | [optional] |

### Return type

[**\Fortnox\Model\WarehouseStockTaking**](../Model/WarehouseStockTaking.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)

## `voidStockTaking()`

```php
voidStockTaking($id)
```

Void Stock Taking document

<p>  Sets the Stock Taking document state to <code>voided</code>.  <p>  Only documents in state <code>planning</code> and <code>started</code>  can be voided. A <code>completed</code> document may not be voided.

### Example

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



$apiInstance = new Fortnox\Api\WarehouseStockTakingApi(
    // 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 | Stock Taking document id.

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **int**| Stock Taking document id. | |

### Return type

void (empty response body)

### 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)
