Money Lover API API Reference

The open API of Money Lover application

Host

Authenticate

Money Lover is using OAuth2 to verify request from client. We will provide you API ID (Client ID) and Secret key. Please email to [email protected] and explain your requirements, we will send you keys, in 2 environments: Production and Sandbox.

Note: Data from Sandbox and Production are separate.

From API ID and Secret key, each login session you will have access_key, expire & refresh_token to get access_key when they expire. Please read API with tag Auth below.

Most requests of Money Lover include security, parameters are in Header. Please read in Security.

Currency

Money Lover data has a currency list for whole eco system. For developers go to this link to download JSON file. Description of the file can be found at Schema definitions.

API Endpoint
https://oapi.moneylover.me/public
Schemes: https
Version: 1.0.0

Authentication

client

name
Client ID
in
header

authorization

name
Authorization
description

"Bearer ACCESS_TOKEN"

in
header

apiversion

name
API Version
description

Default value is "4"

in
header

dataformat

name
Data format
description

Default value is "json"

in
header

Auth

Get login URL

POST /authenticate
client

Client ID

type
string
in
query
secret

Secret

type
string
in
query
callback_url

After successful login, system will send access_token, expire & refresh_token to your URL by method GET.You can find values in query.

type
string
in
query
200 OK

Returns a login URL. Open at new tab or web view

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean",
  "data": {
    "login_url": "string"
  }
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Wallet

Wallet list

GET /wallet/list
200 OK

An array of products

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean",
  "data": {
    "account_list": [
      {
        "_id": "string",
        "name": "string",
        "currencyId": "number (integer)",
        "icon": "string",
        "excludeTotal": "boolean",
        "accountType": "number",
        "metadata": "object",
        "archived": "boolean",
        "balance": "number",
        "sortIndex": "number"
      }
    ]
  }
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Wallet info

GET /wallet/info
_id

Account ID

type
string
in
query
200 OK

Returns wallet info

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean",
  "data": {
    "account": {
      "_id": "string",
      "name": "string",
      "currencyId": "number (integer)",
      "icon": "string",
      "excludeTotal": "boolean",
      "accountType": "number",
      "metadata": "object",
      "archived": "boolean",
      "balance": "number",
      "sortIndex": "number"
    }
  }
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Create a wallet

POST /wallet/create
name

Wallet's name

type
string
in
query
currency

Currency ID

type
number (integer)
in
query
icon

Icon path

type
string
in
query
200 OK

Returns new wallet

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean",
  "data": {
    "account": {
      "_id": "string",
      "name": "string",
      "currencyId": "number (integer)",
      "icon": "string",
      "excludeTotal": "boolean",
      "accountType": "number",
      "metadata": "object",
      "archived": "boolean",
      "balance": "number",
      "sortIndex": "number"
    }
  }
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Edit a wallet

PUT /wallet/update
_id

Wallet ID

type
string
in
query
name

Wallet name

type
string
in
query
icon

Wallet icon path

type
string
in
query
exclude_total

Exclude from total

type
boolean
in
query
transaction_notification

Transaction notification

type
boolean
in
query
archived

Wallet's archived state

type
boolean
in
query
200 OK

Returns new wallet

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean",
  "data": {
    "account": {
      "_id": "string",
      "name": "string",
      "currencyId": "number (integer)",
      "icon": "string",
      "excludeTotal": "boolean",
      "accountType": "number",
      "metadata": "object",
      "archived": "boolean",
      "balance": "number",
      "sortIndex": "number"
    }
  }
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Delete a wallet

DELETE /wallet/delete
_id

Wallet ID

type
string
in
query
200 OK

Returns result

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean"
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Category

Category list

GET /category/list
account

Wallet ID

type
string
in
query
skip

Number of ignored items in request

type
number (ingeter)
in
query
limit

Number of max item in request

type
number (integer)
in
query
200 OK

Returns array of categories

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean",
  "data": {
    "category_list": [
      {
        "_id": "string",
        "name": "string",
        "icon": "string",
        "type": "number",
        "parent": "string",
        "metadata": "object"
      }
    ]
  }
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Category info

GET /category/info
_id

Category ID

type
string
in
query
200 OK

Returns category info

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean",
  "data": {
    "category": {
      "_id": "string",
      "name": "string",
      "icon": "string",
      "type": "number",
      "parent": "string",
      "metadata": "object"
    }
  }
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Create a category

POST /category/create
wallet

Wallet ID

type
string
in
query
name

Category's name

type
string
in
query
type

1 is income, 2 is expense

type
number (integer)
in
query
icon

