Skip to content

Expense API

The Expense API allows you to create, update, and delete expenses. You can also get a list of expenses and get a specific expense.

Action Parameters Description
get none Get expense list.
put Description, Cost, UnitPrice, Quantity, Comment Update expense info

Endpoints

GET
/api/v2/expense/
PUT
/api/v2/expense/

Example Request

curl --location --request GET 'https://app.engineerforce.io/api/v2/expense/'
--header 'Authorization: API-Token {{YOUR_API_TOKEN}}'
var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://app.engineerforce.io/api/v2/expense/',
  headers: { 'Authorization': 'API-Token {{YOUR_API_TOKEN}}' }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
  .url("https://app.engineerforce.io/api/v2/expense/")
  .method("GET", body)
  .addHeader("Authorization", "API-Token {{YOUR_API_TOKEN}}")
  .build();
Response response = client.newCall(request).execute();
import requests

url = 'https://app.engineerforce.io/api/v2/expense/'

payload={}
headers = {'Authorization': 'API-Token {{YOUR_API_TOKEN}}' }

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Example Response

{
    "url": "https://app.engineerforce.io/api/v2/expenses/1/",
    "id": {{EXPENSE_ID}},
    "projectId": {{PROJECT_ID}},
    "ordering": 0,
    "description": "{{DESCRIPTION_TEXT}}",
    "cost": "0.00",
    "unit_price": "2220.00",
    "quantity": 1,
    "amount": "2220.00",
    "projectName": "{{PROJECT_NAME}}",
    "comment": ""
}