# IndexRatesApi

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

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**createIndexRate**](#createindexrate) | **POST** /indexratesources/{indexRateSourceId}/indexrates | Create index rate|
|[**deleteIndexRate**](#deleteindexrate) | **DELETE** /indexratesources/{indexRateSourceId}/indexrates/{indexRateId} | Delete index rate|
|[**getAllIndexRates**](#getallindexrates) | **GET** /indexratesources/{indexRateSourceId}/indexrates | Get index rates for a source|

# **createIndexRate**
> IndexRate createIndexRate(indexRate)


### Example

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

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

let indexRateSourceId: string; //The ID of the index rate source. (default to undefined)
let indexRate: IndexRate; //Index rate to be created.
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.createIndexRate(
    indexRateSourceId,
    indexRate,
    idempotencyKey
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **indexRate** | **IndexRate**| Index rate to be created. | |
| **indexRateSourceId** | [**string**] | The ID of the index rate source. | 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

**IndexRate**

### 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** | Index rate created. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |

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

# **deleteIndexRate**
> deleteIndexRate()


### Example

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

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

let indexRateSourceId: string; //The ID of the index rate source. (default to undefined)
let indexRateId: string; //The encoded key of the index rate to be deleted. (default to undefined)

const { status, data } = await apiInstance.deleteIndexRate(
    indexRateSourceId,
    indexRateId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **indexRateSourceId** | [**string**] | The ID of the index rate source. | defaults to undefined|
| **indexRateId** | [**string**] | The encoded key of the index rate to be deleted. | defaults to undefined|


### Return type

void (empty response body)

### 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 |
|-------------|-------------|------------------|
|**204** | Index rate deleted. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Index rate 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)

# **getAllIndexRates**
> Array<IndexRate> getAllIndexRates()


### Example

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

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

let indexRateSourceId: string; //The ID of the index rate source. (default to undefined)

const { status, data } = await apiInstance.getAllIndexRates(
    indexRateSourceId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **indexRateSourceId** | [**string**] | The ID of the index rate source. | defaults to undefined|


### Return type

**Array<IndexRate>**

### 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** | Index rates list returned. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |

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

