Skip to Content
APIAPI calls & examples

API calls & examples

The Routix API is a versioned REST API accessible through the API proxy. All requests require a valid OAuth token.

User level: Advanced

Base URL

https://api.routix.com/functions/v1/api/{version}/{publicBranchId}/{resource}
SegmentDescriptionExample
{version}API versionv1 or v2
{publicBranchId}8-character public branch IDRS2RDH3B
{resource}Resource nameaccounts

Full example:

GET https://api.routix.com/functions/v1/api/v1/RS2RDH3B/accounts

Authentication

Include the OAuth access token in every request:

Authorization: Bearer eyJhbGciOiJIUzI1NiIs...

Only OAuth tokens are accepted. Regular Routix user tokens are rejected by the API proxy.

Available resources

ResourceRequired scopeStatus
accountsroutix:accounts:readLive
ordersroutix:orders:readPlanned
vehiclesroutix:vehicles:readPlanned

Accounts

List accounts

GET /functions/v1/api/v1/{branchId}/accounts

Query parameters:

ParameterTypeDefaultMaxDescription
limitinteger501000Number of records per page.
offsetinteger0-Pagination offset.

Example request:

curl -X GET "https://api.routix.com/functions/v1/api/v1/RS2RDH3B/accounts?limit=10&offset=0" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."

Example response for v1:

{ "data": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "company_name": "Acme Transport B.V.", "email": "info@acmetransport.nl", "phone": "+31 20 123 4567", "account_type": "customer", "status": "active" }, { "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "company_name": "FastFreight Logistics", "email": "contact@fastfreight.nl", "phone": "+31 30 987 6543", "account_type": "carrier", "status": "active" } ], "pagination": { "limit": 10, "offset": 0, "total": 2 }, "version": "v1" }

Fields per version

v1 fields for accounts

The v1 response contains a stable, immutable set of 6 fields:

FieldTypeDescription
iduuidUnique identifier.
company_namestringCompany name.
emailstringPrimary email address.
phonestringPhone number.
account_typestringcustomer, vendor, or carrier.
statusstringAccount status.

v2 fields for accounts

v2 returns all v1 fields plus additional detail fields:

Additional fieldTypeDescription
websitestringCompany website.
industrystringIndustry sector.
lead_sourcestringHow the account was acquired.
visit_address_streetstringVisit address street.
visit_address_numberstringVisit address number.
visit_address_additionstringVisit address addition.
visit_address_zipcodestringVisit address postal code.
visit_address_citystringVisit address city.
shipping_address_streetstringShipping address street.
shipping_address_numberstringShipping address number.
shipping_address_additionstringShipping address addition.
shipping_address_zipcodestringShipping address postal code.
shipping_address_citystringShipping address city.
billing_address_streetstringBilling address street.
billing_address_numberstringBilling address number.
billing_address_additionstringBilling address addition.
billing_address_zipcodestringBilling address postal code.
billing_address_citystringBilling address city.
invoice_emailstringSeparate invoicing email.
vat_numberstringVAT registration number.
chamber_of_commerce_numberstringChamber of commerce number.
ibanstringBank account number.
bicstringBank BIC or SWIFT code.
payment_termsstringPayment terms.
credit_limitnumberCredit limit.
commentstringInternal notes.
registration_datetimestampRegistration date.
created_attimestampRecord creation date.
last_updated_attimestampLast modification date.

Recommendation: use v1 for stable production integrations. Use v2 when you need more detail and can handle field additions.

Response format

Success: list response

{ "data": [], "pagination": { "limit": 50, "offset": 0, "total": 123 }, "version": "v1" }

Error response

{ "error": "insufficient_scope", "error_description": "Token does not contain the required scope: routix:accounts:read" }

HTTP status codes

CodeMeaning
200Success
400Bad request, invalid parameters
401Unauthorized, missing or expired token
403Forbidden, insufficient scope or branch access
404Not found, invalid branch ID or resource
405Method not allowed, only GET is supported
429Rate limited
500Internal server error

Rate limits

EndpointLimit
REST API1000 requests per minute per organization
Edge Functions100 requests per minute per user
Token endpoint30 requests per minute per client

When you receive a 429, implement exponential backoff with jitter.

Code examples

JavaScript / Node.js

const ROUTIX_URL = 'https://api.routix.com'; async function getToken(clientId, clientSecret) { const res = await fetch(`${ROUTIX_URL}/functions/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 getAccounts(token, branchId, { limit = 50, offset = 0 } = {}) { const url = `${ROUTIX_URL}/functions/v1/api/v1/${branchId}/accounts?limit=${limit}&offset=${offset}`; 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}/functions/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 get_accounts(token: str, branch_id: str, limit: int = 50, offset: int = 0) -> dict: response = requests.get( f"{ROUTIX_URL}/functions/v1/api/v1/{branch_id}/accounts", headers={"Authorization": f"Bearer {token}"}, params={"limit": limit, "offset": offset}, ) 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/functions/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']; }

C# / .NET

using System.Net.Http.Headers; using System.Net.Http.Json; using System.Text.Json; var routixUrl = "https://api.routix.com"; var httpClient = new HttpClient(); var tokenResponse = await httpClient.PostAsJsonAsync( $"{routixUrl}/functions/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 accounts = await httpClient.GetFromJsonAsync<JsonElement>( $"{routixUrl}/functions/v1/api/v1/RS2RDH3B/accounts?limit=10");
  • API integration
  • Setup guide
Last updated on