curl --request POST \
--url https://api.royalti.io/expense/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expenses": [
{
"title": "Expense for Ladipoe",
"transactionDate": "2023-03-14",
"type": "artist",
"currency": "USD",
"amount": 100,
"amountUSD": 100,
"artist": "ladipoe",
"conversionRate": 1,
"memo": "Expense memo for ladipoe",
"files": [
"file1.jpg",
"file2.jpg"
]
},
{
"title": "Expense for Another Mavins Product",
"transactionDate": "2023-03-13",
"type": "product",
"currency": "EUR",
"amount": 200,
"amountUSD": 240,
"product": "Another mavins Product",
"memo": "Expense memo for arya star",
"files": [
"file3.jpg",
"file4.jpg"
]
},
{
"title": "Expense for asset feeling",
"transactionDate": "2023-03-13",
"type": "asset",
"currency": "EUR",
"amount": 200,
"amountUSD": 240,
"asset": "feeling-asset-id",
"memo": "Expense memo for feeling asset",
"files": [
"file5.jpg",
"file6.jpg"
]
}
]
}
'{
"message": "Bulk expense creation completed",
"createdExpenses": [
"Expense One",
"Expense Two"
],
"processedCount": 3,
"totalAmount": 500,
"totalAmountUSD": 540,
"errors": [
"Invalid currency for Expense Three"
]
}Create Bulk Expenses
curl --request POST \
--url https://api.royalti.io/expense/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expenses": [
{
"title": "Expense for Ladipoe",
"transactionDate": "2023-03-14",
"type": "artist",
"currency": "USD",
"amount": 100,
"amountUSD": 100,
"artist": "ladipoe",
"conversionRate": 1,
"memo": "Expense memo for ladipoe",
"files": [
"file1.jpg",
"file2.jpg"
]
},
{
"title": "Expense for Another Mavins Product",
"transactionDate": "2023-03-13",
"type": "product",
"currency": "EUR",
"amount": 200,
"amountUSD": 240,
"product": "Another mavins Product",
"memo": "Expense memo for arya star",
"files": [
"file3.jpg",
"file4.jpg"
]
},
{
"title": "Expense for asset feeling",
"transactionDate": "2023-03-13",
"type": "asset",
"currency": "EUR",
"amount": 200,
"amountUSD": 240,
"asset": "feeling-asset-id",
"memo": "Expense memo for feeling asset",
"files": [
"file5.jpg",
"file6.jpg"
]
}
]
}
'{
"message": "Bulk expense creation completed",
"createdExpenses": [
"Expense One",
"Expense Two"
],
"processedCount": 3,
"totalAmount": 500,
"totalAmountUSD": 540,
"errors": [
"Invalid currency for Expense Three"
]
}/expense/bulk endpoint allows creation of multiple expense records simultaneously.
Method:POST
Request Payload:
| Parameter | Type | Description |
|---|---|---|
| expenses | array | Array of expense objects |
const response = await fetch('https://api.royalti.io/expense/bulk', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"expenses": [
{
"title": "sample-title",
"type": "sample-type",
"transactionDate": "2024-01-21",
"currency": "sample-currency",
"amount": 1,
"amountUSD": 1,
"conversionRate": 1,
"artist": "sample-artist",
"product": "sample-product",
"asset": "sample-asset",
"memo": "sample-memo",
"files": [
{}
],
"split": [
{}
]
}
]
})
});
const data = await response.json();
console.log(data);
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
Show child attributes