> For the complete documentation index, see [llms.txt](https://titans-productions.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://titans-productions.gitbook.io/documentation/redm/scripts/banks/development-api/server.md).

# Server

### Exports

API Getter Function

```lua
local BankAPI = exports.tp_banks:getAPI()
```

1. Get the player primary (main) IBAN Account. If source is available, having identifier and charIdentifier as null is acceptable but if there is no source available, identifier and charIdentifier are required.

```lua
--- @param source - requires an integer value (An online player id source)
--- @param identifier - requires a string (An online or offline player steam hex identifier - it is considered as citizenid for RSG)
--- @param charIdentifier - requires a string or integer value (An online or offline player character identifier - it is considered as cid for RSG)
local iban = BankAPI.getPlayerIBAN(source, identifier, charIdentifier)
```

2. Get the player Joint IBAN Account (if available). If source is available, having identifier and charIdentifier as null is acceptable but if there is no source available, identifier and charIdentifier are required.

```lua
--- @param source - requires an integer value (An online player id source)
--- @param identifier - requires a string (An online or offline player steam hex identifier - it is considered as citizenid for RSG)
--- @param charIdentifier - requires a string or integer value (An online or offline player character identifier - it is considered as cid for RSG)
local iban = BankAPI.getPlayerJointAccountIBAN(source, identifier, charIdentifier)
```

3. Get all the Bank Accounts from a player. If source is available, having identifier and charIdentifier as null is acceptable but if there is no source available, identifier and charIdentifier are required.

```lua
--- @param source - requires an integer value (An online player id source)
--- @param identifier - requires a string (An online or offline player steam hex identifier - it is considered as citizenid for RSG)
--- @param charIdentifier - requires a string or integer value (An online or offline player character identifier - it is considered as cid for RSG)
local iban = BankAPI.getPlayerBankAccounts(source, identifier, charIdentifier)
```

4. Get the account money (Cash / Gold) from an IBAN Account.

```lua
--- @param iban - requires a string (A valid IBAN account)
--- @param account - requires a string (The available account types are "CASH" and "GOLD").
local iban = BankAPI.getAccountMoney(iban, account)
```

5. Executes transaction a type ( DEPOSIT, WITHDRAW ) on the selected IBAN account.

```lua
--- @param iban - requires a string (A valid IBAN account)
--- @param transactionType - requires a string (The available transaction types are DEPOSIT and WITHDRAW).
--- @param account - requires a string (The available account types are "CASH" and "GOLD").
--- @param amount - requires an integer value (The given or taken value).
BankAPI.executeTransactionType(iban, transactionType, account, amount)
```

6. Create a bill on the selected IBAN account.

```lua
--- @param iban - requires a string (A valid IBAN account)
--- @param reason - requires a string (The reason for a bill, the reason length must be very short such as DEPOSIT, TAX, POLICE, SALOON)
--- @param issuer - requires a string (It requires an issuer for a bill, the issuer length must be very short such as POLICE, SALOON, GOVERNMENT)
--- @param account - requires a string (The available account types are "CASH" and "GOLD").
--- @param amount - requires an integer value (The amount of money the player has to pay).
BankAPI.createBill(iban, reason, issuer, account, amount)
```

7. Create a history transaction on the selected IBAN account.

```lua
--- @param iban - requires a string (A valid IBAN account)
--- @param reason - requires a string (The reason for a transaction history record, the reason length must be very short such as DEPOSIT, TAX, POLICE, SALOON)
--- @param account - requires a string (The available account types are "CASH" and "GOLD").
--- @param amount - requires an integer value.
BankAPI.createTransactionHistoryRecord(iban, reason, account, amount)
```

8. Deposits a shared amount to all Government Accounts (That means, if amount is 50, it will shared (/) based on the available bank accounts, for example, if 5 are the government bank accounts, it will be shared / 5.

```lua
--- @param amount - requires an integer value (The given amount of money).
BankAPI.depositGovernmentBanksSharedAmount(amount)
```

9. Get all the available Bank Accounts.

```lua
--- @param Banks - return a table form.
local Banks = BankAPI.getBankAccounts()
```
