Creates a new employee consumption. **Note:** This endpoint is **only available** in the **sandbox** environment.
curl --request POST \
--url https://pre-public-api.cobee.io/api/v3/companies/{companyId}/payroll-cycles/{payrollCycleId}/employees/{employeeId}/consumptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"concept": "meal",
"category": "meal-benefit",
"amount": 123
}
'import requests
url = "https://pre-public-api.cobee.io/api/v3/companies/{companyId}/payroll-cycles/{payrollCycleId}/employees/{employeeId}/consumptions"
payload = {
"concept": "meal",
"category": "meal-benefit",
"amount": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({concept: 'meal', category: 'meal-benefit', amount: 123})
};
fetch('https://pre-public-api.cobee.io/api/v3/companies/{companyId}/payroll-cycles/{payrollCycleId}/employees/{employeeId}/consumptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pre-public-api.cobee.io/api/v3/companies/{companyId}/payroll-cycles/{payrollCycleId}/employees/{employeeId}/consumptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'concept' => 'meal',
'category' => 'meal-benefit',
'amount' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pre-public-api.cobee.io/api/v3/companies/{companyId}/payroll-cycles/{payrollCycleId}/employees/{employeeId}/consumptions"
payload := strings.NewReader("{\n \"concept\": \"meal\",\n \"category\": \"meal-benefit\",\n \"amount\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pre-public-api.cobee.io/api/v3/companies/{companyId}/payroll-cycles/{payrollCycleId}/employees/{employeeId}/consumptions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"concept\": \"meal\",\n \"category\": \"meal-benefit\",\n \"amount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pre-public-api.cobee.io/api/v3/companies/{companyId}/payroll-cycles/{payrollCycleId}/employees/{employeeId}/consumptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"concept\": \"meal\",\n \"category\": \"meal-benefit\",\n \"amount\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "7f4c9ba8-9c2d-4b82-8b8c-e5f8f8f8f8f8"
}{
"message": "Invalid request: 'payrollCycleId' field is required"
}{
"message": "Invalid API key"
}{
"message": "Company with ID 'a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890' not found"
}{
"message": "Internal server error: Unable to process request"
}Consumption Reports
Create employee consumptions
POST
/
companies
/
{companyId}
/
payroll-cycles
/
{payrollCycleId}
/
employees
/
{employeeId}
/
consumptions
Creates a new employee consumption. **Note:** This endpoint is **only available** in the **sandbox** environment.
curl --request POST \
--url https://pre-public-api.cobee.io/api/v3/companies/{companyId}/payroll-cycles/{payrollCycleId}/employees/{employeeId}/consumptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"concept": "meal",
"category": "meal-benefit",
"amount": 123
}
'import requests
url = "https://pre-public-api.cobee.io/api/v3/companies/{companyId}/payroll-cycles/{payrollCycleId}/employees/{employeeId}/consumptions"
payload = {
"concept": "meal",
"category": "meal-benefit",
"amount": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({concept: 'meal', category: 'meal-benefit', amount: 123})
};
fetch('https://pre-public-api.cobee.io/api/v3/companies/{companyId}/payroll-cycles/{payrollCycleId}/employees/{employeeId}/consumptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pre-public-api.cobee.io/api/v3/companies/{companyId}/payroll-cycles/{payrollCycleId}/employees/{employeeId}/consumptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'concept' => 'meal',
'category' => 'meal-benefit',
'amount' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pre-public-api.cobee.io/api/v3/companies/{companyId}/payroll-cycles/{payrollCycleId}/employees/{employeeId}/consumptions"
payload := strings.NewReader("{\n \"concept\": \"meal\",\n \"category\": \"meal-benefit\",\n \"amount\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pre-public-api.cobee.io/api/v3/companies/{companyId}/payroll-cycles/{payrollCycleId}/employees/{employeeId}/consumptions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"concept\": \"meal\",\n \"category\": \"meal-benefit\",\n \"amount\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pre-public-api.cobee.io/api/v3/companies/{companyId}/payroll-cycles/{payrollCycleId}/employees/{employeeId}/consumptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"concept\": \"meal\",\n \"category\": \"meal-benefit\",\n \"amount\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "7f4c9ba8-9c2d-4b82-8b8c-e5f8f8f8f8f8"
}{
"message": "Invalid request: 'payrollCycleId' field is required"
}{
"message": "Invalid API key"
}{
"message": "Company with ID 'a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890' not found"
}{
"message": "Internal server error: Unable to process request"
}Overview
Note: This endpoint is available only in Sandbox environment
Payroll Cycle specified on the request.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier of the company
The unique identifier of the payroll cycle
The unique identifier of the employee
Body
application/json
Data for the employee consumption
The concept of the consumption
Example:
"meal"
The category of the consumption
Available options:
any, capitalization-benefit, claps-benefit, custom-benefit, education-benefit, gym-benefit, health-insurance-benefit, home-office-benefit, individual-capitalization-benefit, it-product-benefit, life-insurance-benefit, meal-benefit, nursery-benefit, pension-plan-benefit, renting-benefit, retirement-insurance-benefit, transport-benefit, unknown, wellness-benefit Example:
"meal-benefit"
The behaviour of the consumption
Available options:
allowance, allowance-not-exempt, flex, flex-not-exempt The amount of the consumption
Response
Consumption successfully created
The unique identifier of the registered employee