Icon path

type
string
in
query
parent

Parent cateogry's ID

type
string
in
query
200 OK

Returns new category

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean",
  "data": {
    "category": {
      "_id": "string",
      "name": "string",
      "icon": "string",
      "type": "number",
      "parent": "string",
      "metadata": "object"
    }
  }
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Edit a category

PUT /category/update
_id

Category ID

type
string
in
query
name

Category name

type
string
in
query
icon

Category icon path

type
string
in
query
type

Category type

type
boolean
in
query
parent

Parent category's ID

type
string
in
query
200 OK

Returns new category

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean",
  "data": {
    "category": {
      "_id": "string",
      "name": "string",
      "icon": "string",
      "type": "number",
      "parent": "string",
      "metadata": "object"
    }
  }
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Delete a category

DELETE /category/delete
_id

Category's ID

type
string
in
query
200 OK

Returns result

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean"
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Budget

Budget limit

GET /budget/list
skip

Number of skip items

type
number (integer)
in
query
limit

Max amount of budget list

type
number (integer)
in
query
200 OK

Returns list budget

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean",
  "data": {
    "budget_list": [
      {
        "_id": "string",
        "name": "string",
        "icon": "string",
        "category": "string",
        "startDate": "string",
        "endDate": "string",
        "account": "string",
        "amount": "number",
        "isRepeat": "boolean"
      }
    ]
  }
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Budget info

GET /budget/info
_id

Budget ID

type
string
in
query
200 OK

Returns budget info

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean",
  "data": {
    "budget": {
      "_id": "string",
      "name": "string",
      "icon": "string",
      "category": "string",
      "startDate": "string",
      "endDate": "string",
      "account": "string",
      "amount": "number",
      "isRepeat": "boolean"
    }
  }
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Create a budget

POST /budget/create
wallet

Wallet ID

type
string
in
query
amount

Max expense amount. Greater than 0

type
number
in
query
category

Category ID

type
string
in
query
is_repeat

Auto create new budget in next period

type
boolean
in
query
start_date

Start date

type
string (YYYY-MM-DD)
in
query
end_date

End date

type
string (YYYY-MM-DD)
in
query
200 OK

Returns new budget

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean",
  "data": {
    "budget": {
      "_id": "string",
      "name": "string",
      "icon": "string",
      "category": "string",
      "startDate": "string",
      "endDate": "string",
      "account": "string",
      "amount": "number",
      "isRepeat": "boolean"
    }
  }
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Update a budget

PUT /budget/update
_id

Budget ID

type
string
in
query
amount

Max expense amount. Greater than 0

type
number
in
query
category

Category ID

type
string
in
query
is_repeat

Auto create new budget in next period

type
boolean
in
query
start_date

Start date

type
string (YYYY-MM-DD)
in
query
end_date

End date

type
string (YYYY-MM-DD)
in
query
200 OK

Returns new budget

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean",
  "data": {
    "budget": {
      "_id": "string",
      "name": "string",
      "icon": "string",
      "category": "string",
      "startDate": "string",
      "endDate": "string",
      "account": "string",
      "amount": "number",
      "isRepeat": "boolean"
    }
  }
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Delete a budget

DELETE /budget/delete
_id

Budget ID

type
string
in
query
200 OK

Returns result

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean"
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Campaign

Campaign list

GET /campaign/list
skip

Number of skip items

type
number (integer)
in
query
limit

Max amount of budget list

type
number (integer)
in
query
200 OK

Returns list campaign

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean",
  "data": {
    "campaign_list": [
      {
        "_id": "string",
        "name": "string",
        "icon": "string",
        "type": "number",
        "startAmount": "number",
        "goalAmount": "number",
        "status": "boolean",
        "account": "string",
        "endDate": "string",
        "currencyId": "number"
      }
    ]
  }
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Campaign info

GET /campaign/info
_id

Campaign ID

type
string
in
query
200 OK

Returns campaign info

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean",
  "data": {
    "campaign": {
      "_id": "string",
      "name": "string",
      "icon": "string",
      "type": "number",
      "startAmount": "number",
      "goalAmount": "number",
      "status": "boolean",
      "account": "string",
      "endDate": "string",
      "currencyId": "number"
    }
  }
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Create a campaign

POST /campaign/create
name

Campaign name

type
string
in
query
type

5 is Saving, 6 is Event

type
number (integer)
in
query
icon

Icon path

type
string
in
query
start_amount

Start amount of Saving

type
number
in
query
goal_amount

Goal amount of Saving

type
number
in
query
end_date

End date

type
string (YYYY-MM-DD)
in
query
wallet

