New Payment Request
curl --request POST \
--url https://api.royalti.io/payment-request/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"PaymentSettingId": "24d2c371-4a7a-4acd-b4aa-d3eb3bebd8fa",
"currency": "USD",
"amountUSD": 500,
"amount": 130,
"memo": "Payment for services rendered"
}
'import requests
url = "https://api.royalti.io/payment-request/"
payload = {
"PaymentSettingId": "24d2c371-4a7a-4acd-b4aa-d3eb3bebd8fa",
"currency": "USD",
"amountUSD": 500,
"amount": 130,
"memo": "Payment for services rendered"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
PaymentSettingId: '24d2c371-4a7a-4acd-b4aa-d3eb3bebd8fa',
currency: 'USD',
amountUSD: 500,
amount: 130,
memo: 'Payment for services rendered'
})
};
fetch('https://api.royalti.io/payment-request/', 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/payment-request/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'PaymentSettingId' => '24d2c371-4a7a-4acd-b4aa-d3eb3bebd8fa',
'currency' => 'USD',
'amountUSD' => 500,
'amount' => 130,
'memo' => 'Payment for services rendered'
]),
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/payment-request/"
payload := strings.NewReader("{\n \"PaymentSettingId\": \"24d2c371-4a7a-4acd-b4aa-d3eb3bebd8fa\",\n \"currency\": \"USD\",\n \"amountUSD\": 500,\n \"amount\": 130,\n \"memo\": \"Payment for services rendered\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.royalti.io/payment-request/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"PaymentSettingId\": \"24d2c371-4a7a-4acd-b4aa-d3eb3bebd8fa\",\n \"currency\": \"USD\",\n \"amountUSD\": 500,\n \"amount\": 130,\n \"memo\": \"Payment for services rendered\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/payment-request/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"PaymentSettingId\": \"24d2c371-4a7a-4acd-b4aa-d3eb3bebd8fa\",\n \"currency\": \"USD\",\n \"amountUSD\": 500,\n \"amount\": 130,\n \"memo\": \"Payment for services rendered\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Payment Request created successfully",
"newpayment": {
"id": "0654cd19-cea3-4fad-b92e-4033c4252c79",
"status": "pending",
"TenantId": 2,
"TenantUserId": "f4b4e2f8-fe5e-4076-9e09-3424ff7f185f",
"transactionDate": "2023-04-21",
"currency": "USD",
"amountUSD": 100,
"amount": 74000,
"memo": "Sale of album",
"updatedAt": "2023-11-22T20:48:36.034Z",
"createdAt": "2023-11-22T20:48:36.034Z"
}
}{
"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>"
]
}
}Payment Requests
New Payment Request
Create Payment Request
POST
/
payment-request
/
New Payment Request
curl --request POST \
--url https://api.royalti.io/payment-request/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"PaymentSettingId": "24d2c371-4a7a-4acd-b4aa-d3eb3bebd8fa",
"currency": "USD",
"amountUSD": 500,
"amount": 130,
"memo": "Payment for services rendered"
}
'import requests
url = "https://api.royalti.io/payment-request/"
payload = {
"PaymentSettingId": "24d2c371-4a7a-4acd-b4aa-d3eb3bebd8fa",
"currency": "USD",
"amountUSD": 500,
"amount": 130,
"memo": "Payment for services rendered"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
PaymentSettingId: '24d2c371-4a7a-4acd-b4aa-d3eb3bebd8fa',
currency: 'USD',
amountUSD: 500,
amount: 130,
memo: 'Payment for services rendered'
})
};
fetch('https://api.royalti.io/payment-request/', 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/payment-request/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'PaymentSettingId' => '24d2c371-4a7a-4acd-b4aa-d3eb3bebd8fa',
'currency' => 'USD',
'amountUSD' => 500,
'amount' => 130,
'memo' => 'Payment for services rendered'
]),
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/payment-request/"
payload := strings.NewReader("{\n \"PaymentSettingId\": \"24d2c371-4a7a-4acd-b4aa-d3eb3bebd8fa\",\n \"currency\": \"USD\",\n \"amountUSD\": 500,\n \"amount\": 130,\n \"memo\": \"Payment for services rendered\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.royalti.io/payment-request/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"PaymentSettingId\": \"24d2c371-4a7a-4acd-b4aa-d3eb3bebd8fa\",\n \"currency\": \"USD\",\n \"amountUSD\": 500,\n \"amount\": 130,\n \"memo\": \"Payment for services rendered\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/payment-request/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"PaymentSettingId\": \"24d2c371-4a7a-4acd-b4aa-d3eb3bebd8fa\",\n \"currency\": \"USD\",\n \"amountUSD\": 500,\n \"amount\": 130,\n \"memo\": \"Payment for services rendered\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Payment Request created successfully",
"newpayment": {
"id": "0654cd19-cea3-4fad-b92e-4033c4252c79",
"status": "pending",
"TenantId": 2,
"TenantUserId": "f4b4e2f8-fe5e-4076-9e09-3424ff7f185f",
"transactionDate": "2023-04-21",
"currency": "USD",
"amountUSD": 100,
"amount": 74000,
"memo": "Sale of album",
"updatedAt": "2023-11-22T20:48:36.034Z",
"createdAt": "2023-11-22T20:48:36.034Z"
}
}{
"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
Endpoint:/payment-request/
Authorization:
- Required role:
useror higher
POST
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
PaymentSettingId | string | Yes | ID of the payment setting being used. |
currency | string | Yes | Currency code for the payment. |
amountUSD | number | Yes | Amount in USD. |
amount | number | No | Amount in the specified currency (optional). |
memo | string | No | Optional memo describing the purpose of payment. |
Code Examples
const response = await fetch('https://api.royalti.io/payment-request/', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"user": "sample-user",
"PaymentSettingId": "sample-PaymentSettingId",
"currency": "sample-currency",
"amountUSD": 1,
"amount": 1,
"memo": "sample-memo"
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://api.royalti.io/payment-request/',
headers={
'Authorization': f'Bearer {token}'
},
json={"user":"sample-user","PaymentSettingId":"sample-PaymentSettingId","currency":"sample-currency","amountUSD":1,"amount":1,"memo":"sample-memo"}
)
data = response.json()
print(data)
curl -X POST https://api.royalti.io/payment-request/ \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"user":"sample-user","PaymentSettingId":"sample-PaymentSettingId","currency":"sample-currency","amountUSD":1,"amount":1,"memo":"sample-memo"}'
Authorizations
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
Body
application/json
Currency code for the payment
Amount in USD
ID of the user to create the payment request for. Admin/API key only. If not provided, creates for authenticated user.
ID of the payment setting being used. Optional during creation but required for approval and payment processing.
Amount in the specified currency
Optional memo describing the purpose of payment
⌘I