NAV
javascript php python

Info

Welcome to the generated API reference. Get Postman Collection

Auth

Get token

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/auth/login"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "example@email.com",
    "password": "123456"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://expense-manager-back.local/api/v1/auth/login',
    [
        'headers' => [
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'email' => 'example@email.com',
            'password' => '123456',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/auth/login'
payload = {
    "email": "example@email.com",
    "password": "123456"
}
headers = {
  'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()

HTTP Request

POST api/v1/auth/login

Body Parameters

Parameter Type Status Description
email string required User email.
password string required User password.

Refresh token


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/auth/refresh"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "PATCH",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->patch(
    'http://expense-manager-back.local/api/v1/auth/refresh',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/auth/refresh'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('PATCH', url, headers=headers)
response.json()

HTTP Request

PATCH api/v1/auth/refresh

Register user

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/auth/register"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "ipsum",
    "email": "non",
    "password": "nostrum"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://expense-manager-back.local/api/v1/auth/register',
    [
        'headers' => [
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'name' => 'ipsum',
            'email' => 'non',
            'password' => 'nostrum',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/auth/register'
payload = {
    "name": "ipsum",
    "email": "non",
    "password": "nostrum"
}
headers = {
  'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()

HTTP Request

POST api/v1/auth/register

Body Parameters

Parameter Type Status Description
name string required User name
email string required User email
password string required User password

Logout user


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/auth/logout"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://expense-manager-back.local/api/v1/auth/logout',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/auth/logout'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('POST', url, headers=headers)
response.json()

HTTP Request

POST api/v1/auth/logout

Get authenticated user


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/user/profile"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://expense-manager-back.local/api/v1/user/profile',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/user/profile'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

HTTP Request

GET api/v1/user/profile

Charts

Income expense categories


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/chart/income-expense/category"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://expense-manager-back.local/api/v1/chart/income-expense/category',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/chart/income-expense/category'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

HTTP Request

GET api/v1/chart/income-expense/category

Month wise


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/chart/income-expense/month-wise"
);

let params = {
    "month": "6",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://expense-manager-back.local/api/v1/chart/income-expense/month-wise',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'month'=> '6',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/chart/income-expense/month-wise'
params = {
  'month': '6',
}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()

HTTP Request

GET api/v1/chart/income-expense/month-wise

Query Parameters

Parameter Status Description
month optional Number of month to get data (default: 12)

Month and category wise


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/chart/income-expense/category-wise"
);

let params = {
    "month": "6",
    "category_id": "6",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://expense-manager-back.local/api/v1/chart/income-expense/category-wise',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'month'=> '6',
            'category_id'=> '6',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/chart/income-expense/category-wise'
params = {
  'month': '6',
  'category_id': '6',
}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()

HTTP Request

GET api/v1/chart/income-expense/category-wise

Query Parameters

Parameter Status Description
month optional Number of month to get data (default: 12)
category_id required Category id to get data

Currency

Get currencies


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/currency"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://expense-manager-back.local/api/v1/currency',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/currency'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

HTTP Request

GET api/v1/currency

Update currency


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/currency/id"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

let body = {
    "currency_id": 18
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->put(
    'http://expense-manager-back.local/api/v1/currency/id',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'currency_id' => 18,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/currency/id'
payload = {
    "currency_id": 18
}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

HTTP Request

PUT api/v1/currency/{id}

URL Parameters

Parameter Status Description
id required User id of whom to update currency

Body Parameters

Parameter Type Status Description
currency_id integer required Currency id to update

Expense

Get expenses


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/expense"
);

let params = {
    "per_page": "10",
    "sort_col": "created_at",
    "sort_order": "desc",
    "search_col": "category_name",
    "search_by": "Lent",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://expense-manager-back.local/api/v1/expense',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'per_page'=> '10',
            'sort_col'=> 'created_at',
            'sort_order'=> 'desc',
            'search_col'=> 'category_name',
            'search_by'=> 'Lent',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/expense'
params = {
  'per_page': '10',
  'sort_col': 'created_at',
  'sort_order': 'desc',
  'search_col': 'category_name',
  'search_by': 'Lent',
}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()

HTTP Request

GET api/v1/expense

Query Parameters

Parameter Status Description
per_page optional Rows per page (default: 10)
sort_col optional Column name to sort (default: id)
sort_order optional Column sort order (asc|desc)
search_col optional Column name to search
search_by optional Text to search for

Store expense


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/expense"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

let body = {
    "expense_date": "2020-03-30 21:08:36",
    "category_id": 1,
    "amount": 100,
    "spent_on": "Breakfast",
    "remarks": "Coffee and toast"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://expense-manager-back.local/api/v1/expense',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'expense_date' => '2020-03-30 21:08:36',
            'category_id' => 1,
            'amount' => 100.0,
            'spent_on' => 'Breakfast',
            'remarks' => 'Coffee and toast',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/expense'
payload = {
    "expense_date": "2020-03-30 21:08:36",
    "category_id": 1,
    "amount": 100,
    "spent_on": "Breakfast",
    "remarks": "Coffee and toast"
}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()

HTTP Request

POST api/v1/expense

Body Parameters

Parameter Type Status Description
expense_date datetime required Expense date
category_id integer required Expense category id
amount float required Expense amount
spent_on string required Expense reason
remarks string required Expense remarks

Summary of expenses


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/expense/summary"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://expense-manager-back.local/api/v1/expense/summary',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/expense/summary'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

HTTP Request

GET api/v1/expense/summary

Show expense


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/expense/1"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://expense-manager-back.local/api/v1/expense/1',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/expense/1'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

HTTP Request

GET api/v1/expense/{id}

URL Parameters

Parameter Status Description
id required Expense id to show

Update expense


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/expense/1"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

let body = {
    "category_id": 1,
    "amount": 100,
    "spent_on": "Breakfast",
    "remarks": "Coffee and toast"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->put(
    'http://expense-manager-back.local/api/v1/expense/1',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'category_id' => 1,
            'amount' => 100.0,
            'spent_on' => 'Breakfast',
            'remarks' => 'Coffee and toast',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/expense/1'
payload = {
    "category_id": 1,
    "amount": 100,
    "spent_on": "Breakfast",
    "remarks": "Coffee and toast"
}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

HTTP Request

PUT api/v1/expense/{id}

URL Parameters

Parameter Status Description
id required Expense id to update

Body Parameters

Parameter Type Status Description
category_id integer required Expense category id
amount float required Expense amount
spent_on string required Expense reason
remarks string required Expense remarks

Delete expense


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/expense/1"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'http://expense-manager-back.local/api/v1/expense/1',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/expense/1'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('DELETE', url, headers=headers)
response.json()

HTTP Request

DELETE api/v1/expense/{id}

URL Parameters

Parameter Status Description
id required Expense id to delete

Expense Category

Get expense categories


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/expense/category"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://expense-manager-back.local/api/v1/expense/category',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/expense/category'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

HTTP Request

GET api/v1/expense/category

Store expense category


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/expense/category"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

let body = {
    "category_name": "Shopping"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://expense-manager-back.local/api/v1/expense/category',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'category_name' => 'Shopping',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/expense/category'
payload = {
    "category_name": "Shopping"
}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()

HTTP Request

POST api/v1/expense/category

Body Parameters

Parameter Type Status Description
category_name string required -

Show a category info


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/expense/category/1"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://expense-manager-back.local/api/v1/expense/category/1',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/expense/category/1'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

HTTP Request

GET api/v1/expense/category/{id}

URL Parameters

Parameter Status Description
id required Category id to show

Update a category


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/expense/category/1"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

let body = {
    "category_name": "Travel"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->put(
    'http://expense-manager-back.local/api/v1/expense/category/1',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'category_name' => 'Travel',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/expense/category/1'
payload = {
    "category_name": "Travel"
}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

HTTP Request

PUT api/v1/expense/category/{id}

URL Parameters

Parameter Status Description
id required Category id to update

Body Parameters

Parameter Type Status Description
category_name string required New category name to update

Delete a category


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/expense/category/1"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'http://expense-manager-back.local/api/v1/expense/category/1',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/expense/category/1'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('DELETE', url, headers=headers)
response.json()

HTTP Request

DELETE api/v1/expense/category/{id}

URL Parameters

Parameter Status Description
id required Category id to delete

Income

Get incomes


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/income"
);

let params = {
    "per_page": "10",
    "sort_col": "created_at",
    "sort_order": "desc",
    "search_col": "category_name",
    "search_by": "Salary",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://expense-manager-back.local/api/v1/income',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'query' => [
            'per_page'=> '10',
            'sort_col'=> 'created_at',
            'sort_order'=> 'desc',
            'search_col'=> 'category_name',
            'search_by'=> 'Salary',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/income'
params = {
  'per_page': '10',
  'sort_col': 'created_at',
  'sort_order': 'desc',
  'search_col': 'category_name',
  'search_by': 'Salary',
}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()

HTTP Request

GET api/v1/income

Query Parameters

Parameter Status Description
per_page optional Rows per page (default: 10)
sort_col optional Column name to sort (default: id)
sort_order optional Column sort order (asc|desc)
search_col optional Column name to search
search_by optional Text to search for

Store income


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/income"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

let body = {
    "income_date": "2020-03-30 21:08:36",
    "category_id": 1,
    "amount": 100,
    "source": "Salary",
    "notes": "Through bank"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://expense-manager-back.local/api/v1/income',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'income_date' => '2020-03-30 21:08:36',
            'category_id' => 1,
            'amount' => 100.0,
            'source' => 'Salary',
            'notes' => 'Through bank',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/income'
payload = {
    "income_date": "2020-03-30 21:08:36",
    "category_id": 1,
    "amount": 100,
    "source": "Salary",
    "notes": "Through bank"
}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()

HTTP Request

POST api/v1/income

Body Parameters

Parameter Type Status Description
income_date datetime required Income date
category_id integer required Income category id
amount float required Income amount
source string required Income from
notes string required Income notes

Summary of incomes


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/income/summary"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://expense-manager-back.local/api/v1/income/summary',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/income/summary'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

HTTP Request

GET api/v1/income/summary

Show income


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/income/1"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://expense-manager-back.local/api/v1/income/1',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/income/1'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

HTTP Request

GET api/v1/income/{id}

URL Parameters

Parameter Status Description
id required Income id to show

Update income


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/income/1"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

let body = {
    "income_date": "2020-03-30 21:08:36",
    "category_id": 1,
    "amount": 100,
    "source": "Business",
    "notes": "Cash"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->put(
    'http://expense-manager-back.local/api/v1/income/1',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'income_date' => '2020-03-30 21:08:36',
            'category_id' => 1,
            'amount' => 100.0,
            'source' => 'Business',
            'notes' => 'Cash',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/income/1'
payload = {
    "income_date": "2020-03-30 21:08:36",
    "category_id": 1,
    "amount": 100,
    "source": "Business",
    "notes": "Cash"
}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

HTTP Request

PUT api/v1/income/{id}

URL Parameters

Parameter Status Description
id required Income id to update

Body Parameters

Parameter Type Status Description
income_date datetime required Income date
category_id integer required Income category id
amount float required Income amount
source string required Income from
notes string required Income notes

Delete income


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/income/1"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'http://expense-manager-back.local/api/v1/income/1',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/income/1'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('DELETE', url, headers=headers)
response.json()

HTTP Request

DELETE api/v1/income/{id}

URL Parameters

Parameter Status Description
id required Income id to delete

Income Category

Get income categories


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/income/category"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://expense-manager-back.local/api/v1/income/category',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/income/category'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

HTTP Request

GET api/v1/income/category

Store income category


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/income/category"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

let body = {
    "category_name": "Salary"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'http://expense-manager-back.local/api/v1/income/category',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'category_name' => 'Salary',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/income/category'
payload = {
    "category_name": "Salary"
}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()

HTTP Request

POST api/v1/income/category

Body Parameters

Parameter Type Status Description
category_name string required -

Show a category info


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/income/category/1"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://expense-manager-back.local/api/v1/income/category/1',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/income/category/1'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

HTTP Request

GET api/v1/income/category/{id}

URL Parameters

Parameter Status Description
id required Category id to show

Update a category


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/income/category/1"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

let body = {
    "category_name": "Profit"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->put(
    'http://expense-manager-back.local/api/v1/income/category/1',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'category_name' => 'Profit',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/income/category/1'
payload = {
    "category_name": "Profit"
}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

HTTP Request

PUT api/v1/income/category/{id}

URL Parameters

Parameter Status Description
id required Category id to update

Body Parameters

Parameter Type Status Description
category_name string required New category name to update

Delete a category


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/income/category/1"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'http://expense-manager-back.local/api/v1/income/category/1',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/income/category/1'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('DELETE', url, headers=headers)
response.json()

HTTP Request

DELETE api/v1/income/category/{id}

URL Parameters

Parameter Status Description
id required Category id to delete

Summary

Current & last month expenses


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/report/expense/months/summary"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://expense-manager-back.local/api/v1/report/expense/months/summary',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/report/expense/months/summary'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

HTTP Request

GET api/v1/report/expense/months/summary

Current & last month incomes


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/report/income/months/summary"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://expense-manager-back.local/api/v1/report/income/months/summary',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/report/income/months/summary'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

HTTP Request

GET api/v1/report/income/months/summary

Get all transactions


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/report/transaction"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://expense-manager-back.local/api/v1/report/transaction',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/report/transaction'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

HTTP Request

GET api/v1/report/transaction

User

Get users


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/user"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://expense-manager-back.local/api/v1/user',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/user'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

HTTP Request

GET api/v1/user

Update password


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/user/password"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

let body = {
    "old_password": "123456",
    "new_password": "234567",
    "confirm_password": "234567"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->put(
    'http://expense-manager-back.local/api/v1/user/password',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'old_password' => '123456',
            'new_password' => '234567',
            'confirm_password' => '234567',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/user/password'
payload = {
    "old_password": "123456",
    "new_password": "234567",
    "confirm_password": "234567"
}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

HTTP Request

PUT api/v1/user/password

Body Parameters

Parameter Type Status Description
old_password string required Old password
new_password string required New password
confirm_password string required Confirm password

Update logged in user


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/user/update"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

let body = {
    "name": "Triss",
    "email": "tiss@email.com",
    "currency_id": 13
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->put(
    'http://expense-manager-back.local/api/v1/user/update',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'name' => 'Triss',
            'email' => 'tiss@email.com',
            'currency_id' => 13,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/user/update'
payload = {
    "name": "Triss",
    "email": "tiss@email.com",
    "currency_id": 13
}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

HTTP Request

PUT api/v1/user/update

Body Parameters

Parameter Type Status Description
name string required User name
email string required User email
currency_id integer required User currency id

Show a user


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/user/1"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'http://expense-manager-back.local/api/v1/user/1',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/user/1'
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

HTTP Request

GET api/v1/user/{id}

URL Parameters

Parameter Status Description
id required User id to show

Update user


Requires authentication

Example request:

const url = new URL(
    "http://expense-manager-back.local/api/v1/user/1"
);

let headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
};

let body = {
    "name": "Ciri",
    "email": "cir@email.com",
    "currency_id": 1
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->put(
    'http://expense-manager-back.local/api/v1/user/1',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'Bearer {token}',
        ],
        'json' => [
            'name' => 'Ciri',
            'email' => 'cir@email.com',
            'currency_id' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'http://expense-manager-back.local/api/v1/user/1'
payload = {
    "name": "Ciri",
    "email": "cir@email.com",
    "currency_id": 1
}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer {token}'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()

HTTP Request

PUT api/v1/user/{id}

URL Parameters

Parameter Status Description
id required User id to update

Body Parameters

Parameter Type Status Description
name string required User name
email string required User email
currency_id integer required User currency id