Skip to Content

PATCH Trips

Gebruik dit endpoint om bestaande trips bij te werken.

Gebruikersniveau: Gevorderd

Endpoint

PATCH /v1/{scopeId}/trips/{id}
EigenschapWaarde
MethodPATCH
Scope IDBranch UUID
AuthenticatieAuthorization: Bearer <access_token>
Vereiste scoperoutix:trips:write
Content-Typeapplication/json
Request bodyJSON object

Update-regels

  • De API controleert server-side of het record binnen de toegestane organization en branch valt.
  • Alleen expliciet toegestane velden mogen worden bijgewerkt.
  • Onbekende of niet-toegestane velden geven 400 invalid_update.

Toegestane updatevelden

Veld
trip_date
vehicle_id
driver_id
status
planned_distance_km
is_charter
carrier_account_id

Voorbeeldrequest

curl -X PATCH "https://api.routix.com/v1/550e8400-e29b-41d4-a716-446655440000/trips/8c6f6b38-c46c-486d-9ee6-0b2ec458f3f1" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \ -H "Content-Type: application/json" \ -d '{ "status": "planned", "planned_distance_km": 185 }'

Voorbeeldresponse

{ "data": { "id": "8c6f6b38-c46c-486d-9ee6-0b2ec458f3f1", "trip_date": "2026-07-05", "vehicle_id": "91eb2f55-bc74-4ebb-a118-8d996a96f2f4", "driver_id": "e70d3a6a-799d-4a7d-88bd-0ad13f5211b4", "status": "planned", "planned_distance_km": 185, "is_charter": false, "carrier_account_id": "7ecf4b8d-8d1f-4a0f-8e57-6d8f14c6a221" }, "version": "v1" }

Foutresponse

{ "error": "invalid_update", "error_description": "One or more fields are not allowed for updates on trips" }

Mogelijke foutcodes

  • 400 invalid_request
  • 400 invalid_update
  • 401 unauthorized
  • 401 invalid_token
  • 403 invalid_token_type
  • 403 insufficient_scope
  • 404 not_found
  • 405 method_not_allowed

Gerelateerde pagina’s

  • Trips GET
  • API calls en voorbeelden
  • Setup guide
Last updated on