# Fortnox\FortnoxSuppliersApi



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

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**supplierControllerDoCreate()**](FortnoxSuppliersApi.md#supplierControllerDoCreate) | **POST** /3/suppliers | Create a supplier |
| [**supplierControllerDoIndex()**](FortnoxSuppliersApi.md#supplierControllerDoIndex) | **GET** /3/suppliers | Retrieve a list of suppliers |
| [**supplierControllerDoShow()**](FortnoxSuppliersApi.md#supplierControllerDoShow) | **GET** /3/suppliers/{SupplierNumber} | Retrieve a single supplier |
| [**supplierControllerDoUpdate()**](FortnoxSuppliersApi.md#supplierControllerDoUpdate) | **PUT** /3/suppliers/{SupplierNumber} | Update a supplier |


## `supplierControllerDoCreate()`

```php
supplierControllerDoCreate($supplier): \Fortnox\Model\FortnoxLfSupplierSingleItemWrap
```

Create a supplier

Create a supplier

### Example

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



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

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

### Parameters

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

### Return type

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

## `supplierControllerDoIndex()`

```php
supplierControllerDoIndex($suppliernumber, $name, $organisationnumber, $phone, $zipcode, $city, $email, $lastmodified): \Fortnox\Model\FortnoxLfSupplierListItemWrap
```

Retrieve a list of suppliers

The supplier register can return a list of records or a single record. By specifying a SupplierNumber in the URL, a single record will be returned. Not specifying a SupplierNumber will return a list of records.

### Example

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



$apiInstance = new Fortnox\Api\FortnoxSuppliersApi(
    // 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()
);
$suppliernumber = 'suppliernumber_example'; // string | filter on supplier number
$name = 'name_example'; // string | filter on name
$organisationnumber = 'organisationnumber_example'; // string | filter on organisation number
$phone = 'phone_example'; // string | filter on phone
$zipcode = 'zipcode_example'; // string | filter on zip code
$city = 'city_example'; // string | filter on city
$email = 'email_example'; // string | filter on email
$lastmodified = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | filter on last modified date

try {
    $result = $apiInstance->supplierControllerDoIndex($suppliernumber, $name, $organisationnumber, $phone, $zipcode, $city, $email, $lastmodified);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxSuppliersApi->supplierControllerDoIndex: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **suppliernumber** | **string**| filter on supplier number | [optional] |
| **name** | **string**| filter on name | [optional] |
| **organisationnumber** | **string**| filter on organisation number | [optional] |
| **phone** | **string**| filter on phone | [optional] |
| **zipcode** | **string**| filter on zip code | [optional] |
| **city** | **string**| filter on city | [optional] |
| **email** | **string**| filter on email | [optional] |
| **lastmodified** | **\DateTime**| filter on last modified date | [optional] |

### Return type

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

## `supplierControllerDoShow()`

```php
supplierControllerDoShow($supplier_number): \Fortnox\Model\FortnoxLfSupplierSingleItemWrap
```

Retrieve a single supplier

Retrieve a supplier

### Example

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



$apiInstance = new Fortnox\Api\FortnoxSuppliersApi(
    // 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()
);
$supplier_number = 'supplier_number_example'; // string | Supplier number of supplier to show

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **supplier_number** | **string**| Supplier number of supplier to show | |

### Return type

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

## `supplierControllerDoUpdate()`

```php
supplierControllerDoUpdate($supplier_number, $supplier): \Fortnox\Model\FortnoxLfSupplierSingleItemWrap
```

Update a supplier

Update a supplier

### Example

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



$apiInstance = new Fortnox\Api\FortnoxSuppliersApi(
    // 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()
);
$supplier_number = 'supplier_number_example'; // string | Supplier number of supplier to update
$supplier = new \Fortnox\Model\FortnoxLfSupplierSinglePayloadItemWrap(); // \Fortnox\Model\FortnoxLfSupplierSinglePayloadItemWrap | Request body for update supplier

try {
    $result = $apiInstance->supplierControllerDoUpdate($supplier_number, $supplier);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxSuppliersApi->supplierControllerDoUpdate: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **supplier_number** | **string**| Supplier number of supplier to update | |
| **supplier** | [**\Fortnox\Model\FortnoxLfSupplierSinglePayloadItemWrap**](../Model/FortnoxLfSupplierSinglePayloadItemWrap.md)| Request body for update supplier | [optional] |

### Return type

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