Wallet ID

type
string
in
query
currency_id

Currency ID. Required if campaign have no account

type
number (integer)
in
query
200 OK

Returns new campaign

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean",
  "data": {
    "campaign": {
      "_id": "string",
      "name": "string",
      "icon": "string",
      "type": "number",
      "startAmount": "number",
      "goalAmount": "number",
      "status": "boolean",
      "account": "string",
      "endDate": "string",
      "currencyId": "number"
    }
  }
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Update a campaign

PUT /campaign/update
_id

Campaign ID

type
string
in
query
name

Campaign name

type
string
in
query
icon

Icon path

type
string
in
query
start_amount

Start amount of Saving

type
number
in
query
goal_amount

Goal amount of Saving

type
number
in
query
end_date

End date

type
string (YYYY-MM-DD)
in
query
currency_id

Currency ID. Required if campaign have no account

type
number (integer)
in
query
200 OK

Returns new campaign

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean",
  "data": {
    "campaign": {
      "_id": "string",
      "name": "string",
      "icon": "string",
      "type": "number",
      "startAmount": "number",
      "goalAmount": "number",
      "status": "boolean",
      "account": "string",
      "endDate": "string",
      "currencyId": "number"
    }
  }
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Delete a campaign

DELETE /campaign/delete
_id

Campaign ID

type
string
in
query
200 OK

Returns new campaign

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean"
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Transaction

Transaction list

GET /transaction/list
account

Wallet ID

type
string
in
query
skip

Number of skip items

type
number (integer)
in
query
limit

Max transaction amount in request

type
number (integer)
in
query
200 OK

Returns list transaction

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean",
  "data": {
    "transaction_list": [
      {
        "_id": "number",
        "note": "string",
        "displayDate": "string",
        "amount": "number",
        "longtitude": "string",
        "latitude": "string",
        "address": "string",
        "category": "string",
        "parent": "string",
        "with": [
          "string"
        ],
        "campaign": "string",
        "remind": "string",
        "excludeReport": "boolean",
        "originalCurrency": "string"
      }
    ]
  }
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Transaction info

GET /transaction/get
_id

Transaction ID

type
string
in
query
200 OK

Returns transaction info

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean",
  "data": {
    "transaction": {
      "_id": "number",
      "note": "string",
      "displayDate": "string",
      "amount": "number",
      "longtitude": "string",
      "latitude": "string",
      "address": "string",
      "category": "string",
      "parent": "string",
      "with": [
        "string"
      ],
      "campaign": "string",
      "remind": "string",
      "excludeReport": "boolean",
      "originalCurrency": "string"
    }
  }
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Create a transaction

POST /transaction/create
note

Transaction note

type
string
in
query
category

Category ID

type
string
in
query
amount

Amount

type
number
in
query
longtitude

Location longtitude

type
string
in
query
latitude

Location latitude

type
string
in
query
address

Address

type
string
in
query
with

List of related person name

type
string[]
in
query
campaign

Campaign ID

type
string
in
query
display_date

Transaction date

type
string (YYYY-MM-DD)
in
query
due_date

Due date (for Debt/Loan transaction)

type
string (YYYY-MM-DD)
in
query
parent

Parent transaction ID

type
string
in
query
exclude_report

Exclude from report

type
boolean
in
query
wallet

Wallet ID

type
string
in
query
200 OK

Returns new transaction

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean",
  "data": {
    "transaction": {
      "_id": "number",
      "note": "string",
      "displayDate": "string",
      "amount": "number",
      "longtitude": "string",
      "latitude": "string",
      "address": "string",
      "category": "string",
      "parent": "string",
      "with": [
        "string"
      ],
      "campaign": "string",
      "remind": "string",
      "excludeReport": "boolean",
      "originalCurrency": "string"
    }
  }
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Update a transaction

PUT /transaction/update
_id

Transaction ID

type
string
in
query
note

Transaction note

type
string
in
query
category

Category ID

type
string
in
query
amount

Amount

type
number
in
query
longtitude

Location longtitude

type
string
in
query
latitude

Location latitude

type
string
in
query
address

Address

type
string
in
query
with

List of related person name

type
string[]
in
query
campaign

Campaign ID

type
string
in
query
display_date

Transaction date

type
string (YYYY-MM-DD)
in
query
due_date

Due date (for Debt/Loan transaction)

type
string (YYYY-MM-DD)
in
query
parent

Parent transaction ID (for Debt/Loan transaction)

type
string
in
query
exclude_report

Exclude from report

type
boolean
in
query
account

Wallet ID

