Skip to main content
POST
/
revenue
/
bulk
Create Bulk Revenues
curl --request POST \
  --url https://server26-dot-royalti-project.uc.r.appspot.com/revenue/bulk \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "revenues": [
    {
      "title": "<string>",
      "amount": 123,
      "currency": "<string>",
      "source": "<string>",
      "transactionDate": "2023-11-07T05:31:56Z",
      "artist": "<string>",
      "asset": "<string>",
      "product": "<string>",
      "splits": [
        {}
      ],
      "metadata": {},
      "memo": "<string>"
    }
  ]
}'
{
  "message": "Bulk revenue creation completed",
  "createdRevenues": [
    "Revenue One",
    "Revenue Two"
  ],
  "processedCount": 3,
  "totalAmount": 7500.25,
  "errors": [
    "Invalid currency for Revenue Three"
  ]
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Code Examples

const response = await fetch('https://server26-dot-royalti-project.uc.r.appspot.com/revenue/bulk', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "revenues": [
      {
        "title": "sample-title",
        "amount": 1,
        "currency": "sample-currency",
        "source": "sample-source",
        "transactionDate": "2024-01-21T12:00:00Z",
        "artist": "sample-artist",
        "asset": "sample-asset",
        "product": "sample-product",
        "splits": [
          {}
        ],
        "metadata": {},
        "memo": "sample-memo"
      }
    ]
  })
});

const data = await response.json();
console.log(data);

Authorizations

Authorization
string
header
required

JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"

Body

application/json
revenues
object[]
required

Response

Created with possible errors

message
string
createdRevenues
string[]
processedCount
integer
totalAmount
number
errors
string[]