Transaction
Each transaction has a state_id that must be stored locally. It allows fetching missing transactions (update, save, delete) from the API. When saving a new transaction, you must specify your own UUID in the id field of the JSON object. The API returns your UUID along with a system-generated ID (long). This facilitates asynchronous data updates and later modifications on the frontend.
Save transaction
PUT
https://api.megoru.ru/api/transaction
Headers
Content-Type
application/json
Authorization
token
Body
date
string
2024-12-02
amount
string
Transaction amount
transaction_type
string
INCOME | EXPENSE
description
string
Nullable
category
string
Transaction category
personal_id
number
Personal ID
id
string
The random UUID is sent so that we can later provide you with your UUID and long ID, allowing you to update it on your side.
Response
Fetch new transactions
POST
https://api.megoru.ru/api/transaction/state
Headers
Content-Type
application/json
Authorization
token
Body
state_id
number
State
personal_id
number
Personal ID
Response
Get all transactions
GET
https://api.megoru.ru/api/transaction
Headers
Content-Type
application/json
Authorization
token
Response
Delete transaction
DELETE
https://api.megoru.ru/api/transaction/{id}
Headers
Content-Type
application/json
Authorization
token
PathVariable
id
number
Transaction ID
Response
Update transaction
PATCH
https://api.megoru.ru/api/transaction
Headers
Content-Type
application/json
Authorization
token
Body
date
string
2024-12-02
amount
string
Transaction amount
category
string
Transaction category
id
string
Transaction ID
Response
Last updated