# CreditArrangementsApi

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

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**_delete**](#_delete) | **DELETE** /creditarrangements/{creditArrangementId} | Delete credit arrangement|
|[**addAccount**](#addaccount) | **POST** /creditarrangements/{creditArrangementId}:addAccount | Add account to credit arrangement|
|[**changeState**](#changestate) | **POST** /creditarrangements/{creditArrangementId}:changeState | Change credit arrangement state|
|[**create**](#create) | **POST** /creditarrangements | Create credit arrangement|
|[**getAll**](#getall) | **GET** /creditarrangements | Get credit arrangements|
|[**getAllAccounts**](#getallaccounts) | **GET** /creditarrangements/{creditArrangementId}/accounts | Get all loan and deposit accounts linked to credit arrangement|
|[**getById**](#getbyid) | **GET** /creditarrangements/{creditArrangementId} | Get credit arrangement|
|[**getSchedule**](#getschedule) | **GET** /creditarrangements/{creditArrangementId}/schedule | Get credit arrangement schedule|
|[**patch**](#patch) | **PATCH** /creditarrangements/{creditArrangementId} | Partially update credit arrangement|
|[**removeAccount**](#removeaccount) | **POST** /creditarrangements/{creditArrangementId}:removeAccount | Remove account from credit arrangement|
|[**update**](#update) | **PUT** /creditarrangements/{creditArrangementId} | Update credit arrangement|

# **_delete**
> _delete()


### Example

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

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

let creditArrangementId: string; //The ID or encoded key of the credit arrangement to be deleted. (default to undefined)

const { status, data } = await apiInstance._delete(
    creditArrangementId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **creditArrangementId** | [**string**] | The ID or encoded key of the credit arrangement 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** | Credit arrangement deleted. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Credit arrangement 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)

# **addAccount**
> CreditArrangementAccounts addAccount(addCreditArrangementAccountInput)


### Example

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

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

let creditArrangementId: string; //The ID or encoded key of the credit arrangement for an account to be added. (default to undefined)
let addCreditArrangementAccountInput: AddCreditArrangementAccountInput; //The account ID and type to be added to the credit arrangement.
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.addAccount(
    creditArrangementId,
    addCreditArrangementAccountInput,
    idempotencyKey
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **addCreditArrangementAccountInput** | **AddCreditArrangementAccountInput**| The account ID and type to be added to the credit arrangement. | |
| **creditArrangementId** | [**string**] | The ID or encoded key of the credit arrangement for an account to be added. | 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

**CreditArrangementAccounts**

### 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. |  -  |
|**200** | Account assigned to the credit arrangement. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Credit arrangement or account 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)

# **changeState**
> CreditArrangement changeState(creditArrangementAction)


### Example

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

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

let creditArrangementId: string; //The ID or encoded key of the credit arrangement to be updated. (default to undefined)
let creditArrangementAction: CreditArrangementAction; //The state change to perform on the credit arrangement.
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.changeState(
    creditArrangementId,
    creditArrangementAction,
    idempotencyKey
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **creditArrangementAction** | **CreditArrangementAction**| The state change to perform on the credit arrangement. | |
| **creditArrangementId** | [**string**] | The ID or encoded key of the credit arrangement to be updated. | 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

**CreditArrangement**

### 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. |  -  |
|**200** | Credit arrangement state change posted. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Credit arrangement 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)

# **create**
> CreditArrangement create(creditArrangement)


### Example

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

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

let creditArrangement: CreditArrangement; //Credit arrangement 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.create(
    creditArrangement,
    idempotencyKey
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **creditArrangement** | **CreditArrangement**| Credit arrangement to be created. | |
| **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

**CreditArrangement**

### 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** | Credit arrangement 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)

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


### Example

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

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

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 detailsLevel: 'BASIC' | 'FULL'; //The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. (optional) (default to undefined)
let sortBy: string; //The criteria based on which the records will be sorted. Expected format is <field:order>, for example, sortBy = field1:ASC,field2:DESC.<br/>Only the following fields can be used: creationDate,startDate,expireDate,amount<br/>Default sorting is done by startDate:DESC (optional) (default to undefined)

const { status, data } = await apiInstance.getAll(
    offset,
    limit,
    paginationDetails,
    detailsLevel,
    sortBy
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **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'|
| **detailsLevel** | [**&#39;BASIC&#39; | &#39;FULL&#39;**]**Array<&#39;BASIC&#39; &#124; &#39;FULL&#39;>** | The level of details to return: &#x60;FULL&#x60; means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and &#x60;BASIC&#x60; will return only the first level elements of the object. | (optional) defaults to undefined|
| **sortBy** | [**string**] | The criteria based on which the records will be sorted. Expected format is &lt;field:order&gt;, for example, sortBy &#x3D; field1:ASC,field2:DESC.&lt;br/&gt;Only the following fields can be used: creationDate,startDate,expireDate,amount&lt;br/&gt;Default sorting is done by startDate:DESC | (optional) defaults to undefined|


### Return type

**Array<CreditArrangement>**

### 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** | Credit arrangements 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 |  -  |

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

# **getAllAccounts**
> CreditArrangementAccounts getAllAccounts()


### Example

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

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

let creditArrangementId: string; //The ID or encoded key of the credit arrangement to be returned. (default to undefined)

const { status, data } = await apiInstance.getAllAccounts(
    creditArrangementId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **creditArrangementId** | [**string**] | The ID or encoded key of the credit arrangement to be returned. | defaults to undefined|


### Return type

**CreditArrangementAccounts**

### 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** | Credit arrangement accounts returned. |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Credit arrangement 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)

# **getById**
> CreditArrangement getById()


### Example

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

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

let creditArrangementId: string; //The ID or encoded key of the credit arrangement to be returned. (default to undefined)
let detailsLevel: 'BASIC' | 'FULL'; //The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. (optional) (default to undefined)

const { status, data } = await apiInstance.getById(
    creditArrangementId,
    detailsLevel
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **creditArrangementId** | [**string**] | The ID or encoded key of the credit arrangement to be returned. | defaults to undefined|
| **detailsLevel** | [**&#39;BASIC&#39; | &#39;FULL&#39;**]**Array<&#39;BASIC&#39; &#124; &#39;FULL&#39;>** | The level of details to return: &#x60;FULL&#x60; means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and &#x60;BASIC&#x60; will return only the first level elements of the object. | (optional) defaults to undefined|


### Return type

**CreditArrangement**

### 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** | Credit arrangement returned. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Credit arrangement 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)

# **getSchedule**
> CreditArrangementSchedule getSchedule()


### Example

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

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

let creditArrangementId: string; //The ID or encoded key of the credit arrangement to be returned. (default to undefined)
let detailsLevel: 'BASIC' | 'FULL'; //The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. (optional) (default to undefined)

const { status, data } = await apiInstance.getSchedule(
    creditArrangementId,
    detailsLevel
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **creditArrangementId** | [**string**] | The ID or encoded key of the credit arrangement to be returned. | defaults to undefined|
| **detailsLevel** | [**&#39;BASIC&#39; | &#39;FULL&#39;**]**Array<&#39;BASIC&#39; &#124; &#39;FULL&#39;>** | The level of details to return: &#x60;FULL&#x60; means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and &#x60;BASIC&#x60; will return only the first level elements of the object. | (optional) defaults to undefined|


### Return type

**CreditArrangementSchedule**

### 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** | Credit arrangement schedule returned. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Credit arrangement 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)

# **patch**
> patch(patchOperation)


### Example

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

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

let creditArrangementId: string; //The ID or encoded key of the credit arrangement to be updated. (default to undefined)
let patchOperation: Array<PatchOperation>; //Patch operations to be applied to a resource.

const { status, data } = await apiInstance.patch(
    creditArrangementId,
    patchOperation
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **patchOperation** | **Array<PatchOperation>**| Patch operations to be applied to a resource. | |
| **creditArrangementId** | [**string**] | The ID or encoded key of the credit arrangement to be updated. | defaults to undefined|


### Return type

void (empty response body)

### 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 |
|-------------|-------------|------------------|
|**204** | Credit arrangement updated. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Credit arrangement 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)

# **removeAccount**
> CreditArrangementAccounts removeAccount(removeCreditArrangementAccountInput)


### Example

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

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

let creditArrangementId: string; //The ID or encoded key of the credit arrangement for an account to be removed. (default to undefined)
let removeCreditArrangementAccountInput: RemoveCreditArrangementAccountInput; //The account ID and type to be removed from the credit arrangement.
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.removeAccount(
    creditArrangementId,
    removeCreditArrangementAccountInput,
    idempotencyKey
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **removeCreditArrangementAccountInput** | **RemoveCreditArrangementAccountInput**| The account ID and type to be removed from the credit arrangement. | |
| **creditArrangementId** | [**string**] | The ID or encoded key of the credit arrangement for an account to be removed. | 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

**CreditArrangementAccounts**

### 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. |  -  |
|**200** | Account removed from the credit arrangement. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Credit arrangement or account 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)

# **update**
> CreditArrangement update(creditArrangement)


### Example

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

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

let creditArrangementId: string; //The ID or encoded key of the credit arrangement to be updated. (default to undefined)
let creditArrangement: CreditArrangement; //Credit arrangement to be updated.

const { status, data } = await apiInstance.update(
    creditArrangementId,
    creditArrangement
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **creditArrangement** | **CreditArrangement**| Credit arrangement to be updated. | |
| **creditArrangementId** | [**string**] | The ID or encoded key of the credit arrangement to be updated. | defaults to undefined|


### Return type

**CreditArrangement**

### 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 |
|-------------|-------------|------------------|
|**200** | Credit arrangement updated. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Credit arrangement 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)

