Skip to main content
POST
/
accounting
/
users
/
{id}
/
recalculate
Trigger User Accounting Recalculation
curl --request POST \
  --url https://api.royalti.io/accounting/users/{id}/recalculate \
  --header 'Authorization: Bearer <token>'
{
  "message": "User accounting update queued successfully",
  "jobId": "job-uuid-123",
  "userId": "123e4567-e89b-12d3-a456-426614174000",
  "status": "queued"
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Description

Trigger User Accounting Recalculation Queue a recalculation job for a specific user’s accounting data. This operation is asynchronous and returns immediately with a job ID for tracking. Method: POST Path Parameters:
ParameterTypeDescription
idstringThe TenantUser ID to recalculate
Query Parameters:
ParameterTypeDescription
forceRefreshbooleanForce refresh even if data is recent (optional)

Code Examples

const response = await fetch('https://api.royalti.io/accounting/users/example-id/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}"

Path Parameters

id
string<uuid>
required

TenantUser ID

Query Parameters

forceRefresh
boolean
default:false

Force refresh even if data is recent

Response

User accounting recalculation queued successfully

message
string
Example:

"User accounting update queued successfully"

jobId
string

BullMQ job ID for tracking

Example:

"job-uuid-123"

userId
string<uuid>

The TenantUser ID being recalculated

Example:

"123e4567-e89b-12d3-a456-426614174000"

status
enum<string>
Available options:
queued
Example:

"queued"