# Fortnox\FortnoxCustomersApi



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

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**customerControllerDoCreate()**](FortnoxCustomersApi.md#customerControllerDoCreate) | **POST** /3/customers | Create a customer |
| [**customerControllerDoDelete()**](FortnoxCustomersApi.md#customerControllerDoDelete) | **DELETE** /3/customers/{CustomerNumber} | Delete a customer |
| [**customerControllerDoIndex()**](FortnoxCustomersApi.md#customerControllerDoIndex) | **GET** /3/customers | Retrieve a list of customers |
| [**customerControllerDoShow()**](FortnoxCustomersApi.md#customerControllerDoShow) | **GET** /3/customers/{CustomerNumber} | Retrieve a customer |
| [**customerControllerDoUpdate()**](FortnoxCustomersApi.md#customerControllerDoUpdate) | **PUT** /3/customers/{CustomerNumber} | Update a customer |


## `customerControllerDoCreate()`

```php
customerControllerDoCreate($customer): \Fortnox\Model\FortnoxKfCustomerSingleItemWrap
```

Create a customer

The created customer 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\FortnoxCustomersApi(
    // 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()
);
$customer = new \Fortnox\Model\FortnoxKfCustomerSinglePayloadItemWrap(); // \Fortnox\Model\FortnoxKfCustomerSinglePayloadItemWrap | Request body for create customer

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

### Parameters

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

### Return type

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

## `customerControllerDoDelete()`

```php
customerControllerDoDelete($customer_number)
```

Delete a customer

Deletes the customer permanently. If everything succeeded the response will be of the type 204 \\u2013 No content and the response body will be empty. If there were any problems an error will be returned.  You need to supply the unique customer number of the customer that you want to delete.

### Example

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



$apiInstance = new Fortnox\Api\FortnoxCustomersApi(
    // 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()
);
$customer_number = 'customer_number_example'; // string | Customer number of customer to delete

try {
    $apiInstance->customerControllerDoDelete($customer_number);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxCustomersApi->customerControllerDoDelete: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **customer_number** | **string**| Customer number of customer to delete | |

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

## `customerControllerDoIndex()`

```php
customerControllerDoIndex($filter, $sortby, $customernumber, $name, $zipcode, $city, $email, $phone, $organisationnumber, $gln, $glndelivery, $lastmodified): \Fortnox\Model\FortnoxKfCustomerListItemWrap
```

Retrieve a list of customers

The customers are returned sorted by customer number with the lowest number appearing first.

### Example

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



$apiInstance = new Fortnox\Api\FortnoxCustomersApi(
    // 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 customers
$sortby = 'sortby_example'; // string | field to sort returned list
$customernumber = 'customernumber_example'; // string | filter by customer number
$name = 'name_example'; // string | filter by name
$zipcode = 'zipcode_example'; // string | filter by zip code
$city = 'city_example'; // string | filter by city
$email = 'email_example'; // string | filter by email
$phone = 'phone_example'; // string | filter by phone
$organisationnumber = 'organisationnumber_example'; // string | filter by organisation number
$gln = 'gln_example'; // string | filter by gln
$glndelivery = 'glndelivery_example'; // string | filter by gln delivery
$lastmodified = 'lastmodified_example'; // string | filter by last modified

try {
    $result = $apiInstance->customerControllerDoIndex($filter, $sortby, $customernumber, $name, $zipcode, $city, $email, $phone, $organisationnumber, $gln, $glndelivery, $lastmodified);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxCustomersApi->customerControllerDoIndex: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **filter** | **string**| possibility to filter customers | [optional] |
| **sortby** | **string**| field to sort returned list | [optional] |
| **customernumber** | **string**| filter by customer number | [optional] |
| **name** | **string**| filter by name | [optional] |
| **zipcode** | **string**| filter by zip code | [optional] |
| **city** | **string**| filter by city | [optional] |
| **email** | **string**| filter by email | [optional] |
| **phone** | **string**| filter by phone | [optional] |
| **organisationnumber** | **string**| filter by organisation number | [optional] |
| **gln** | **string**| filter by gln | [optional] |
| **glndelivery** | **string**| filter by gln delivery | [optional] |
| **lastmodified** | **string**| filter by last modified | [optional] |

### Return type

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

## `customerControllerDoShow()`

```php
customerControllerDoShow($customer_number): \Fortnox\Model\FortnoxKfCustomerSingleItemWrap
```

Retrieve a customer

You need to supply the unique customer number that was returned when the customer was created or retrieved from the list of customers.

### Example

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



$apiInstance = new Fortnox\Api\FortnoxCustomersApi(
    // 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()
);
$customer_number = 'customer_number_example'; // string | Customer number of customer to show

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **customer_number** | **string**| Customer number of customer to show | |

### Return type

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

## `customerControllerDoUpdate()`

```php
customerControllerDoUpdate($customer_number, $customer): \Fortnox\Model\FortnoxKfCustomerSingleItemWrap
```

Update a customer

<p>The updated customer will be returned if everything succeeded, if there were any problems an error will be returned.</p>  <p>You need to supply the unique customer number of the customer that you want to update.</p>  <p>Only the properties provided in the request body will be updated, properties not provided will be left unchanged.</p>

### Example

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



$apiInstance = new Fortnox\Api\FortnoxCustomersApi(
    // 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()
);
$customer_number = 'customer_number_example'; // string | Customer number of customer to update
$customer = new \Fortnox\Model\FortnoxKfCustomerSinglePayloadItemWrap(); // \Fortnox\Model\FortnoxKfCustomerSinglePayloadItemWrap | Request body for update customer

try {
    $result = $apiInstance->customerControllerDoUpdate($customer_number, $customer);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxCustomersApi->customerControllerDoUpdate: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **customer_number** | **string**| Customer number of customer to update | |
| **customer** | [**\Fortnox\Model\FortnoxKfCustomerSinglePayloadItemWrap**](../Model/FortnoxKfCustomerSinglePayloadItemWrap.md)| Request body for update customer | [optional] |

### Return type

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