POST
/
v1
/
routing-rules
Create a routing rule
curl --request POST \
  --url http://localhost:8081/v1/routing-rules \
  --header 'Content-Type: application/json' \
  --header 'X-Org-Id: <x-org-id>' \
  --header 'X-Reevit-Key: <api-key>' \
  --data '
{
  "name": "<string>",
  "countries": [
    "<string>"
  ],
  "connection_id": "<string>",
  "methods": [
    "<string>"
  ],
  "priority": 0,
  "fallback_to_default": true,
  "enabled": true
}
'
{
  "id": "<string>",
  "name": "<string>",
  "countries": [
    "<string>"
  ],
  "methods": [
    "<string>"
  ],
  "connection_id": "<string>",
  "priority": 123,
  "fallback_to_default": true,
  "enabled": true,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

X-Reevit-Key
string
header
required

API key for server-to-server authentication

Headers

X-Org-Id
string
required

Organization identifier for multi-tenancy

Idempotency-Key
string

Idempotency key for safe retries

Body

application/json
name
string
required

Human-readable name for the rule

countries
string[]
required

ISO 3166-1 alpha-2 country codes (e.g., US, GB, GH)

Minimum array length: 1
connection_id
string
required

The connection to use when this rule matches

methods
string[]

Payment methods (e.g., card, mobile_money). Empty means all methods.

priority
integer
default:0

Higher priority rules are evaluated first

fallback_to_default
boolean
default:true

If true, fall back to default routing if the connection is unavailable

enabled
boolean
default:true

Response

Created

A routing rule that explicitly routes payments from specific countries/methods to a specific connection. Rules are evaluated by priority (highest first). If no rule matches, default routing logic is used.

id
string
name
string

Human-readable name for the rule

countries
string[]

ISO 3166-1 alpha-2 country codes (e.g., US, GB, GH)

methods
string[]

Payment methods (e.g., card, mobile_money). Empty means all methods.

connection_id
string

The connection to use when this rule matches

priority
integer

Higher priority rules are evaluated first

fallback_to_default
boolean

If true, fall back to default routing if the connection is unavailable

enabled
boolean
created_at
string<date-time>
updated_at
string<date-time>