curl --request GET \
--url https://openapi.pleo.io/v1/expenses \
--header 'Authorization: Bearer <token>'import requests
url = "https://openapi.pleo.io/v1/expenses"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://openapi.pleo.io/v1/expenses', 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://openapi.pleo.io/v1/expenses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://openapi.pleo.io/v1/expenses"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://openapi.pleo.io/v1/expenses")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.pleo.io/v1/expenses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"expenses": [
{
"id": "<string>",
"performedAt": "2023-11-07T05:31:56Z",
"amountOriginal": {
"value": 123,
"currency": "<string>"
},
"type": "CARD",
"lines": [
{
"amountSettled": {
"value": 123,
"currency": "<string>"
},
"accountId": "<string>",
"taxCodeId": "<string>",
"tagIds": [
{
"id": "<string>",
"tagGroupId": "<string>"
}
]
}
],
"status": "NOT_EXPORTED",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"employeeId": "<string>",
"employeeCode": "<string>",
"departmentId": "<string>",
"amountSettled": {
"value": 123,
"currency": "<string>"
},
"note": "<string>",
"cardTransaction": {
"state": "AUTHORIZATION",
"merchant": {
"name": "<string>",
"id": "<string>"
},
"authorizedAt": "2023-11-07T05:31:56Z",
"settledAt": "2023-11-07T05:31:56Z",
"reversedAt": "2023-11-07T05:31:56Z"
},
"accountId": "<string>",
"taxCodeId": "<string>",
"tagIds": [
{
"id": "<string>",
"tagGroupId": "<string>"
}
],
"receiptIds": [
"<string>"
],
"settledExpenseIds": [
"<string>"
],
"supplier": {
"CIF": "<string>",
"documentNumber": "<string>"
},
"deletedAt": "2023-11-07T05:31:56Z"
}
],
"metadata": {
"pageInfo": {
"pageSize": 123,
"totalCount": 123,
"nextPageOffset": 123
}
}
}{
"statusCode": 401,
"error": "Forbidden",
"message": "user_scope_insufficient"
}{
"statusCode": 403,
"error": "Forbidden",
"message": "user_scope_insufficient"
}"route not found""Something went wrong. Please contact the administrator if problems persist."Get expenses for a company
By default does not return expenses with Transaction State AUTHORIZATION or AUTHORIZATION_REVERSAL.
curl --request GET \
--url https://openapi.pleo.io/v1/expenses \
--header 'Authorization: Bearer <token>'import requests
url = "https://openapi.pleo.io/v1/expenses"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://openapi.pleo.io/v1/expenses', 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://openapi.pleo.io/v1/expenses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://openapi.pleo.io/v1/expenses"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://openapi.pleo.io/v1/expenses")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.pleo.io/v1/expenses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"expenses": [
{
"id": "<string>",
"performedAt": "2023-11-07T05:31:56Z",
"amountOriginal": {
"value": 123,
"currency": "<string>"
},
"type": "CARD",
"lines": [
{
"amountSettled": {
"value": 123,
"currency": "<string>"
},
"accountId": "<string>",
"taxCodeId": "<string>",
"tagIds": [
{
"id": "<string>",
"tagGroupId": "<string>"
}
]
}
],
"status": "NOT_EXPORTED",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"employeeId": "<string>",
"employeeCode": "<string>",
"departmentId": "<string>",
"amountSettled": {
"value": 123,
"currency": "<string>"
},
"note": "<string>",
"cardTransaction": {
"state": "AUTHORIZATION",
"merchant": {
"name": "<string>",
"id": "<string>"
},
"authorizedAt": "2023-11-07T05:31:56Z",
"settledAt": "2023-11-07T05:31:56Z",
"reversedAt": "2023-11-07T05:31:56Z"
},
"accountId": "<string>",
"taxCodeId": "<string>",
"tagIds": [
{
"id": "<string>",
"tagGroupId": "<string>"
}
],
"receiptIds": [
"<string>"
],
"settledExpenseIds": [
"<string>"
],
"supplier": {
"CIF": "<string>",
"documentNumber": "<string>"
},
"deletedAt": "2023-11-07T05:31:56Z"
}
],
"metadata": {
"pageInfo": {
"pageSize": 123,
"totalCount": 123,
"nextPageOffset": 123
}
}
}{
"statusCode": 401,
"error": "Forbidden",
"message": "user_scope_insufficient"
}{
"statusCode": 403,
"error": "Forbidden",
"message": "user_scope_insufficient"
}"route not found""Something went wrong. Please contact the administrator if problems persist."Authorizations
Open API Bearer token
Query Parameters
This is the pagination offset value. The record number you would like to start from. This offset value starts at 0.
"150"
The number of expenses to return for each page.
"10"
Date and time to start the expense search from. Format is: YYYY-MM-DDTHH:mi:ss.SSSZ
"2021-02-10T14:00:00.000Z"
Date and time to start the expense search from. Format is: YYYY-MM-DDTHH:mi:ss.SSSZ
"2021-02-10T19:00:00.000Z"
An array of the expense types to filter on.
CARD, PERSONAL_TRANSFER, BILL_INVOICE, LOAD, MANUAL, MANUAL_TRANSFER, PLEO_INVOICE, EMPLOYEE_BANK_TRANSFER, CASHBACK "[\"CARD\", \"MANUAL_TRANSFER\"]"
Unique UUID of the expense category account to filter the expenses by.
"0f0e000-000d-0d00-000b-00db0d000fae"
Unique UUID of the tag the expense belongs to, to filter the expenses by.
"0f0e000-000d-0d00-000b-00db0d000fae"
An array of transaction states to filter the expenses by.
AUTHORIZATION, AUTHORIZATION_REVERSAL, CHARGE_BACK, CHARGE_BACK_REVERSAL, PRESENTMENT, SECOND_PRESENTMENT, REFUND, LOAD, UNLOAD, FAILED "[\"AUTHORIZATION\", \"PRESENTMENT\"]"
An array of the export status to filter on.
NOT_EXPORTED, QUEUED, EXPORTING, EXPORTED "[\"NOT_EXPORTED\", \"EXPORTED\"]"
Was this page helpful?