# Fortnox\FortnoxArticlesApi



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

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**articleControllerDoCreate()**](FortnoxArticlesApi.md#articleControllerDoCreate) | **POST** /3/articles | Create an article |
| [**articleControllerDoDelete()**](FortnoxArticlesApi.md#articleControllerDoDelete) | **DELETE** /3/articles/{ArticleNumber} | Delete an article |
| [**articleControllerDoIndex()**](FortnoxArticlesApi.md#articleControllerDoIndex) | **GET** /3/articles | Retrieve a list of articles |
| [**articleControllerDoShow()**](FortnoxArticlesApi.md#articleControllerDoShow) | **GET** /3/articles/{ArticleNumber} | Retrieve an article |
| [**articleControllerDoUpdate()**](FortnoxArticlesApi.md#articleControllerDoUpdate) | **PUT** /3/articles/{ArticleNumber} | Update an article |


## `articleControllerDoCreate()`

```php
articleControllerDoCreate($article): \Fortnox\Model\FortnoxArticleSingleItemWrap
```

Create an article

The created article will be returned if everything succeeded, if there were any problems an error will be returned.

### Example

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



$apiInstance = new Fortnox\Api\FortnoxArticlesApi(
    // 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()
);
$article = new \Fortnox\Model\FortnoxArticleSinglePayloadItemWrap(); // \Fortnox\Model\FortnoxArticleSinglePayloadItemWrap | Request body for create article

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **article** | [**\Fortnox\Model\FortnoxArticleSinglePayloadItemWrap**](../Model/FortnoxArticleSinglePayloadItemWrap.md)| Request body for create article | [optional] |

### Return type

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

## `articleControllerDoDelete()`

```php
articleControllerDoDelete($article_number)
```

Delete an article

<p>Deletes the article permanently.</p>  <p>You need to supply the unique article number that was returned when the article was created or retrieved from the list of articles.</p>

### Example

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



$apiInstance = new Fortnox\Api\FortnoxArticlesApi(
    // 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()
);
$article_number = 56; // int | identifies the article

try {
    $apiInstance->articleControllerDoDelete($article_number);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxArticlesApi->articleControllerDoDelete: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **article_number** | **int**| identifies the article | |

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

## `articleControllerDoIndex()`

```php
articleControllerDoIndex($filter, $sortby, $articlenumber, $description, $ean, $suppliernumber, $manufacturer, $manufacturerarticlenumber, $webshop, $lastmodified): \Fortnox\Model\FortnoxArticleListItemWrap
```

Retrieve a list of articles

Retrieves a list of articles. The articles are returned sorted by article number with the lowest number appearing first.

### Example

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



$apiInstance = new Fortnox\Api\FortnoxArticlesApi(
    // 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()
);
$filter = 'filter_example'; // string | possibility to filter supplier invoices
$sortby = 'sortby_example'; // string | field to sort returned list
$articlenumber = 'articlenumber_example'; // string | filter by article number
$description = 'description_example'; // string | filter by description
$ean = 'ean_example'; // string | filter by ean
$suppliernumber = 'suppliernumber_example'; // string | filter by supplier number
$manufacturer = 'manufacturer_example'; // string | filter by manufacturer
$manufacturerarticlenumber = 'manufacturerarticlenumber_example'; // string | filter by manufacturerarticlenumber
$webshop = 'webshop_example'; // string | filter by web shop
$lastmodified = 'lastmodified_example'; // string | filter by lastmodified

try {
    $result = $apiInstance->articleControllerDoIndex($filter, $sortby, $articlenumber, $description, $ean, $suppliernumber, $manufacturer, $manufacturerarticlenumber, $webshop, $lastmodified);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxArticlesApi->articleControllerDoIndex: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **filter** | **string**| possibility to filter supplier invoices | [optional] |
| **sortby** | **string**| field to sort returned list | [optional] |
| **articlenumber** | **string**| filter by article number | [optional] |
| **description** | **string**| filter by description | [optional] |
| **ean** | **string**| filter by ean | [optional] |
| **suppliernumber** | **string**| filter by supplier number | [optional] |
| **manufacturer** | **string**| filter by manufacturer | [optional] |
| **manufacturerarticlenumber** | **string**| filter by manufacturerarticlenumber | [optional] |
| **webshop** | **string**| filter by web shop | [optional] |
| **lastmodified** | **string**| filter by lastmodified | [optional] |

### Return type

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

## `articleControllerDoShow()`

```php
articleControllerDoShow($article_number): \Fortnox\Model\FortnoxArticleSingleItemWrap
```

Retrieve an article

Retrieves the details of an article. You need to supply the unique article number that was returned when the article was created or retrieved from the list of articles.

### Example

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



$apiInstance = new Fortnox\Api\FortnoxArticlesApi(
    // 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()
);
$article_number = 56; // int | identifies the article

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **article_number** | **int**| identifies the article | |

### Return type

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

## `articleControllerDoUpdate()`

```php
articleControllerDoUpdate($article_number, $article): \Fortnox\Model\FortnoxArticleSingleItemWrap
```

Update an article

Updates the specified article with the values provided in the properties. Any property not provided will be left unchanged.  You need to supply the unique article number that was returned when the article was created or retrieved from the list of articles.  Note that even though the article number is writeable you can not change the number of an existing article.

### Example

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



$apiInstance = new Fortnox\Api\FortnoxArticlesApi(
    // 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()
);
$article_number = 56; // int | identifies the article
$article = new \Fortnox\Model\FortnoxArticleSinglePayloadItemWrap(); // \Fortnox\Model\FortnoxArticleSinglePayloadItemWrap | Request body for update article

try {
    $result = $apiInstance->articleControllerDoUpdate($article_number, $article);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxArticlesApi->articleControllerDoUpdate: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **article_number** | **int**| identifies the article | |
| **article** | [**\Fortnox\Model\FortnoxArticleSinglePayloadItemWrap**](../Model/FortnoxArticleSinglePayloadItemWrap.md)| Request body for update article | [optional] |

### Return type

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