curl --request PUT \
--url https://api.royalti.io/expense/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"artist": "<string>",
"product": "<string>",
"asset": "<string>",
"title": "<string>",
"type": "product",
"amount": 123,
"amountUSD": 123,
"currency": "<string>",
"conversionRate": 123,
"transactionDate": "2023-12-25",
"split": [
{}
],
"memo": "<string>",
"files": {}
}
'{
"message": "Expense updated successfully"
}Update Expense
curl --request PUT \
--url https://api.royalti.io/expense/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"artist": "<string>",
"product": "<string>",
"asset": "<string>",
"title": "<string>",
"type": "product",
"amount": 123,
"amountUSD": 123,
"currency": "<string>",
"conversionRate": 123,
"transactionDate": "2023-12-25",
"split": [
{}
],
"memo": "<string>",
"files": {}
}
'{
"message": "Expense updated successfully"
}/expense/{id} endpoint allows updating details of a specific expense record.
Method:PUT
Path Parameter:
| Parameter | Type | Description |
|---|---|---|
| id | string | The unique identifier of the expense record |
| Parameter | Type | Description |
|---|---|---|
| artist | string | Updated artist ID |
| product | string | Updated product ID |
| asset | string | Updated asset ID |
| title | string | Updated title/description |
| type | string | Updated expense type |
| amount | number | Updated expense amount |
| amountUSD | number | Updated USD amount |
| currency | string | Updated currency |
| transactionDate | string | Updated transaction date |
| split | array | Updated split information |
| memo | string | Updated notes |
| conversionRate | number | Updated exchange rate |
| files | object | Updated files/receipts |
const response = await fetch('https://api.royalti.io/expense/example-id', {
method: 'PUT',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"artist": "sample-artist",
"product": "sample-product",
"asset": "sample-asset",
"title": "sample-title",
"type": "sample-type",
"amount": 1,
"amountUSD": 1,
"currency": "sample-currency",
"conversionRate": 1,
"transactionDate": "2024-01-21",
"split": [
{}
],
"memo": "sample-memo",
"files": {}
})
});
const data = await response.json();
console.log(data);
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
Expense ID