# Account

## Extends

- `Account`

### payload

```ts
payload: Account;
```

The underlying payload data for this resource

#### Inherited from

```ts
Bkper.Account.payload
```

### addGroup()

```ts
addGroup(group): Account;
```

Add a group to the Account.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `group` | `string` \| `Group` |

#### Returns

`Account`

This Account, for chainning.

#### Inherited from

```ts
Bkper.Account.addGroup
```

***

### create()

```ts
create(): Account;
```

Perform create new account.

#### Returns

`Account`

The created Account, for chainning.

#### Inherited from

```ts
Bkper.Account.create
```

***

### deleteProperty()

```ts
deleteProperty(key): this;
```

Deletes a custom property.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `key` | `string` |

#### Returns

`this`

This resource, for chaining

#### Inherited from

```ts
Bkper.Account.deleteProperty
```

***

### getBalance()

```ts
getBalance(): Amount;
```

Gets the balance on the current month, based on the credit nature of this Account.

#### Returns

`Amount`

The balance of this account.

#### Inherited from

```ts
Bkper.Account.getBalance
```

***

### getBalanceRaw()

```ts
getBalanceRaw(): Amount;
```

Gets the raw balance on the current month, no matter the credit nature of this Account.

#### Returns

`Amount`

The balance of this account.

#### Inherited from

```ts
Bkper.Account.getBalanceRaw
```

***

### ~~getDescription()~~

```ts
getDescription(): string;
```

Gets the account description

> **Caution: Deprecated**
> Use properties instead
#### Returns

`string`

#### Inherited from

```ts
Bkper.Account.getDescription
```

***

### getGroups()

```ts
getGroups(): Group[];
```

Get the [[Groups]] of this account.

#### Returns

`Group`[]

#### Inherited from

```ts
Bkper.Account.getGroups
```

***

### getId()

```ts
getId(): string;
```

Gets the account internal id.

#### Returns

`string`

#### Inherited from

```ts
Bkper.Account.getId
```

***

### getName()

```ts
getName(): string;
```

Gets the account name.

#### Returns

`string`

#### Inherited from

```ts
Bkper.Account.getName
```

***

### getNormalizedName()

```ts
getNormalizedName(): string;
```

#### Returns

`string`

The name of this account without spaces or special characters.

#### Inherited from

```ts
Bkper.Account.getNormalizedName
```

***

### getProperties()

```ts
getProperties(): object;
```

Gets the custom properties stored in this resource.

#### Returns

`object`

Object with key/value pair properties

#### Inherited from

```ts
Bkper.Account.getProperties
```

***

### getProperty()

```ts
getProperty(...keys): string;
```

Gets the property value for given keys. First property found will be retrieved.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| ...`keys` | `string`[] |

#### Returns

`string`

The property value or null if not found

#### Inherited from

```ts
Bkper.Account.getProperty
```

***

### getPropertyKeys()

```ts
getPropertyKeys(): string[];
```

Gets the custom properties keys stored in this resource.

#### Returns

`string`[]

Array of property keys sorted alphabetically

#### Inherited from

```ts
Bkper.Account.getPropertyKeys
```

***

### getType()

```ts
getType(): AccountType;
```

#### Returns

