Skip to main content

Step 5 — Register interventions

Each intervention is a technical work block (diagnosis, repair, travel) usually linked to the service order, and it carries three billable things: parts (details), hours (discountTime) and km (commuteTime).

POST /gateway/intervention
Content-Type: application/json
Authorization: Bearer {token}
{
"type": "DIAG",
"status": "CURSO",
"description": "Initial PSU diagnosis",
"userId": 1,
"entityKeyId": "C0001",
"equipmentId": 123,
"serviceOrderGuid": "ORDER-GUID",
"openingTime": "2026-08-12T09:00:00Z",
"closureTime": "2026-08-12T10:30:00Z",
"problem": "PSU does not output 19V.",
"solution": "PSU replaced. Boot test OK.",
"concluded": true,
"urgent": false,
"external": false,
"entityContractId": 1,
"discountTime": 1.5,
"discountTimeItemId": "MO-HORA",
"commuteTime": 12,
"commuteTimeItemId": "KM",
"details": [
{
"itemKeyId": "FONTE-19V",
"itemDescription": "19V / 65W power supply",
"quantity": 1,
"retailPrice": 45.00
}
]
}

Required (API validation): type, status (from Step 1.4), description, entityKeyId and userId (≥ 1).

For invoicing: details (applied parts, see Step 4.1), discountTime with discountTimeItemId (hours used and the item that prices them) and commuteTime with commuteTimeItemId (travel). entityContractId links the intervention to the contract so hours are debited from the ceiling.

warning

Hours only appear on the invoice if discountTime > 0 and discountTimeItemId is set — the same for km. Without the item, the line is not generated and there is no warning.

How to link an intervention to an existing order (create-time, association endpoint, edit rules): see Step 5.1 on the overview.

Useful queries

EndpointPurpose
GET /intervention/{guid}/billing-detailsHours to invoice / invoiced, km — basis for invoicing
GET /intervention/by-contract/{contractId}Interventions for a contract
GET /intervention/next-idNext identifier

Next

Close the service order.