Skip to main content
GET
/
expense
/
summary
Get Expense Summary
curl --request GET \
  --url https://api.royalti.io/expense/summary \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.royalti.io/expense/summary"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.royalti.io/expense/summary', 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://api.royalti.io/expense/summary",
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://api.royalti.io/expense/summary"

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://api.royalti.io/expense/summary")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.royalti.io/expense/summary")

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
{
  "message": "success",
  "summary": {
    "total": 89,
    "byStatus": {
      "pending": 12,
      "approved": 40,
      "completed": 37
    },
    "byType": {},
    "amountsByType": {
      "marketing": 12000,
      "production": 8500,
      "legal": 5000,
      "administrative": 3500,
      "product": 2500,
      "artist": 1500,
      "asset": 710.75,
      "general": 500
    },
    "byExpenseableType": {
      "product": 30,
      "asset": 25,
      "artist": 15,
      "user": 5
    },
    "totalAmounts": {
      "totalAmountUSD": 34210.75,
      "totalAmount": 34210.75
    }
  }
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Description

Non-admin users only see expenses for their own account and their artists. Authorization:
  • Required role: user or higher
Query Parameters:
ParameterTypeDescription
startDate (Optional)stringFilter expenses from this date (inclusive)
endDate (Optional)stringFilter expenses to this date (inclusive)
currency (Optional)stringFilter by currency code
type (Optional)stringFilter by expense type
status (Optional)stringFilter by status (pending, approved, completed)

Code Examples

const response = await fetch('https://api.royalti.io/expense/summary', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${token}`,
  },
});

const data = await response.json();
console.log(data);
import requests

response = requests.get(
  'https://api.royalti.io/expense/summary',
  headers={
    'Authorization': f'Bearer {token}'
  },
)

data = response.json()
print(data)
curl -X GET https://api.royalti.io/expense/summary \
  -H "Authorization: Bearer YOUR_TOKEN" \

Authorizations

Authorization
string
header
required

JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"

Query Parameters

startDate
string<date>

Filter expenses from this date (inclusive)

endDate
string<date>

Filter expenses to this date (inclusive)

currency
string

Filter by currency code (e.g., USD, EUR)

type
enum<string>

Filter by expense type

Available options:
product,
artist,
asset,
general,
marketing,
production,
legal,
administrative
status
enum<string>

Filter by expense status

Available options:
pending,
approved,
completed

Response

Success

message
string
Example:

"success"

summary
object