# AccountingRatesApi

All URIs are relative to *http://localhost:8889/api*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**create**](#create) | **POST** /currencies/{currencyCode}/accountingRates | Create accounting rates|
|[**getAll**](#getall) | **GET** /currencies/{currencyCode}/accountingRates | Get accounting rates|

# **create**
> AccountingRate create(postAccountingRateDTO)


### Example

```typescript
import {
    AccountingRatesApi,
    Configuration,
    PostAccountingRateDTO
} from './api';

const configuration = new Configuration();
const apiInstance = new AccountingRatesApi(configuration);

let currencyCode: string; //The currency code. (default to undefined)
let postAccountingRateDTO: PostAccountingRateDTO; //Represents the information to create an accounting rate.
let idempotencyKey: string; //Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. (optional) (default to undefined)

const { status, data } = await apiInstance.create(
    currencyCode,
    postAccountingRateDTO,
    idempotencyKey
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **postAccountingRateDTO** | **PostAccountingRateDTO**| Represents the information to create an accounting rate. | |
| **currencyCode** | [**string**] | The currency code. | defaults to undefined|
| **idempotencyKey** | [**string**] | Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. | (optional) defaults to undefined|


### Return type

**AccountingRate**

### Authorization

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

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**102** | Your idempotent request was already submitted and is currently being processed, try again later. |  -  |
|**201** | The accounting rate has been created. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Currency not found. |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getAll**
> Array<AccountingRate> getAll()


### Example

```typescript
import {
    AccountingRatesApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new AccountingRatesApi(configuration);

let currencyCode: string; //The currency code. (default to undefined)
let offset: number; //Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results (optional) (default to undefined)
let limit: number; //Pagination, the number of elements to retrieve, used in combination with offset to paginate results (optional) (default to undefined)
let paginationDetails: 'ON' | 'OFF'; //Flag specifying whether the pagination  details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs (optional) (default to 'OFF')
let from: string; //The date and time of the Accounting Rates to search from (optional) (default to undefined)
let to: string; //The date and time of the Accounting Rates to search to (optional) (default to undefined)

const { status, data } = await apiInstance.getAll(
    currencyCode,
    offset,
    limit,
    paginationDetails,
    from,
    to
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **currencyCode** | [**string**] | The currency code. | defaults to undefined|
| **offset** | [**number**] | Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results | (optional) defaults to undefined|
| **limit** | [**number**] | Pagination, the number of elements to retrieve, used in combination with offset to paginate results | (optional) defaults to undefined|
| **paginationDetails** | [**&#39;ON&#39; | &#39;OFF&#39;**]**Array<&#39;ON&#39; &#124; &#39;OFF&#39;>** | Flag specifying whether the pagination  details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs | (optional) defaults to 'OFF'|
| **from** | [**string**] | The date and time of the Accounting Rates to search from | (optional) defaults to undefined|
| **to** | [**string**] | The date and time of the Accounting Rates to search to | (optional) defaults to undefined|


### Return type

**Array<AccountingRate>**

### Authorization

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

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Accounting rates list returned. |  * Items-Limit - Pagination details, the requested page size <br>  * Items-Offset - Pagination details, the index of the first returned item <br>  * Items-Total - Pagination details, the total available items <br>  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Currency not found. |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

