# GLAccountsApi

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

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**create**](#create) | **POST** /glaccounts | Create general ledger account|
|[**getAll**](#getall) | **GET** /glaccounts | Get general ledger accounts|
|[**getById**](#getbyid) | **GET** /glaccounts/{glAccountId} | Get general ledger account|
|[**patch**](#patch) | **PATCH** /glaccounts/{glAccountId} | Partially update an existing general ledger account|

# **create**
> Array<GLAccount> create(gLAccountInput)


### Example

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

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

let gLAccountInput: Array<GLAccountInput>; //Represents the information to create a general ledger account.
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(
    gLAccountInput,
    idempotencyKey
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **gLAccountInput** | **Array<GLAccountInput>**| Represents the information to create a general ledger account. | |
| **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

**Array<GLAccount>**

### 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** | General ledger account 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<GLAccount> getAll()


### Example

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

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

let type: 'ASSET' | 'LIABILITY' | 'EQUITY' | 'INCOME' | 'EXPENSE'; //The general ledger account type. (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 start date to calculate the account balance from. (optional) (default to undefined)
let to: string; //The end date to calculate the account balance to. (optional) (default to undefined)
let branchId: string; //The branch ID that the general ledger account balances are generated for. (optional) (default to undefined)
let balanceExcluded: boolean; //`TRUE` if the balance is excluded, `FALSE` otherwise. (optional) (default to undefined)

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

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **type** | [**&#39;ASSET&#39; | &#39;LIABILITY&#39; | &#39;EQUITY&#39; | &#39;INCOME&#39; | &#39;EXPENSE&#39;**]**Array<&#39;ASSET&#39; &#124; &#39;LIABILITY&#39; &#124; &#39;EQUITY&#39; &#124; &#39;INCOME&#39; &#124; &#39;EXPENSE&#39;>** | The general ledger account type. | 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 start date to calculate the account balance from. | (optional) defaults to undefined|
| **to** | [**string**] | The end date to calculate the account balance to. | (optional) defaults to undefined|
| **branchId** | [**string**] | The branch ID that the general ledger account balances are generated for. | (optional) defaults to undefined|
| **balanceExcluded** | [**boolean**] | &#x60;TRUE&#x60; if the balance is excluded, &#x60;FALSE&#x60; otherwise. | (optional) defaults to undefined|


### Return type

**Array<GLAccount>**

### 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** | General ledger accounts 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)

# **getById**
> GLAccount getById()


### Example

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

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

let glAccountId: string; //The general ledger account code or encoded key. (default to undefined)
let from: string; //The start date to calculate the account balance from. (optional) (default to undefined)
let to: string; //The end date to calculate the account balance to. (optional) (default to undefined)
let branchId: string; //The branch ID to use to calculate general ledger account balances. (optional) (default to undefined)
let balanceExcluded: boolean; //`TRUE` if the balance is excluded, `FALSE` otherwise. (optional) (default to undefined)

const { status, data } = await apiInstance.getById(
    glAccountId,
    from,
    to,
    branchId,
    balanceExcluded
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **glAccountId** | [**string**] | The general ledger account code or encoded key. | defaults to undefined|
| **from** | [**string**] | The start date to calculate the account balance from. | (optional) defaults to undefined|
| **to** | [**string**] | The end date to calculate the account balance to. | (optional) defaults to undefined|
| **branchId** | [**string**] | The branch ID to use to calculate general ledger account balances. | (optional) defaults to undefined|
| **balanceExcluded** | [**boolean**] | &#x60;TRUE&#x60; if the balance is excluded, &#x60;FALSE&#x60; otherwise. | (optional) defaults to undefined|


### Return type

**GLAccount**

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

# **patch**
> patch(patchOperation)


### Example

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

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

let glAccountId: string; //The general ledger account code or encoded key. (default to undefined)
let patchOperation: Array<PatchOperation>; //Patch operations to be applied to a resource.

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

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **patchOperation** | **Array<PatchOperation>**| Patch operations to be applied to a resource. | |
| **glAccountId** | [**string**] | The general ledger account code or encoded key. | 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** | General ledger account updated. |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | General ledger 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)

