Routing examples
Complete, ready-to-adapt routing documents for the most common setups. The concepts behind the document format are explained in the Connector routing reference; field-level details are part of the API reference.
All examples use placeholder connector GUIDs (CO-…) — replace them with the GUIDs of your own connectors, for example from Connector – List.
Calling the API
Routing endpoints use the same BASIC authentication as the rest of the Provisioning API. A typical edit is a read–modify–write cycle:
- curl
- Python
- PHP
- Java
The response of every get/set call is itself a valid request body — you can feed a response’s routing object back into the matching set endpoint. One exception: multi-method rule trees authored in the admin interface may contain conditions that the multi-method endpoints do not accept — see the condition subset.
Currency split
Route EUR transactions to a preferred connector; everything else uses the default connector (else: null falls through to default):
Issuer-country routing
Route cards issued in the United States to a domestic connector, all other cards to an international one:
Load balancing
Send roughly 70% of the traffic to one connector and 30% to another:
Failover chain
Try a primary connector first; if it fails to process the transaction, fail over to a backup, then to a second backup:
The root node may itself be a leaf — this document routes all traffic through the failover chain without any condition.
Combining conditions
Route high-value EUR Visa transactions to a dedicated connector with failover; everything else follows simpler rules:
Multi-method: availability and routing
For a multi-method meta-connector (Set multi-method routing): offer card payments only to your customers in the DACH region, route high-value card transactions to a dedicated connector, and keep SEPA direct debit unconditional:
Remember that multi-method documents accept only the CustomerCountry, CustomerIpCountry, Currency, AmountCurrency, RiskScore and ExtraData conditions.
Multi-method: disabling one method
Methods omitted from the document are preserved untouched — so disabling a single method is a one-block document:
Updating rules in place
Responses return every rule with its server-assigned id. To change one condition without recreating the tree, echo the ids and edit only what should change.
Response of a previous get/set call:
Follow-up request — same rules, but the condition now also covers CHF (note the unchanged ids):
Removing all rules
Send tree: null — afterwards, all traffic uses the default connector:
Handling a rejected document
Rejected documents return HTTP status 422; the errorMessage names the offending part of the document, and the errorCode identifies the category (see the error code reference):