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>",
"amount": 123,
"amountUSD": 123,
"currency": "<string>",
"conversionRate": 123,
"transactionDate": "2023-12-25",
"split": [
{}
],
"memo": "<string>",
"files": {}
}
'import requests
url = "https://api.royalti.io/expense/{id}"
payload = {
"artist": "<string>",
"product": "<string>",
"asset": "<string>",
"title": "<string>",
"amount": 123,
"amountUSD": 123,
"currency": "<string>",
"conversionRate": 123,
"transactionDate": "2023-12-25",
"split": [{}],
"memo": "<string>",
"files": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
artist: '<string>',
product: '<string>',
asset: '<string>',
title: '<string>',
amount: 123,
amountUSD: 123,
currency: '<string>',
conversionRate: 123,
transactionDate: '2023-12-25',
split: [{}],
memo: '<string>',
files: {}
})
};
fetch('https://api.royalti.io/expense/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'artist' => '<string>',
'product' => '<string>',
'asset' => '<string>',
'title' => '<string>',
'amount' => 123,
'amountUSD' => 123,
'currency' => '<string>',
'conversionRate' => 123,
'transactionDate' => '2023-12-25',
'split' => [
[
]
],
'memo' => '<string>',
'files' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.royalti.io/expense/{id}"
payload := strings.NewReader("{\n \"artist\": \"<string>\",\n \"product\": \"<string>\",\n \"asset\": \"<string>\",\n \"title\": \"<string>\",\n \"amount\": 123,\n \"amountUSD\": 123,\n \"currency\": \"<string>\",\n \"conversionRate\": 123,\n \"transactionDate\": \"2023-12-25\",\n \"split\": [\n {}\n ],\n \"memo\": \"<string>\",\n \"files\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.royalti.io/expense/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"artist\": \"<string>\",\n \"product\": \"<string>\",\n \"asset\": \"<string>\",\n \"title\": \"<string>\",\n \"amount\": 123,\n \"amountUSD\": 123,\n \"currency\": \"<string>\",\n \"conversionRate\": 123,\n \"transactionDate\": \"2023-12-25\",\n \"split\": [\n {}\n ],\n \"memo\": \"<string>\",\n \"files\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/expense/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"artist\": \"<string>\",\n \"product\": \"<string>\",\n \"asset\": \"<string>\",\n \"title\": \"<string>\",\n \"amount\": 123,\n \"amountUSD\": 123,\n \"currency\": \"<string>\",\n \"conversionRate\": 123,\n \"transactionDate\": \"2023-12-25\",\n \"split\": [\n {}\n ],\n \"memo\": \"<string>\",\n \"files\": {}\n}"
response = http.request(request)
puts response.read_body{
"message": "Expense updated successfully"
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}Expense
Update Expense
Update Expense
PUT
/
expense
/
{id}
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>",
"amount": 123,
"amountUSD": 123,
"currency": "<string>",
"conversionRate": 123,
"transactionDate": "2023-12-25",
"split": [
{}
],
"memo": "<string>",
"files": {}
}
'import requests
url = "https://api.royalti.io/expense/{id}"
payload = {
"artist": "<string>",
"product": "<string>",
"asset": "<string>",
"title": "<string>",
"amount": 123,
"amountUSD": 123,
"currency": "<string>",
"conversionRate": 123,
"transactionDate": "2023-12-25",
"split": [{}],
"memo": "<string>",
"files": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
artist: '<string>',
product: '<string>',
asset: '<string>',
title: '<string>',
amount: 123,
amountUSD: 123,
currency: '<string>',
conversionRate: 123,
transactionDate: '2023-12-25',
split: [{}],
memo: '<string>',
files: {}
})
};
fetch('https://api.royalti.io/expense/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'artist' => '<string>',
'product' => '<string>',
'asset' => '<string>',
'title' => '<string>',
'amount' => 123,
'amountUSD' => 123,
'currency' => '<string>',
'conversionRate' => 123,
'transactionDate' => '2023-12-25',
'split' => [
[
]
],
'memo' => '<string>',
'files' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.royalti.io/expense/{id}"
payload := strings.NewReader("{\n \"artist\": \"<string>\",\n \"product\": \"<string>\",\n \"asset\": \"<string>\",\n \"title\": \"<string>\",\n \"amount\": 123,\n \"amountUSD\": 123,\n \"currency\": \"<string>\",\n \"conversionRate\": 123,\n \"transactionDate\": \"2023-12-25\",\n \"split\": [\n {}\n ],\n \"memo\": \"<string>\",\n \"files\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.royalti.io/expense/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"artist\": \"<string>\",\n \"product\": \"<string>\",\n \"asset\": \"<string>\",\n \"title\": \"<string>\",\n \"amount\": 123,\n \"amountUSD\": 123,\n \"currency\": \"<string>\",\n \"conversionRate\": 123,\n \"transactionDate\": \"2023-12-25\",\n \"split\": [\n {}\n ],\n \"memo\": \"<string>\",\n \"files\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/expense/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"artist\": \"<string>\",\n \"product\": \"<string>\",\n \"asset\": \"<string>\",\n \"title\": \"<string>\",\n \"amount\": 123,\n \"amountUSD\": 123,\n \"currency\": \"<string>\",\n \"conversionRate\": 123,\n \"transactionDate\": \"2023-12-25\",\n \"split\": [\n {}\n ],\n \"memo\": \"<string>\",\n \"files\": {}\n}"
response = http.request(request)
puts response.read_body{
"message": "Expense updated successfully"
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}This endpoint requires authentication. Include your Bearer token in the Authorization header.
Description
Update Expense Description: The/expense/{id} endpoint allows updating details of a specific expense record.
Method:
PUT
Authorization:
- Required role:
adminor higher
| 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 |
Code Examples
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);
import requests
response = requests.put(
'https://api.royalti.io/expense/example-id',
headers={
'Authorization': f'Bearer {token}'
},
json={"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":{}}
)
data = response.json()
print(data)
curl -X PUT https://api.royalti.io/expense/example-id \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"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":{}}'
Authorizations
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
Path Parameters
Expense ID
Body
application/json
⌘I