Routing - Create

Create a routing configuration.

HTTP request

POST https://sandbox.hyperswitch.io/routing

Example (cURL)

curl --request POST \
  --url https://sandbox.hyperswitch.io/routing \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "algorithm": {
    "type": "single",
    "data": {
      "connector": "authipay",
      "merchant_connector_id": "<string>"
    }
  },
  "profile_id": "<string>",
  "transaction_type": "payment"
}
'

Successful response (200)

Authorization

  • api-key (header, required)

Use the API key created under your merchant account from the HyperSwitch dashboard. API key is used to authenticate API requests from your merchant server only. Don't expose this key on a website or embed it in a mobile application.

Request body (application/json)

  • name — string | null

  • description — string | null

  • algorithm — object

    • (See algorithm options below)

  • profile_id — string | null

  • transaction_type — enum

    • Available options: payment, payout, three_ds_authentication

algorithm (object) — options

Possible algorithm types (examples shown in the original docs):

  • Option 1

  • Option 2

  • Option 3

  • Option 4

  • Option 5

Example excerpt used in the cURL above:

Response (200 — application/json)

Routing config created. Response fields:

  • id — string (required)

  • profile_id — string (required)

  • name — string (required)

  • kind — enum (required) Available options: single, priority, volume_split, advanced, dynamic, three_ds_decision_rule

  • description — string (required)

  • created_at — integer (required)

  • modified_at — integer (required)

  • algorithm_for — enum Available options: payment, payout, three_ds_authentication

  • decision_engine_routing_id — string | null


Suggest edits: https://github.com/juspay/hyperswitch/edit/main/api-reference/v1/routing/routing--create.mdx Raise issue: https://github.com/juspay/hyperswitch/issues/new?title=Issue%20on%20docs&body=Path:%20/v1/routing/routing--create

Related:

  • Routing - List: https://api-reference.hyperswitch.io/v1/routing/routing--list

  • Routing - Auth Rate Based: https://api-reference.hyperswitch.io/v1/routing/routing--success-based