Step-by-step flow to create a settlement, add commissions and deductions, and send it for processing.
Submitting a Settlement
sequenceDiagram
participant C as Your system
participant S as Settlements API
C->>S: GET /contractors
C->>S: GET /commission-types
C->>S: GET /deduction-types
C->>S: POST /settlements (status 0, Pending)
S-->>C: settlement id
C->>S: POST /settlements/{id}/commissions
C->>S: POST /settlements/{id}/deductions
C->>S: PUT /settlements/{id} (status 2)
S-->>C: Ready for Processing
Note over S: Processing is triggered by this status change
1. Look up reference data
GET /contractors?count=500: choose active contractors (status= 1, notermination_date) under your client.GET /commission-typesandGET /deduction-types: use the IDs returned for your client. Never hardcode type IDs; they differ per client.
2. Create the settlement as Pending
POST /settlements
{
"external_id": "WEEK-2026-44",
"status": 0,
"start_date": "2026-10-26T00:00:00Z",
"end_date": "2026-11-01T23:59:59Z",
"requested_disbursement_date": "2026-11-12T00:00:00"
}
Create at status0, not2Creating a settlement directly at
2(Ready for Processing) does not trigger processing. Always create at0, then PUT to2in step 5.
3. Add commissions
POST /settlements/{settlementId}/commissions
{
"contractor_id": "<contractor guid>",
"commission_type_id": 7,
"amount": 360,
"external_id": "COMM-1001",
"description": "Weekly route"
}Use POST .../commissions/batch to add many at once.
4. Add deductions
POST /settlements/{settlementId}/deductions
{
"contractor_id": "<contractor guid>",
"deduction_type_id": 3,
"amount": 90,
"external_id": "DED-1001",
"stm_client_id": 1347
}Include stm_client_id in the body. Deduction types are validated against your client, and sending it ensures the right client is used. Use POST .../deductions/batch for bulk.
Rules: a contractor's total deductions cannot exceed their total commissions, and amounts cannot be negative.
5. Mark ready for processing
PUT /settlements/{settlementId} with the full settlement body and status: 2.
{
"external_id": "WEEK-2026-44",
"start_date": "2026-10-26T00:00:00Z",
"end_date": "2026-11-01T23:59:59Z",
"requested_disbursement_date": "2026-11-12T00:00:00",
"status": 2
}The change to 2 is what starts processing, so make sure all commissions and deductions are in place first.
Tips
- Don't pass
?validate=false. Let the API reject bad data up front. external_idis your own reference; use it to reconcile with your system.
