# Fortnox\WarehouseStockPointApi



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

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**appendStockLocations()**](WarehouseStockPointApi.md#appendStockLocations) | **POST** /api/warehouse/stockpoints-v1/{id} | Append stock locations |
| [**create3()**](WarehouseStockPointApi.md#create3) | **POST** /api/warehouse/stockpoints-v1 | Create stock point |
| [**delete()**](WarehouseStockPointApi.md#delete) | **DELETE** /api/warehouse/stockpoints-v1/{id} | Delete stock point |
| [**getAll2()**](WarehouseStockPointApi.md#getAll2) | **GET** /api/warehouse/stockpoints-v1 | List stock points |
| [**getByAmbiguousId()**](WarehouseStockPointApi.md#getByAmbiguousId) | **GET** /api/warehouse/stockpoints-v1/{id} | Get stock point |
| [**getMany3()**](WarehouseStockPointApi.md#getMany3) | **GET** /api/warehouse/stockpoints-v1/multi | Get stock points |
| [**getStockLocationsByAmbiguousId()**](WarehouseStockPointApi.md#getStockLocationsByAmbiguousId) | **GET** /api/warehouse/stockpoints-v1/{id}/stocklocations | Get stock locations |
| [**update3()**](WarehouseStockPointApi.md#update3) | **PUT** /api/warehouse/stockpoints-v1/{id} | Update stock point |


## `appendStockLocations()`

```php
appendStockLocations($id, $stock_locations): \Fortnox\Model\WarehouseStockLocation
```

Append stock locations

<p>  Add new stock locations to specific <code>StockPoint</code>.  <p>  If you include an already existing stock location code, it will be ignored.

### Example

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



$apiInstance = new Fortnox\Api\WarehouseStockPointApi(
    // 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 = 'id_example'; // string | stock point id
$stock_locations = array(new \Fortnox\Model\WarehouseStockLocation()); // \Fortnox\Model\WarehouseStockLocation[] | A list of <code>StockLocations</code> to append.

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **string**| stock point id | |
| **stock_locations** | [**\Fortnox\Model\WarehouseStockLocation[]**](../Model/WarehouseStockLocation.md)| A list of &lt;code&gt;StockLocations&lt;/code&gt; to append. | [optional] |

### Return type

[**\Fortnox\Model\WarehouseStockLocation**](../Model/WarehouseStockLocation.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: `application/json`
- **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)

## `create3()`

```php
create3($stock_point): \Fortnox\Model\WarehouseStockPoint
```

Create stock point

<p>  Both <code>code</code> and <code>name</code> are mandatory.  <p>  If you want to set a custom delivery address for this stock point,  you must remember to set <code>usingCompanyAddress</code> to <code>false</code>.  <p>  Returns 400 <code>alreadyexists</code> if a stock point with same code already exists.  <p>  Returns 400 <code>duplicatestocklocations</code> if two or more stock locations have the same code.

### Example

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



$apiInstance = new Fortnox\Api\WarehouseStockPointApi(
    // 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_point = new \Fortnox\Model\WarehouseStockPoint(); // \Fortnox\Model\WarehouseStockPoint | stock point

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **stock_point** | [**\Fortnox\Model\WarehouseStockPoint**](../Model/WarehouseStockPoint.md)| stock point | [optional] |

### Return type

[**\Fortnox\Model\WarehouseStockPoint**](../Model/WarehouseStockPoint.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: `application/json`
- **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)

## `delete()`

```php
delete($id): \Fortnox\Model\WarehouseStockPoint
```

Delete stock point

<p>  Note that it is not allowed to delete a stock point that is in use.

### Example

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



$apiInstance = new Fortnox\Api\WarehouseStockPointApi(
    // 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 = 'id_example'; // string | id

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **string**| id | |

### Return type

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

## `getAll2()`

```php
getAll2($q, $state): \Fortnox\Model\WarehouseStockPoint
```

List stock points

<p>  List stock points, optionally include a query parameter `q` to filter on stock point code or name.  <p>  Use query param `state` to filter on ACTIVE, INACTIVE or ALL (default is to include only ACTIVE stock points).  <p>  Stock locations are NOT included in the response.

### Example

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



$apiInstance = new Fortnox\Api\WarehouseStockPointApi(
    // 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()
);
$q = 'q_example'; // string | filters on stock point code or name.
$state = 'state_example'; // string | filter on stock point state

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **q** | **string**| filters on stock point code or name. | [optional] |
| **state** | **string**| filter on stock point state | [optional] |

### Return type

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

## `getByAmbiguousId()`

```php
getByAmbiguousId($id): \Fortnox\Model\WarehouseStockPoint
```

Get stock point

<p>  Get stock point by id or code.

### Example

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



$apiInstance = new Fortnox\Api\WarehouseStockPointApi(
    // 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 = 'id_example'; // string | stock point code, or stock point id

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **string**| stock point code, or stock point id | |

### Return type

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

## `getMany3()`

```php
getMany3($ids, $state): \Fortnox\Model\WarehouseStockPoint
```

Get stock points

<p>  Get stock points by IDs.  <p>  Use query param `state` to filter on ACTIVE, INACTIVE or ALL (default is to include ALL stock points).  <p>  Stock locations are NOT included in the response.

### Example

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



$apiInstance = new Fortnox\Api\WarehouseStockPointApi(
    // 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()
);
$ids = array('ids_example'); // string[] | stock point ids (comma separated list of UUIDs)
$state = 'state_example'; // string | filter on <code>StockPointState</code>, default is to include ALL stock points.

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **ids** | [**string[]**](../Model/string.md)| stock point ids (comma separated list of UUIDs) | [optional] |
| **state** | **string**| filter on &lt;code&gt;StockPointState&lt;/code&gt;, default is to include ALL stock points. | [optional] |

### Return type

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

## `getStockLocationsByAmbiguousId()`

```php
getStockLocationsByAmbiguousId($id, $q): \Fortnox\Model\WarehouseStockLocation
```

Get stock locations

<p>  List stock locations for a specific stock point.  <p>  Optionally include a query parameter `q` to filter on stock location code or name.

### Example

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



$apiInstance = new Fortnox\Api\WarehouseStockPointApi(
    // 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 = 'id_example'; // string | stock point id or code
$q = 'q_example'; // string | filters on stock location code or name.

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **string**| stock point id or code | |
| **q** | **string**| filters on stock location code or name. | [optional] |

### Return type

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

## `update3()`

```php
update3($id, $stock_point): \Fortnox\Model\WarehouseStockPoint
```

Update stock point

<p>  Remember to supply the complete representation of stock point including stock locations.

### Example

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



$apiInstance = new Fortnox\Api\WarehouseStockPointApi(
    // 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 = 'id_example'; // string | id
$stock_point = new \Fortnox\Model\WarehouseStockPoint(); // \Fortnox\Model\WarehouseStockPoint | complete representation of stock point including stock locations.

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **string**| id | |
| **stock_point** | [**\Fortnox\Model\WarehouseStockPoint**](../Model/WarehouseStockPoint.md)| complete representation of stock point including stock locations. | [optional] |

### Return type

[**\Fortnox\Model\WarehouseStockPoint**](../Model/WarehouseStockPoint.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: `application/json`
- **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)
