Authenticate and make your first call to the Settlements API.
Getting Started
The Settlements API lets a client submit a settlement: a batch of commissions (payments) and deductions (withholdings) for its contractors. Once the settlement is marked ready, it is processed into disbursements.
Authentication
Every request needs two things:
| Header | Value |
|---|---|
Authorization | Bearer <access token> from the OAuth2 client_credentials grant |
X-API-KEY | The API key issued for your client |
Your token determines which client's data you see. All settlements, commissions and deductions are isolated per client.
sequenceDiagram
participant C as Your system
participant A as OAuth token endpoint
participant S as Settlements API
C->>A: POST client_credentials (client_id, client_secret, scope)
A-->>C: access_token
C->>S: GET /contractors (Bearer token + X-API-KEY)
S-->>C: 200 contractors for your client
Request a token:
curl -X POST "$TOKEN_URL" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "grant_type=client_credentials" \
--data-urlencode "client_id=$CLIENT_ID" \
--data-urlencode "client_secret=$CLIENT_SECRET" \
--data-urlencode "scope=$SCOPE"Then call the API:
curl "$BASE_URL/contractors?count=500" \
-H "Authorization: Bearer $TOKEN" \
-H "X-API-KEY: $API_KEY"Credentials (client id, secret, scope, API key) are provided by OpenForce when your client is onboarded.
Resources
| Resource | Path |
|---|---|
| Settlements | /settlements |
| Commissions | /settlements/{settlementId}/commissions |
| Deductions | /settlements/{settlementId}/deductions |
| Commission types | /commission-types |
| Deduction types | /deduction-types |
| Contractor disbursements | /contractors/{contractorId}/disbursements |
See the API Reference for full request and response schemas.
Next
Submitting a Settlement walks through the full flow.
