API calls en voorbeelden
De Routix API is een versiebeheerde REST API die via de API proxy beschikbaar is. Alle requests vereisen een geldige OAuth-token.
Gebruikersniveau: Gevorderd
Base URL
https://api.routix.com/v1/{scopeId}/{resource}| Segment | Beschrijving | Voorbeeld |
|---|---|---|
{scopeId} | Organization UUID of branch UUID, afhankelijk van de resource | 123e4567-e89b-12d3-a456-426614174000 |
{resource} | Naam van de resource | accounts |
Volledig voorbeeld:
GET https://api.routix.com/v1/550e8400-e29b-41d4-a716-446655440000/accountsAuthenticatie
Stuur de OAuth access token mee in elke request:
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...Alleen OAuth-tokens worden geaccepteerd. Reguliere Routix-gebruikerstokens worden door de API proxy geweigerd.
Route patterns
De resource-calls volgen dit patroon:
/v1/{scopeId}/{resource}Update-calls volgen dit patroon:
/v1/{scopeId}/{resource}/{id}Organization-scoped resources gebruiken de organization UUID in het pad:
branchesorganizationsusersmaster_data
Branch-scoped resources gebruiken de branch UUID in het pad, bijvoorbeeld:
accountsprojectsshipmentstripsitemstariffszonesquotations
Ondersteunde queryparameters
| Parameter | Type | Default | Beschrijving |
|---|---|---|---|
limit | integer | 50 | Aantal records per pagina |
offset | integer | 0 | Paginatie-offset |
sort | string | - | Sorteerexpressie in het formaat field:asc of field:desc |
filter | string | - | Filterexpressie in het formaat field:operator:value |
Filteren en sorteren
De API ondersteunt nu een generieke query-syntax voor list-calls.
Syntax
sort=field:asc
sort=field:desc
filter=field:operator:valueJe kunt filter herhalen om meerdere filters in dezelfde request mee te geven.
Voorbeeld:
?limit=25&offset=0&sort=company_name:asc&filter=status:eq:active&filter=account_type:in:customer,carrierOndersteunde operators
| Operator | Betekenis |
|---|---|
eq | Exact gelijk aan |
ne | Niet gelijk aan |
in | Waarde zit in een lijst |
gt | Groter dan |
gte | Groter dan of gelijk aan |
lt | Kleiner dan |
lte | Kleiner dan of gelijk aan |
like | Hoofdlettergevoelige tekstmatch |
ilike | Niet-hoofdlettergevoelige tekstmatch |
isnull | Controle op nullwaarde |
Belangrijke regels
- Filteren en sorteren is per resource gewhitelist.
organization_idenbranch_idzijn gereserveerd voor server-side scoping en kunnen niet door clients gefilterd worden.- Tenant-scope blijft altijd server-controlled.
- Niet elk veld is per resource filterbaar of sorteerbaar.
Filtervoorbeelden
?filter=status:eq:active
?filter=account_type:in:customer,carrier
?filter=created_at:gte:2026-01-01
?filter=company_name:ilike:%transport%
?filter=valid_until:lt:2026-12-31
?filter=comment:isnull:true
?sort=company_name:asc
?sort=created_at:descVolledige voorbeeldcall
GET /v1/{scopeId}/accounts?limit=25&offset=0&sort=company_name:asc&filter=status:eq:active&filter=account_type:in:customer,carrierGebruik een branch UUID voor branch-scoped resources zoals accounts, orders, quotations, shipments, trips, items, tariffs en zones.
Gebruik een organization UUID voor organization-scoped resources zoals branches, organizations, users en master_data.
Gedeelde responsevorm
Alle lijstcalls gebruiken dezelfde basisstructuur:
{
"data": [],
"pagination": {
"limit": 50,
"offset": 0,
"total": 123
},
"version": "v1"
}HTTP-statuscodes
| Code | Betekenis |
|---|---|
| 200 | Succes |
| 400 | Bad request, ongeldige parameters |
| 401 | Unauthorized, ontbrekende of verlopen token |
| 403 | Forbidden, onvoldoende scope of branch-toegang |
| 404 | Not found, ongeldige organization UUID, branch UUID of resource |
| 405 | Method not allowed |
| 429 | Rate limited |
| 500 | Internal server error |
PATCH updates
De API ondersteunt nu ook updates via PATCH voor een beperkt aantal resources.
Endpoint patroon
PATCH /v1/{scopeId}/{resource}/{id}Update-regels
- Gebruik een branch UUID als
{scopeId}voor branch-scoped resources. - Gebruik een organization UUID als
{scopeId}voor organization-scoped resources. - De API controleert altijd server-side of de resource binnen de toegestane organization en branch valt.
- Alleen velden die expliciet zijn toegestaan per resource mogen bijgewerkt worden.
- Onbekende of niet-toegestane velden geven een
400 invalid_update. - De request body moet een JSON object zijn.
Ondersteunde PATCH resources en scopes
| Resource | Vereiste scope | Scope type |
|---|---|---|
accounts | routix:accounts:write | Branch UUID |
orders | routix:orders:write | Branch UUID |
projects | routix:projects:write | Branch UUID |
quotations | routix:quotations:write | Branch UUID |
shipments | routix:shipments:write | Branch UUID |
trips | routix:trips:write | Branch UUID |
vehicles | routix:vehicles:write | Organization UUID |
invoices | routix:invoices:write | Branch UUID |
items | routix:items:write | Branch UUID, branch-or-null resource |
tariffs | routix:tariffs:write | Branch UUID, branch-or-null resource |
zones | routix:zones:write | Branch UUID, branch-or-null resource |
PATCH voorbeeld
PATCH /v1/{scopeId}/accounts/{id}{
"status": "active",
"company_name": "Acme Transport B.V."
}PATCH foutcodes
| Code | Error |
|---|---|
| 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 |
POST creates
De API ondersteunt nu ook create-acties via POST voor een beperkt aantal resources.
Endpoint patroon
POST /v1/{scopeId}/{resource}Create-regels
- Gebruik een branch UUID als
{scopeId}voor branch-scoped resources. - Gebruik een organization UUID als
{scopeId}voor organization-scoped resources. - De API controleert altijd server-side of de resource binnen de toegestane organization en branch valt.
- Alleen velden die expliciet zijn toegestaan per resource mogen meegestuurd worden.
- Onbekende of niet-toegestane velden geven een
400 invalid_create. - De request body moet een JSON object zijn.
organization_idenbranch_idworden server-side gezet en mogen niet door de client bepaald worden.
Ondersteunde POST resources en scopes
| Resource | Vereiste scope | Scope type |
|---|---|---|
accounts | routix:accounts:write | Branch UUID |
orders | routix:orders:write | Branch UUID |
projects | routix:projects:write | Branch UUID |
quotations | routix:quotations:write | Branch UUID |
shipments | routix:shipments:write | Branch UUID |
trips | routix:trips:write | Branch UUID |
vehicles | routix:vehicles:write | Organization UUID |
invoices | routix:invoices:write | Branch UUID |
items | routix:items:write | Branch UUID, branch-or-null resource |
tariffs | routix:tariffs:write | Branch UUID, branch-or-null resource |
zones | routix:zones:write | Branch UUID, branch-or-null resource |
POST voorbeeld
POST /v1/{scopeId}/accounts{
"company_name": "Acme Transport B.V.",
"email": "[email protected]",
"phone": "+31 20 123 4567",
"account_type": "customer",
"status": "active"
}POST foutcodes
| Code | Error |
|---|---|
| 400 | invalid_request |
| 400 | invalid_create |
| 400 | create_failed |
| 401 | unauthorized |
| 401 | invalid_token |
| 403 | invalid_token_type |
| 403 | insufficient_scope |
| 404 | not_found |
| 405 | method_not_allowed |
DELETE deletes
De API ondersteunt nu ook delete-acties via DELETE voor een beperkt aantal resources.
Endpoint patroon
DELETE /v1/{scopeId}/{resource}/{id}Delete-regels
- Gebruik een branch UUID als
{scopeId}voor branch-scoped resources. - Gebruik een organization UUID als
{scopeId}voor organization-scoped resources. - De API controleert altijd server-side of de resource binnen de toegestane organization en branch valt.
DELETEgebruikt dezelfde write-scope alsPOSTenPATCH.- Een resource ID in de URL is verplicht.
- Er is geen request body nodig.
Ondersteunde DELETE resources en scopes
| Resource | Vereiste scope | Scope type |
|---|---|---|
accounts | routix:accounts:write | Branch UUID |
orders | routix:orders:write | Branch UUID |
projects | routix:projects:write | Branch UUID |
quotations | routix:quotations:write | Branch UUID |
shipments | routix:shipments:write | Branch UUID |
trips | routix:trips:write | Branch UUID |
vehicles | routix:vehicles:write | Organization UUID |
invoices | routix:invoices:write | Branch UUID |
items | routix:items:write | Branch UUID, branch-or-null resource |
tariffs | routix:tariffs:write | Branch UUID, branch-or-null resource |
zones | routix:zones:write | Branch UUID, branch-or-null resource |
DELETE voorbeeld
DELETE /v1/{scopeId}/accounts/{id}DELETE voorbeeld voor quotations
DELETE /v1/{scopeId}/quotations/{id}DELETE foutcodes
| Code | Error |
|---|---|
| 400 | invalid_request |
| 401 | unauthorized |
| 401 | invalid_token |
| 403 | invalid_token_type |
| 403 | insufficient_scope |
| 404 | not_found |
| 405 | method_not_allowed |
Rate limits
| Endpoint | Limiet |
|---|---|
| REST API | 1000 requests per minuut per organisatie |
| Edge Functions | 100 requests per minuut per gebruiker |
| Token endpoint | 30 requests per minuut per client |
Als je een 429 ontvangt, implementeer dan exponential backoff met jitter.
Codevoorbeelden
Deze voorbeelden zijn generiek opgezet: eerst vraag je een token aan, daarna roep je een willekeurig resourcepad aan binnen dezelfde organization- of branch-scope.
JavaScript / Node.js
const ROUTIX_URL = 'https://api.routix.com';
async function getToken(clientId, clientSecret) {
const res = await fetch(`${ROUTIX_URL}/v1/oauth/token`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret,
}),
});
if (!res.ok) {
const err = await res.json();
throw new Error(`Auth failed: ${err.error_description}`);
}
const data = await res.json();
return data.access_token;
}
async function callApi(token, scopeId, resourcePath) {
const url = `${ROUTIX_URL}/v1/${scopeId}/${resourcePath}`;
const res = await fetch(url, {
headers: { Authorization: `Bearer ${token}` },
});
if (!res.ok) {
const err = await res.json();
throw new Error(`API error: ${err.error_description}`);
}
return res.json();
}Python
import requests
ROUTIX_URL = "https://api.routix.com"
def get_token(client_id: str, client_secret: str) -> str:
response = requests.post(
f"{ROUTIX_URL}/v1/oauth/token",
json={
"grant_type": "client_credentials",
"client_id": client_id,
"client_secret": client_secret,
},
)
response.raise_for_status()
return response.json()["access_token"]
def call_api(token: str, scope_id: str, resource_path: str) -> dict:
response = requests.get(
f"{ROUTIX_URL}/v1/{scope_id}/{resource_path}",
headers={"Authorization": f"Bearer {token}"},
)
response.raise_for_status()
return response.json()PHP
<?php
$routixUrl = 'https://api.routix.com';
function getToken(string $clientId, string $clientSecret): string {
global $routixUrl;
$ch = curl_init("$routixUrl/v1/oauth/token");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'grant_type' => 'client_credentials',
'client_id' => $clientId,
'client_secret' => $clientSecret,
]),
]);
$response = json_decode(curl_exec($ch), true);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode !== 200) {
throw new Exception('Auth failed: ' . ($response['error_description'] ?? 'Unknown error'));
}
return $response['access_token'];
}
function callApi(string $token, string $scopeId, string $resourcePath): array {
global $routixUrl;
$ch = curl_init("$routixUrl/v1/$scopeId/$resourcePath");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer $token"],
]);
$response = json_decode(curl_exec($ch), true);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode !== 200) {
throw new Exception('API error: ' . ($response['error_description'] ?? 'Unknown error'));
}
return $response;
}C# / .NET
using System.Net.Http.Headers;
using System.Net.Http.Json;
var routixUrl = "https://api.routix.com";
var httpClient = new HttpClient();
var tokenResponse = await httpClient.PostAsJsonAsync(
$"{routixUrl}/v1/oauth/token",
new {
grant_type = "client_credentials",
client_id = "your-client-id",
client_secret = "routix_a1b2c3d4..."
});
var tokenData = await tokenResponse.Content.ReadFromJsonAsync<Dictionary<string, object>>();
var token = tokenData!["access_token"].ToString();
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", token);
var response = await httpClient.GetFromJsonAsync<object>(
$"{routixUrl}/v1/550e8400-e29b-41d4-a716-446655440000/accounts?limit=25&offset=0&sort=company_name:asc&filter=status:eq:active");Gerelateerde pagina’s
- API integratie
- Accounts
- Setup guide

