Types of expenses
The types of expenses offer the possibility of labeling your expenses with the aim of generating grouped statistical data from them.
Create a new expense type
This endpoint allows the creation of a new expense type in your application.
HTTP Request
POST/expense-types
Parameters
Name | Type | Description |
---|---|---|
name | String / Required | Name of the type of expense |
Playload
{
"name": "Hardware"
}
201Response
{
"data": {
"id": 15,
"name": "Hardware",
"created_at": "2022-09-30T15:30:15+00:00",
"updated_at": "2022-09-30T15:30:15+00:00"
}
}
List expense types
This endpoint allows the query of the types of expenses of your application.
HTTP Request
GET/expense-types
GET Parameters
Name | Type | Description |
---|---|---|
page | Integer / Optional / Min:1 | Page |
per_page | Integer / Optional / Min:1 Max:100 | Items per page |
200 Response
{
"data": [
{
"id": 15,
"name": "Hardware",
"created_at": "2022-09-30T15:30:15+00:00",
"updated_at": "2022-09-30T15:30:15+00:00"
},
{
"id": 13,
"name": "Communications",
"created_at": "2022-09-29T15:30:15+00:00",
"updated_at": "2022-09-29T15:30:15+00:00"
},
{
"id": 6,
"name": "Software Subscriptions",
"created_at": "2022-09-28T15:30:15+00:00",
"updated_at": "2022-09-28T15:30:15+00:00"
},
{
"id": 5,
"name": "Office",
"created_at": "2022-09-27T15:30:15+00:00",
"updated_at": "2022-09-27T15:30:15+00:00"
}
],
"links": {
"first": "http:\/\/api.orzame.com\/v1\/expense-types?page=1",
"last": "http:\/\/api.orzame.com\/v1\/expense-types?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "http:\/\/api.orzame.com\/v1\/expense-types",
"per_page": 100,
"to": 4,
"total": 4
}
}
Get an expense type
This endpoint allows the query of a type of expense of your application.
HTTP Request
GET/expense-types/{id}
200 Response
{
"data": {
"id": 15,
"name": "Hardware",
"created_at": "2022-09-30T15:30:15+00:00",
"updated_at": "2022-09-30T15:30:15+00:00"
}
}
Update an expense type
This endpoint allows the update of an expense type of your application.
HTTP Request
PATCH/expense-types/{id}
Parameters
Name | Type | Description |
---|---|---|
name | String / Required | Name of the type of expense |
Playload
{
"name": "Hardware"
}
204 Response
Response without body.
Delete an expense type
This endpoint allows the removal of an expense type from your application.
It is not possible to delete if it is in use in the application.
HTTP Request
DELETE/expense-types/{id}
204 Response
Response without body.