Skip to Content

PATCH Tariffs

Gebruik dit endpoint om bestaande tariffs bij te werken.

Gebruikersniveau: Gevorderd

Endpoint

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

Update-regels

  • De API controleert server-side of het record binnen de toegestane organization en branch valt.
  • Dit is een branch-or-null resource, maar de PATCH-call gebruikt nog steeds een branch UUID in {scopeId}.
  • Alleen expliciet toegestane velden mogen worden bijgewerkt.
  • Onbekende of niet-toegestane velden geven 400 invalid_update.

Toegestane updatevelden

Veld
type
item_id
zone_id
description
price

Voorbeeldrequest

curl -X PATCH "https://api.routix.com/v1/550e8400-e29b-41d4-a716-446655440000/tariffs/fe4e56ae-1d6a-46d2-a416-4b5b0fc546b7" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \ -H "Content-Type: application/json" \ -d '{ "description": "Flat rate within Zone A", "price": 125 }'

Voorbeeldresponse

{ "data": { "id": "fe4e56ae-1d6a-46d2-a416-4b5b0fc546b7", "type": "flat_rate", "item_id": "d021bce1-a12b-462f-9d77-9fe0c2b55959", "zone_id": "3c312fd9-975e-43d8-a661-75d5649b1d8d", "description": "Flat rate within Zone A", "price": 125 }, "version": "v1" }

Foutresponse

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

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

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