curl --request GET \
--url https://openapi.pleo.io/v1/expenses/{expenseId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://openapi.pleo.io/v1/expenses/{expenseId}"
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/{expenseId}', 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/{expenseId}",
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/{expenseId}"
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/{expenseId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.pleo.io/v1/expenses/{expenseId}")
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{
"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"
}{
"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 an expense for a company
curl --request GET \
--url https://openapi.pleo.io/v1/expenses/{expenseId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://openapi.pleo.io/v1/expenses/{expenseId}"
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/{expenseId}', 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/{expenseId}",
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/{expenseId}"
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/{expenseId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.pleo.io/v1/expenses/{expenseId}")
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{
"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"
}{
"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
Path Parameters
Unique UUID of the expense.
"0f0e000-000d-0d00-000b-00db0d000fae"
Response
An expense has been returned
The unique UUID identifier of the expense
The date the expense was performed in the format YYYY-MM-DDTHH:mi:ss.SSSZ
The amount and currency the transaction was originally in
Show child attributes
Show child attributes
The type of this expense.
CARD, PERSONAL_TRANSFER, BILL_INVOICE, LOAD, MANUAL, MANUAL_TRANSFER, PLEO_INVOICE, EMPLOYEE_BANK_TRANSFER, CASHBACK This is a breakdown of the expense lines for this expense, could also be potentially empty for non-card related expenses
Show child attributes
Show child attributes
This is related to export status information
NOT_EXPORTED, QUEUED, EXPORTING, EXPORTED Date and time this record was created in the pleo system in the format YYYY-MM-DDTHH:mi:ss.SSSZ
Date and time this record was last updated in the pleo system in the format YYYY-MM-DDTHH:mi:ss.SSSZ
Unique UUID identifier of the employee that performed the expense
External identifier of the employee that performed the expense
Unique UUID identifier of the department for which the employee executing the expense belongs to
The settlement amount and currency
Show child attributes
Show child attributes
Additional comments on the expense added to enhance the purpose of the expense
This is the card transaction details of this expense specifically related CARD expense types.
Show child attributes
Show child attributes
This is the UUID pleo accounting category identifier for this expense, e.g. entertainment, travel etc.
This is the UUID tax code identifier for this expense
These are additional accounting-related information pertaining to the expense, these are usually extracted from the external accounting system.
Show child attributes
Show child attributes
Unique identifiers (UUIDs) for the receipts attached to this expense
Unique identifiers (UUIDs) of the related settled Expenses in case the expense is a reimbursement of *TRANSFER family
Expense supplier information.
Show child attributes
Show child attributes
Date and time this record was deleted in the pleo system in the format YYYY-MM-DDTHH:mi:ss.SSSZ
Was this page helpful?