---
# System prepended metadata

title: Arimac Spend Meter SDK Integration User Guide

---

# Arimac Spend Meter SDK Integration User Guide
## Introduction
This is an example app of the Arimac spend meter. WePay team can integrate the plugin and view a demo of the build. Once the data formats and environment settings are configured, Arimac can customize the build as per your requirements. 
### How to access the Spend Meter repository?
WePay team should provide the public SSH key for the GitLab authentication and establish a secure connection between your computer and GitLab.

### Why should you use SSH keys?
SSH keys are generally much more secure and no system connected to the internet is truly secure, but with an SSH key you greatly reduce the chance of human error giving away your access privileges.


## Setting up environment
First, add ```arimac_spend_meter``` as a dependency in your pubspec.yaml file.

```

dependencies:
  arimac_spend_meter: 
    git:
      url: ssh://git@gitlab.com:arimaclanka/spend-meter-flutter-wrapper.git


```

##### Example

```
...
@override
void initState() {
  super.initState();
  ArimacSpendMeter.init("http://dws-dev.arimac.xyz/api/usr-mgt/smb");
}
Future<void> getAllTransactions(String type) async {
  AllTransactions transactions = await ArimacSpendMeter.getAllTransactions(
      page: "1", size: "10", txnTypeId: type);
  setState(() {});
}
...
```
## Methods
#### Initialize the API
Firstly, it is required to set up the API using the ```ArimacSpendMeter.init(<API Link>)``` method.

###### Example
```ArimacSpendMeter.init("http://dws-dev.arimac.xyz/api/usr-mgt/smb");```

#### Get Transactions
Upon setting the parameters to the```getAllTransactions``` method, ```AllTransactions``` model will be returned as per the below examples.

###### Examples

```
AllTransactions transactions = await ArimacSpendMeter.getAllTransactions(
    page: "1", size: "10", txnTypeId: "18"); //18 = Food
   ```   
   
   ```
AllTransactions transactions = await ArimacSpendMeter.getAllTransactions(
    page: "1", size: "10", txnTypeId: "19"); //19 = Grocery
   ```   


## Objects

#### ```AllTransactions```
#### ```Transactions```


# Required sample data set (Data schema) 


#### Transaction List (Spending) 
- The way/process to retrieve transaction list 
- To whom the transaction was made
- Payment methods 
- Transaction categories (Card payment, WePay, Bill payment, other etc.) 
- Merchant categories  

#### Income List (Receiving)
- Income category


## Conclusion
This is only an example app of the Arimac Spend Meter. WePay team can response back with the finalized requirements.

**NOTE !
Authentication Document - Sampath bank should provide a guide regarding authorization of users and fetching sample responses from user tokens**