# Sylius\StatisticsApi



All URIs are relative to http://localhost, except if the operation defines another base path.

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**getStatistics()**](StatisticsApi.md#getStatistics) | **GET** /api/v2/admin/statistics | Get statistics |


## `getStatistics()`

```php
getStatistics($channel_code, $start_date, $interval, $end_date): \Sylius\Model\Statistics
```

Get statistics

Get statistics

### Example

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


// Configure Bearer (JWT) authorization: JWT
$config = Sylius\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Sylius\Api\StatisticsApi(
    // 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(),
    $config
);
$channel_code = 'channel_code_example'; // string | Channel to get statistics for
$start_date = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | Start date for statistics
$interval = 'month'; // string | Interval type for statistics
$end_date = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | End date for statistics

try {
    $result = $apiInstance->getStatistics($channel_code, $start_date, $interval, $end_date);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling StatisticsApi->getStatistics: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **channel_code** | **string**| Channel to get statistics for | |
| **start_date** | **\DateTime**| Start date for statistics | |
| **interval** | **string**| Interval type for statistics | [default to &#39;month&#39;] |
| **end_date** | **\DateTime**| End date for statistics | |

### Return type

[**\Sylius\Model\Statistics**](../Model/Statistics.md)

### Authorization

[JWT](../../README.md#JWT)

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