Skip to main content
POST
/
accounting
/
tenant
/
recalculate
Trigger Tenant-Wide Accounting Recalculation
curl --request POST \
  --url https://api.royalti.io/accounting/tenant/recalculate \
  --header 'Authorization: Bearer <token>'
{
  "message": "Tenant accounting update queued successfully",
  "jobId": "job-uuid-456",
  "tenantId": 123,
  "status": "queued",
  "info": {
    "batchSize": 100,
    "estimatedTime": "~5 minutes for 500 users"
  }
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Description

Trigger Tenant-Wide Accounting Recalculation Queue a recalculation job for all users in the tenant. This operation processes users in batches and is asynchronous. Returns immediately with a job ID for tracking progress. Method: POST Query Parameters:
ParameterTypeDescription
batchSizeintegerNumber of users to process per batch (default: 100)

Code Examples

const response = await fetch('https://api.royalti.io/accounting/tenant/recalculate', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({})
});

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

batchSize
integer
default:100

Number of users to process per batch

Required range: 1 <= x <= 500

Response

Tenant accounting recalculation queued successfully

message
string
Example:

"Tenant accounting update queued successfully"

jobId
string

BullMQ job ID for tracking

Example:

"job-uuid-456"

tenantId
integer

The tenant ID being recalculated

Example:

123

status
enum<string>
Available options:
queued
Example:

"queued"

info
object