Update a draft advance
curl --request PUT \
--url https://api.royalti.io/advance/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"principalDisbursedUsd": 123,
"multiple": 123,
"captureRate": 123,
"disbursedAmount": 123,
"fxRate": 123,
"fxDate": "2023-12-25",
"termMonths": 123,
"memo": "<string>"
}
'import requests
url = "https://api.royalti.io/advance/{id}"
payload = {
"principalDisbursedUsd": 123,
"multiple": 123,
"captureRate": 123,
"disbursedAmount": 123,
"fxRate": 123,
"fxDate": "2023-12-25",
"termMonths": 123,
"memo": "<string>"
}
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({
principalDisbursedUsd: 123,
multiple: 123,
captureRate: 123,
disbursedAmount: 123,
fxRate: 123,
fxDate: '2023-12-25',
termMonths: 123,
memo: '<string>'
})
};
fetch('https://api.royalti.io/advance/{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/advance/{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([
'principalDisbursedUsd' => 123,
'multiple' => 123,
'captureRate' => 123,
'disbursedAmount' => 123,
'fxRate' => 123,
'fxDate' => '2023-12-25',
'termMonths' => 123,
'memo' => '<string>'
]),
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/advance/{id}"
payload := strings.NewReader("{\n \"principalDisbursedUsd\": 123,\n \"multiple\": 123,\n \"captureRate\": 123,\n \"disbursedAmount\": 123,\n \"fxRate\": 123,\n \"fxDate\": \"2023-12-25\",\n \"termMonths\": 123,\n \"memo\": \"<string>\"\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/advance/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"principalDisbursedUsd\": 123,\n \"multiple\": 123,\n \"captureRate\": 123,\n \"disbursedAmount\": 123,\n \"fxRate\": 123,\n \"fxDate\": \"2023-12-25\",\n \"termMonths\": 123,\n \"memo\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/advance/{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 \"principalDisbursedUsd\": 123,\n \"multiple\": 123,\n \"captureRate\": 123,\n \"disbursedAmount\": 123,\n \"fxRate\": 123,\n \"fxDate\": \"2023-12-25\",\n \"termMonths\": 123,\n \"memo\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "<string>",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"TenantId": 123,
"TenantUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "draft",
"principalDisbursedUsd": "<string>",
"multiple": "<string>",
"totalRepayableUsd": "<string>",
"outstandingUsd": "<string>",
"captureRate": "<string>",
"disbursementCurrency": "NGN",
"disbursedAmount": "<string>",
"fxRate": "<string>",
"fxDate": "2023-12-25",
"termMonths": 24,
"firstSweptAt": "2023-11-07T05:31:56Z",
"activatedAt": "2023-11-07T05:31:56Z",
"recoupedAt": "2023-11-07T05:31:56Z",
"writtenOffAt": "2023-11-07T05:31:56Z",
"writtenOffUsd": "<string>",
"cancelledAt": "2023-11-07T05:31:56Z",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"approvedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"memo": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"status": "error",
"message": "Unauthorized"
}{
"status": "error",
"message": "Resource not found"
}Advance
Update a draft advance
Update advance
PUT
/
advance
/
{id}
Update a draft advance
curl --request PUT \
--url https://api.royalti.io/advance/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"principalDisbursedUsd": 123,
"multiple": 123,
"captureRate": 123,
"disbursedAmount": 123,
"fxRate": 123,
"fxDate": "2023-12-25",
"termMonths": 123,
"memo": "<string>"
}
'import requests
url = "https://api.royalti.io/advance/{id}"
payload = {
"principalDisbursedUsd": 123,
"multiple": 123,
"captureRate": 123,
"disbursedAmount": 123,
"fxRate": 123,
"fxDate": "2023-12-25",
"termMonths": 123,
"memo": "<string>"
}
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({
principalDisbursedUsd: 123,
multiple: 123,
captureRate: 123,
disbursedAmount: 123,
fxRate: 123,
fxDate: '2023-12-25',
termMonths: 123,
memo: '<string>'
})
};
fetch('https://api.royalti.io/advance/{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/advance/{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([
'principalDisbursedUsd' => 123,
'multiple' => 123,
'captureRate' => 123,
'disbursedAmount' => 123,
'fxRate' => 123,
'fxDate' => '2023-12-25',
'termMonths' => 123,
'memo' => '<string>'
]),
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/advance/{id}"
payload := strings.NewReader("{\n \"principalDisbursedUsd\": 123,\n \"multiple\": 123,\n \"captureRate\": 123,\n \"disbursedAmount\": 123,\n \"fxRate\": 123,\n \"fxDate\": \"2023-12-25\",\n \"termMonths\": 123,\n \"memo\": \"<string>\"\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/advance/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"principalDisbursedUsd\": 123,\n \"multiple\": 123,\n \"captureRate\": 123,\n \"disbursedAmount\": 123,\n \"fxRate\": 123,\n \"fxDate\": \"2023-12-25\",\n \"termMonths\": 123,\n \"memo\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/advance/{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 \"principalDisbursedUsd\": 123,\n \"multiple\": 123,\n \"captureRate\": 123,\n \"disbursedAmount\": 123,\n \"fxRate\": 123,\n \"fxDate\": \"2023-12-25\",\n \"termMonths\": 123,\n \"memo\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "<string>",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"TenantId": 123,
"TenantUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "draft",
"principalDisbursedUsd": "<string>",
"multiple": "<string>",
"totalRepayableUsd": "<string>",
"outstandingUsd": "<string>",
"captureRate": "<string>",
"disbursementCurrency": "NGN",
"disbursedAmount": "<string>",
"fxRate": "<string>",
"fxDate": "2023-12-25",
"termMonths": 24,
"firstSweptAt": "2023-11-07T05:31:56Z",
"activatedAt": "2023-11-07T05:31:56Z",
"recoupedAt": "2023-11-07T05:31:56Z",
"writtenOffAt": "2023-11-07T05:31:56Z",
"writtenOffUsd": "<string>",
"cancelledAt": "2023-11-07T05:31:56Z",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"approvedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"memo": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"status": "error",
"message": "Unauthorized"
}{
"status": "error",
"message": "Resource not found"
}Description
Update advance Draft-only — onlydraft advances can be edited. Any of the
editable terms may be provided; totalRepayableUsd is recomputed from
the resulting principalDisbursedUsd × multiple.
Authorization:
- Required role:
adminor higher
Code Examples
const response = await fetch('https://api.royalti.io/advance/example-id', {
method: 'PUT',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"principalDisbursedUsd": 1,
"multiple": 1,
"captureRate": 1,
"disbursementCurrency": "sample-disbursementCurrency",
"disbursedAmount": 1,
"fxRate": 1,
"fxDate": "2024-01-21",
"termMonths": 1,
"memo": "sample-memo"
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.put(
'https://api.royalti.io/advance/example-id',
json={"principalDisbursedUsd":1,"multiple":1,"captureRate":1,"disbursementCurrency":"sample-disbursementCurrency","disbursedAmount":1,"fxRate":1,"fxDate":"2024-01-21","termMonths":1,"memo":"sample-memo"}
)
data = response.json()
print(data)
curl -X PUT https://api.royalti.io/advance/example-id \
-H "Content-Type: application/json" \
-d '{"principalDisbursedUsd":1,"multiple":1,"captureRate":1,"disbursementCurrency":"sample-disbursementCurrency","disbursedAmount":1,"fxRate":1,"fxDate":"2024-01-21","termMonths":1,"memo":"sample-memo"}'
Authorizations
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
Path Parameters
Body
application/json
⌘I