[`AccountType`](https://bkper.com/docs/api/bkper-gs/enumerations/accounttype.md)

The type for of this account.

#### Inherited from

```ts
Bkper.Account.getType
```

***

### getVisibleProperties()

```ts
getVisibleProperties(): object;
```

Gets the visible custom properties stored in this resource.
Hidden properties (those ending with "_") are excluded from the result.

#### Returns

`object`

Object with key/value pair properties, excluding hidden properties

#### Inherited from

```ts
Bkper.Account.getVisibleProperties
```

***

### hasTransactionPosted()

```ts
hasTransactionPosted(): boolean;
```

Tell if the Account has any transaction already posted.

Accounts with transaction posted, even with zero balance, can only be archived.

#### Returns

`boolean`

#### Inherited from

```ts
Bkper.Account.hasTransactionPosted
```

***

### ~~isActive()~~

```ts
isActive(): boolean;
```

Tell if this account is Active or otherwise Archived.

> **Caution: Deprecated**
> Use isArchived instead
#### Returns

`boolean`

#### Inherited from

```ts
Bkper.Account.isActive
```

***

### isArchived()

```ts
isArchived(): boolean;
```

Tell if this account is archived.

#### Returns

`boolean`

#### Inherited from

```ts
Bkper.Account.isArchived
```

***

### isCredit()

```ts
isCredit(): boolean;
```

Tell if the account has a Credit nature or Debit otherwise

Credit accounts are just for representation purposes. It increase or decrease the absolute balance. It doesn't affect the overall balance or the behavior of the system.

The absolute balance of credit accounts increase when it participate as a credit/origin in a transaction. Its usually for Accounts that increase the balance of the assets, like revenue accounts.

```
        Crediting a credit
  Thus ---------------------> account increases its absolute balance
        Debiting a debit

        Debiting a credit
  Thus ---------------------> account decreases its absolute balance
        Crediting a debit
```

As a rule of thumb, and for simple understanding, almost all accounts are Debit nature (NOT credit), except the ones that "offers" amount for the books, like revenue accounts.

#### Returns

`boolean`

#### Inherited from

```ts
Bkper.Account.isCredit
```

***

### isInGroup()

```ts
isInGroup(group): boolean;
```

Tell if this account is in the [[Group]]

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `group` | `string` \| `Group` |

#### Returns

`boolean`

#### Inherited from

```ts
Bkper.Account.isInGroup
```

***

### isPermanent()

```ts
isPermanent(): boolean;
```

Tell if the account is permanent.

Permanent Accounts are the ones which final balance is relevant and keep its balances over time.

They are also called [Real Accounts](http://en.wikipedia.org/wiki/Account_(accountancy)#Based_on_periodicity_of_flow)

Usually represents assets or tangibles, capable of being perceived by the senses or the mind, like bank accounts, money, debts and so on.

#### Returns

`boolean`

True if its a permanent Account

#### Inherited from

```ts
Bkper.Account.isPermanent
```

***

### json()

```ts
json(): Account;
```

Gets an immutable copy of the JSON payload for this resource.

#### Returns

`Account`

An immutable copy of the json payload

#### Inherited from

```ts
Bkper.Account.json
```

***

### remove()

```ts
remove(): Account;
```

Perform delete account.

#### Returns

`Account`

#### Inherited from

```ts
Bkper.Account.remove
```

***

### removeGroup()

```ts
removeGroup(group): Account;
```

Remove a group from the Account.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `group` | `string` \| `Group` |

#### Returns

`Account`

#### Inherited from

```ts
Bkper.Account.removeGroup
```

***

### setArchived()

```ts
setArchived(archived): Account;
```

Set account archived/unarchived.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `archived` | `boolean` |

#### Returns

`Account`

This Account, for chainning.

#### Inherited from

```ts
Bkper.Account.setArchived
```

***

### setGroups()

```ts
setGroups(groups): Account;
```

Sets the groups of the Account.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `groups` | `Group`[] \| `string`[] |

#### Returns

`Account`

This Account, for chainning.

#### Inherited from

```ts
Bkper.Account.setGroups
```

***

### setName()

```ts
setName(name): Account;
```

Sets the name of the Account.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `name` | `string` |

#### Returns

`Account`

This Account, for chainning.

#### Inherited from

```ts
Bkper.Account.setName
```

***

### setProperties()

```ts
setProperties(properties): this;
```

Sets the custom properties of this resource.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `properties` | \{ \[`key`: `string`\]: `string`; \} |

#### Returns

`this`

This resource, for chaining

#### Inherited from

```ts
Bkper.Account.setProperties
```

***

### setProperty()

```ts
setProperty(key, value): this;
```

Sets a custom property in this resource.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `key` | `string` |
| `value` | `string` |

#### Returns

`this`

This resource, for chaining

#### Inherited from

```ts
Bkper.Account.setProperty
```

***

### setType()

```ts
setType(type): Account;
```

Sets the type of the Account.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `type` | [`AccountType`](https://bkper.com/docs/api/bkper-gs/enumerations/accounttype.md) |

#### Returns

`Account`

This Account, for chainning

#### Inherited from

```ts
Bkper.Account.setType
```

***

### setVisibleProperties()

```ts
setVisibleProperties(properties): this;
```

Sets the custom properties of this resource, filtering out hidden properties.
Hidden properties are those whose keys end with an underscore "_".

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `properties` | \{ \[`key`: `string`\]: `string`; \} |

#### Returns

`this`

This resource, for chaining

#### Inherited from

```ts
Bkper.Account.setVisibleProperties
```

***

### setVisibleProperty()

```ts
setVisibleProperty(key, value): this;
```

Sets a custom property in this resource, filtering out hidden properties.
Hidden properties are those whose keys end with an underscore "_".

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `key` | `string` |
| `value` | `string` \| `null` |

#### Returns

`this`

This resource, for chaining

#### Inherited from

```ts
Bkper.Account.setVisibleProperty
```

***

### update()

```ts
update(): Account;
```

Perform update account, applying pending changes.

#### Returns

`Account`

#### Inherited from

```ts
Bkper.Account.update
```