type
string
in
query
200 OK

Returns new transaction

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean",
  "data": {
    "transaction": {
      "_id": "number",
      "note": "string",
      "displayDate": "string",
      "amount": "number",
      "longtitude": "string",
      "latitude": "string",
      "address": "string",
      "category": "string",
      "parent": "string",
      "with": [
        "string"
      ],
      "campaign": "string",
      "remind": "string",
      "excludeReport": "boolean",
      "originalCurrency": "string"
    }
  }
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Delete a transaction

DELETE /transaction/delete
_id

Transaction ID

type
string
in
query
200 OK

Returns new result

404 Not Found

Unexpected error

Response Example (200 OK)
{
  "status": "boolean"
}
Response Example (404 Not Found)
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}

Schema Definitions

Wallet: object

_id: string

ID of wallet

name: string

Wallet name.

currencyId: number (integer)

Currency code, find them here

icon: string

URL of wallet icon

excludeTotal: boolean

Select status Exclude from report

accountType: number

Type of wallet. Default 0, null, or undefined

metadata: object

Additional information of wallet

archived: boolean

Show wallet was archived

balance: number

additional information of wallet

sortIndex: number

The order of wallet in the list show up in UI

Example
{
  "_id": "string",
  "name": "string",
  "currencyId": "number (integer)",
  "icon": "string",
  "excludeTotal": "boolean",
  "accountType": "number",
  "metadata": "object",
  "archived": "boolean",
  "balance": "number",
  "sortIndex": "number"
}

Category: object

_id: string

Category ID

name: string

Category name

icon: string

URL of category icon

type: number

Type of category. 1 as Income(inflow), 2 as Expense(outflow)

parent: string

ID of parent category

metadata: object

additional information of category

Example
{
  "_id": "string",
  "name": "string",
  "icon": "string",
  "type": "number",
  "parent": "string",
  "metadata": "object"
}

Budget: object

_id: string

Budget ID

name: string

budget name

icon: string

URL of budget's icon

category: string

ID của category

startDate: string

Start date of budget. Type ISOString

endDate: string

End date of budget. Type ISOString

account: string

ID of wallet

amount: number

amount of goal

isRepeat: boolean

Default is false. If true. Budget repeats in the next period

Example
{
  "_id": "string",
  "name": "string",
  "icon": "string",
  "category": "string",
  "startDate": "string",
  "endDate": "string",
  "account": "string",
  "amount": "number",
  "isRepeat": "boolean"
}

Campaign: object

_id: string

Campaign ID

name: string

Campaign name

icon: string

URL of campaign icon

type: number

Type of campaign. 5 as Saving, 6 as Event

startAmount: number

starting amount

goalAmount: number

Goal amount

status: boolean

Finished status. Default: false, use with type is 5

account: string

ID of wallet

endDate: string

End date: ISOString

currencyId: number

ID of currency. Use for Global campaing to indentify currency

Example
{
  "_id": "string",
  "name": "string",
  "icon": "string",
  "type": "number",
  "startAmount": "number",
  "goalAmount": "number",
  "status": "boolean",
  "account": "string",
  "endDate": "string",
  "currencyId": "number"
}

Transaction: object

_id: number

ID of transaction

note: string

Note of transaction

displayDate: string

Display date: ISOString

amount: number

amount of transaction

longtitude: string

longtitude

latitude: string

latitue

address: string

Location of transaction

category: string

Category ID

parent: string

ID of parent transaction. Ex: Debt is parent tranaction of repayment transaction

with: string[]
campaign: string

Campaign ID

remind: string

Time to remind transaction. Type ISOString

excludeReport: boolean

Exclude transaction form report

originalCurrency: string

Currency code if transaction displays currency which is different to the currency of wallet it belongs to Ex: USD

Example
{
  "_id": "number",
  "note": "string",
  "displayDate": "string",
  "amount": "number",
  "longtitude": "string",
  "latitude": "string",
  "address": "string",
  "category": "string",
  "parent": "string",
  "with": [
    "string"
  ],
  "campaign": "string",
  "remind": "string",
  "excludeReport": "boolean",
  "originalCurrency": "string"
}

Currency: object

t: number

Timestamp

data: object[]
Example
{
  "t": "number",
  "data": [
    {
      "c": "string",
      "s": "string",
      "n": "string",
      "t": "number",
      "i": "number",
      "r": "number",
      "dm": "string",
      "gs": "string"
    }
  ]
}

Error: object

status: boolean

Value is false.

error: string

Erorr code

message: string

Erorr description

Example
{
  "status": "boolean",
  "error": "string",
  "message": "string"
}