curl --request GET \
--url https://api.royalti.io/expense/ \
--header 'Authorization: Bearer <token>'{
"totalItems": "3,",
"Expenses": [
{
"id": "e980dd73-e902-4eda-9754-f8add109f712",
"expenseableId": "499d9b7d-1a37-4cf5-ba1f-0301b492d521",
"expenseableType": "asset",
"title": "Expense Oct",
"type": null,
"transactionDate": "2024-10-17",
"currency": "USD",
"amount": 10,
"amountUSD": 10,
"conversionRate": 1,
"memo": "Memo",
"files": [
"https://storage.googleapis.com/royalti-uploads/Royalti Demo/202410/Expense/undefined/Leonardo_Phoenix_Create_a_serene_and_organized_workspace_with_0 (1).jpg"
],
"createdAt": "2024-10-17T11:00:40.130Z",
"updatedAt": "2024-10-17T11:00:40.130Z",
"Artist": null
}
],
"totalPages": 1,
"currentPage": 1,
"filteredItems": 3
}Get Expenses
curl --request GET \
--url https://api.royalti.io/expense/ \
--header 'Authorization: Bearer <token>'{
"totalItems": "3,",
"Expenses": [
{
"id": "e980dd73-e902-4eda-9754-f8add109f712",
"expenseableId": "499d9b7d-1a37-4cf5-ba1f-0301b492d521",
"expenseableType": "asset",
"title": "Expense Oct",
"type": null,
"transactionDate": "2024-10-17",
"currency": "USD",
"amount": 10,
"amountUSD": 10,
"conversionRate": 1,
"memo": "Memo",
"files": [
"https://storage.googleapis.com/royalti-uploads/Royalti Demo/202410/Expense/undefined/Leonardo_Phoenix_Create_a_serene_and_organized_workspace_with_0 (1).jpg"
],
"createdAt": "2024-10-17T11:00:40.130Z",
"updatedAt": "2024-10-17T11:00:40.130Z",
"Artist": null
}
],
"totalPages": 1,
"currentPage": 1,
"filteredItems": 3
}/expense/ endpoint retrieves a list of expense records with filtering, pagination, and inclusion options.
Method:GET
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
| q (Optional) | string | Search query to filter expenses |
| include (Optional) | string | Comma-separated related entities to include (Artist, Product, Asset) |
| page (Optional) | integer | Page number for pagination. Default: 1 |
| size (Optional) | integer | Number of expenses per page. Default: 10 |
const response = await fetch('https://api.royalti.io/expense/', {
method: 'GET',
headers: {
'Authorization': `Bearer ${token}`,
},
});
const data = await response.json();
console.log(data);
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
Comma-separated related entities to include (Artist, Product, Asset)
Search term to filter expenses by title or type
Page number for pagination (1-based)
Number of items per page