Skip to main content
GET
/
companies
/
{companyId}
/
employees
/
{employeeId}
/
consumptions
Find employee consumptions for a specific payroll cycle
curl --request GET \
  --url https://pre-public-api.cobee.io/api/v3/companies/{companyId}/employees/{employeeId}/consumptions \
  --header 'Authorization: Bearer <token>'
{
  "company": {
    "id": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
    "legalId": "B12345678",
    "currency": "EUR",
    "payrollCycle": {
      "id": "7f4c9ba8-9c2d-4b82-8b8c-e5f8f8f8f8f8",
      "start": 1672531200,
      "end": 1675123200,
      "fiscalYear": "2023",
      "payrollMonth": "03"
    },
    "employee": {
      "employeeId": "dd3de3a0-f903-42a0-b729-4cb16f185bc6",
      "internalId": "12345",
      "legalId": "129387655X",
      "consumptions": [
        {
          "behaviour": "allowance",
          "category": "meal-benefit",
          "sumType": "expenses",
          "amountInCents": 1
        }
      ]
    }
  }
}

Overview

Retrieves all confirmed transactions of a specific employee for a specific payroll cycle.
Important: The payload can be transformed depending on categories and groupBy. Choose the options that better suit your integration.
Important: For text/csv we can select two formats through csvFormat options. When lines is selected, each row corresponds to a single consumption record. When columns is selected, each row corresponds to the total consumptions of an employee, and each consumption type is represented as a separate column.
Important: if the requested payroll cycle is not closed yet, then the property end will be the current date. Otherwise, end will correspond to the last day of the cycle.
Example responses based on csvFormat and categories:

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Accept
enum<string>

The response file type. It can be application/json or text/csv.

Available options:
application/json,
text/csv

Path Parameters

companyId
string<uuid>
required

The unique identifier of the company

employeeId
string<uuid>
required

The unique identifier of the employee

Query Parameters

payrollCycleId
string<uuid>

The unique identifier of the payroll cycle. If not provided, the open payroll cycle will be used.

csvFormat
enum<string>

The format of the resulting consumptions request. Lines: as many lines as benefits for each employee, Columns: one line for each employee and as many columns as benefits

Available options:
lines,
columns
categories
string

List of benefit categories to include in the response, which will return them in the same order as requested.

groupBy
string

Consumptions can be grouped to return data that is more similar to how your system works. The consumptions can be grouped by:

  • category: it will calculate the sum of expenses minus withdrawals for all the consumptions in a category,
  • category,behaviour: sum of all expenses minus withdrawals for all the consumptions in category and behaviour.

Response

Employee consumptions successfully retrieved

company
object
required