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.
How It Works
- You get an API Key with the
earnings:readscope - Your backend asks for one or many collaborators (by CPF or email)
- SalesOS answers with the totals, broken down by payout type and by receivable status
Authentication
Endpoint Reference
earnings_status.
Request Schema
Optional. The code of one of your company’s cost centers (e.g.
"PLAY2SELL"; uppercase letters, digits, _ and -). Limits every amount to that cost center. Without it, the answer covers every cost center the key can see — a key restricted to some cost centers sees only those.Example
Fields
Payout types
paid.by_type splits settled money across the three types the system records:
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).
Self mode (SSO user token)
With the token of a user who signed in through SSO, sendAuthorization: Bearer <jwt> and omit collaborators. The answer covers only the token’s own user.
X-Tenant-Id with the company’s ID; without it, the token’s default company is used. Other self-mode errors: 400 SELF_MODE_USER_ONLY (the token is not a user’s) and 400 TENANT_REQUIRED (the account is not linked to any company).
Error Handling
See API Conventions for the two shapes and the status code table.400 — VALIDATION_ERROR
400 — VALIDATION_ERROR
Invalid body, batch over 500, CPF without 11 digits, or an item with neither
cpf nor email.401 — authentication
401 — authentication
API key missing, unknown, revoked or expired, a timestamp outside the 30-second window (any second in the future included), or a signature that does not match. The body is
{ "error": "<message>", "code": "<code>" }, with code such as header_missing, api_key_not_found, key_revoked, key_expired, timestamp_too_old, timestamp_in_future or signature_invalid. In self mode, an invalid or expired user token answers { "error": { "code": "UNAUTHORIZED", … } }.403 — scope_insufficient
403 — scope_insufficient
The key is valid but lacks the
earnings:read scope: { "error": "…", "code": "scope_insufficient", "missing_scopes": ["earnings:read"] }. In self mode, FORBIDDEN means the account has no access to the company sent in X-Tenant-Id.422 — UNKNOWN_COST_CENTER
422 — UNKNOWN_COST_CENTER
The
cost_center code does not exist in your company, or is outside the cost centers this key can see.429 — rate_limited
429 — rate_limited
The key reached its hourly limit:
{ "error": "…", "code": "rate_limited" }. Wait the seconds in the Retry-After header, then retry.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

