Skip to main content

Earnings API

This page assumes the shared rules in API Conventions — authentication, the two error shapes, batching and identity resolution. It only covers what is specific to earnings.
The Earnings API lets your backend read each collaborator’s money: what has already been paid, what is on its way, and what is still owed. It was built for the earnings block of a home screen — the one with a total and a privacy toggle.
This API does not decide what counts as a “commission”. That word means different things at different companies: some call every payout a commission, others separate prizes from commissions strictly. So the response comes broken down, and your screen sums whatever your company calls a commission.

How It Works

  1. You get an API Key with the earnings:read scope
  2. Your backend asks for one or many collaborators (by CPF or email)
  3. SalesOS answers with the totals, broken down by payout type and by receivable status

Authentication


Endpoint Reference

One action: earnings_status.

Request Schema

string
required
Must be "earnings_status"
array
required
Array of collaborator references (max 500)

Example

Response (200):

Fields

Every amount is in cents, as an integer. Never parse them as decimals: floating-point arithmetic on money is a defect, not a rounding preference. Divide by 100 only at the moment of display.

Payout types

paid.by_type splits settled money across the three types the system records:
Sum the types your company calls a commission — do not assume. At one company every payout is called a commission and the whole total_cents is the right number. At another, only COMMISSION belongs on that line, and showing the total would inflate it by orders of magnitude.A type absent from by_type means the person has none of it, not zero-by-convention.

Receivable stages

receivable covers everything still owed. by_status splits it by stage: Two stages never appear here: PAGO (already left, counted in paid) and CANCELADO (will never be paid).
ATRASO is owed money, not an error state. It is included in receivable.total_cents on purpose. Filtering it out would hide, from the person who most needs to see it, money that is late.
Cancelled amounts are excluded everywhere. Showing them would promise money that will never arrive.

Error Handling

See API Conventions for the two shapes and the status code table.
Invalid body, batch over 500, CPF without 11 digits, or an item with neither cpf nor email.
API key is valid but lacks the earnings:read scope.
Someone who has never been paid is not an error. The response comes back with zeros and empty breakdowns, at status 200 — and that zero is a measurement: the person exists and has no payments. Different from found: false.

Rate Limits


Security

  • Read-only: this API never creates, approves or changes a payment
  • Each key is scoped to a single company — money from another company never appears, even for the same person
  • Amounts and documents are never written to logs; only counts are

Next Steps

Player Progress API

Level, XP, coins and ranking

Campaigns API

The catalog those prizes come from