Routing Rules

Evaluate routing rule

Changed on

Evaluate the active routing rule for a merchant against a payment context. Returns the ordered list of gateways selected by the rule without consuming SR data.

post/routing/evaluate

Request

  • Base URL
    http://localhost:8080
  • URL
    http://localhost:8080/routing/evaluate
  • Auth
    • HTTP bearer
    • or API key in header x-api-key

Request body

created_bystring required

Merchant that owns the routing rule.

payment_idstring nullable
parametersobject required

Map of rule-builder key to typed value. A null value means the key is present but unset.

Example request

{
  "created_by": "merchant_demo",
  "payment_id": "rule_decision_001",
  "fallback_output": [
    {
      "gateway_name": "stripe",
      "gateway_id": "mca_111"
    }
  ],
  "parameters": {
    "payment_method_type": {
      "type": "enum_variant",
      "value": "credit"
    },
    "amount": {
      "type": "number",
      "value": 1000
    }
  }
}

Response

Evaluation result with ordered gateway list

payment_idstring nullable
statusstring
outputobject

Raw output of the matched rule, tagged by algorithm type (priority, single, volume_split, advanced).

Example response

{
  "status": "success",
  "evaluated_output": [
    {
      "gateway_name": "stripe",
      "gateway_id": "mca_111"
    }
  ],
  "eligible_connectors": [
    {
      "gateway_name": "stripe",
      "gateway_id": "mca_111"
    }
  ]
}

Changes

    • breaking

      added the new required request property

    • breaking

      added the new required request property

    • warning

      removed the request property

    • warning

      removed the request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      the endpoint scheme security ApiKeyAuth was added to the API

    • info

      the endpoint scheme security BearerAuth was added to the API