curl --request POST \
--url https://api.royalti.io/payment/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'user=<string>' \
--form 'title=<string>' \
--form transactionDate=2023-11-07T05:31:56Z \
--form 'currency=<string>' \
--form amount=123 \
--form amountUSD=123 \
--form conversionRate=123 \
--form 'memo=<string>' \
--form 'files=<string>' \
--form 'id=<string>' \
--form files.items='@example-file'{
"id": "a6afa463-1073-4e14-860e-f5bbd9da0f74",
"TenantId": 1,
"TenantUserId": "8560f85a-2416-47d7-a908-5cd2a6c51659",
"title": "Payment Receipt test",
"transactionDate": "2023-04-21",
"currency": "USD",
"amount": 74000,
"amountUSD": 100,
"conversionRate": 740,
"memo": "Sale of album",
"updatedAt": "2023-06-14T08:04:36.374Z",
"createdAt": "2023-06-14T08:04:36.374Z"
}Create Payment
curl --request POST \
--url https://api.royalti.io/payment/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'user=<string>' \
--form 'title=<string>' \
--form transactionDate=2023-11-07T05:31:56Z \
--form 'currency=<string>' \
--form amount=123 \
--form amountUSD=123 \
--form conversionRate=123 \
--form 'memo=<string>' \
--form 'files=<string>' \
--form 'id=<string>' \
--form files.items='@example-file'{
"id": "a6afa463-1073-4e14-860e-f5bbd9da0f74",
"TenantId": 1,
"TenantUserId": "8560f85a-2416-47d7-a908-5cd2a6c51659",
"title": "Payment Receipt test",
"transactionDate": "2023-04-21",
"currency": "USD",
"amount": 74000,
"amountUSD": 100,
"conversionRate": 740,
"memo": "Sale of album",
"updatedAt": "2023-06-14T08:04:36.374Z",
"createdAt": "2023-06-14T08:04:36.374Z"
}/payment/ endpoint allows creation of payment records with transaction details, currency information, and associated files.
Method:POST
Request Payload:
| Parameter | Type | Description |
|---|---|---|
| user | string | User ID associated with the payment |
| title | string | Title/description of the payment |
| transactionDate | string | Date and time of the transaction |
| currency | string | Currency code (e.g., USD, NGN) |
| amount | number | Amount in the specified currency |
| amountUSD | number | Amount converted to USD |
| conversionRate | number | Exchange rate used for conversion |
| memo | string | Additional notes about the payment |
| files | array | File uploads (multipart/form-data) |
| id | string | Optional custom ID for the payment record |
const response = await fetch('https://api.royalti.io/payment/', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"user": "sample-user",
"title": "sample-title",
"transactionDate": "2024-01-21T12:00:00Z",
"currency": "sample-currency",
"amount": 1,
"amountUSD": 1,
"conversionRate": 1,
"memo": "sample-memo",
"files": [
{}
],
"id": "sample-id"
})
});
const data = await response.json();
console.log(data);
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
TenantUserId associated with the payment
Title/description of the payment
Date and time of the transaction
Currency code (e.g., USD, NGN)
Amount in the specified currency
Amount converted to USD
Exchange rate used for conversion
Additional notes about the payment
File attachments (receipts, invoices, etc.)
Optional custom ID for the payment record