Skip to main content
GET
/
accounting
/
gettotaldue
Get Total Due Amount
curl --request GET \
  --url https://server26-dot-royalti-project.uc.r.appspot.com/accounting/gettotaldue \
  --header 'Authorization: Bearer <token>'
{
"message": "success",
"totalGross": 150000.5,
"totalPaid": 100000,
"totalDue": 50000.5,
"userCount": 125,
"metadata": {
"calculationMethod": "cached",
"calculationTime": 45,
"dataAvailability": "complete",
"fallbackReason": null
}
}
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/accounting/gettotaldue', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${token}`,
  },
});

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

Authorizations

Authorization
string
header
required

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

Query Parameters

method
enum<string>
default:auto

Calculation method to use for retrieving totals

Available options:
cache,
bigquery,
auto

Response

Total due amount retrieved successfully

message
string
Example:

"success"

totalGross
number

Total gross earnings across all users

Example:

150000.5

totalPaid
number

Total amount already paid to users

Example:

100000

totalDue
number

Total amount currently due to users

Example:

50000.5

userCount
integer

Number of users included in the calculation

Example:

125

metadata
object

Additional information about the calculation