> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paymnt.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Routing - Evaluate

> Evaluate routing rules



## OpenAPI

````yaml public/openapi.json post /routing/evaluate
openapi: 3.0.3
info:
  title: PaymntCloud - API Documentation
  description: >

    ## Get started


    PaymntCloud provides a collection of APIs that enable you to process and
    manage payments.

    Our APIs accept and return JSON in the HTTP body, and return standard HTTP
    response codes.


    You can consume the APIs directly using your favorite HTTP/REST library.


    We have a testing environment referred to "sandbox", which you can setup to
    test API calls without

    affecting production data.

    Currently, our sandbox environment is live while our production environment
    is under development

    and will be available soon.

    You can sign up on our Dashboard to get API keys to access PaymntCloud API.


    ### Environment


    Use the following base URLs when making requests to the APIs:


    | Environment   |  Base URL                          |

    |---------------|------------------------------------|

    | Sandbox       | <https://sandbox.paymnt.cloud>   |

    | Production    | <https://api.paymnt.cloud>       |


    ## Authentication


    When you sign up on our [dashboard](https://dash.paymnt.cloud) and create a
    merchant

    account, you are given a secret key (also referred as api-key) and a
    publishable key.

    You may authenticate all API requests with PaymntCloud server by providing
    the appropriate key in

    the request Authorization header.


    | Key             | 
    Description                                                                                 
    |

    |-----------------|-----------------------------------------------------------------------------------------------|

    | api-key         | Private key. Used to authenticate all API requests from
    your merchant server                  |

    | publishable key | Unique identifier for your account. Used to authenticate
    API requests from your app's client  |


    Never share your secret api keys. Keep them guarded and secure.
  contact:
    name: PaymntCloud Support
    url: https://paymnt.cloud
    email: support@paymnt.cloud
  license:
    name: Apache-2.0
  version: 0.1.0
servers:
  - url: https://api.paymnt.cloud
    description: Production Environment
  - url: https://sandbox.paymnt.cloud
    description: Sandbox Environment
security: []
tags:
  - name: Merchant Account
    description: Create and manage merchant accounts
  - name: Profile
    description: Create and manage profiles
  - name: Merchant Connector Account
    description: Create and manage merchant connector accounts
  - name: Payments
    description: Create and manage one-time payments, recurring payments and mandates
  - name: Refunds
    description: Create and manage refunds for successful payments
  - name: Mandates
    description: Manage mandates
  - name: Customers
    description: Create and manage customers
  - name: Payment Methods
    description: Create and manage payment methods of customers
  - name: Disputes
    description: Manage disputes
  - name: API Key
    description: Create and manage API Keys
  - name: Payouts
    description: Create and manage payouts
  - name: payment link
    description: Create payment link
  - name: Routing
    description: Create and manage routing configurations
  - name: Event
    description: Manage events
  - name: Authentication
    description: Create and manage authentication
paths:
  /routing/evaluate:
    post:
      tags:
        - Routing
      summary: Routing - Evaluate
      description: Evaluate routing rules
      operationId: Evaluate routing rules
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpenRouterDecideGatewayRequest'
        required: true
      responses:
        '200':
          description: Routing rules evaluated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DecideGatewayResponse'
        '400':
          description: Request body is malformed
        '403':
          description: Forbidden
        '404':
          description: Resource missing
        '422':
          description: Unprocessable request
        '500':
          description: Internal server error
      security:
        - api_key: []
components:
  schemas:
    OpenRouterDecideGatewayRequest:
      type: object
      required:
        - paymentInfo
        - merchantId
      properties:
        paymentInfo:
          $ref: '#/components/schemas/PaymentInfo'
        merchantId:
          type: string
        eligibleGatewayList:
          type: array
          items:
            type: string
          nullable: true
        rankingAlgorithm:
          allOf:
            - $ref: '#/components/schemas/RankingAlgorithm'
          nullable: true
        eliminationEnabled:
          type: boolean
          nullable: true
    DecideGatewayResponse:
      type: object
      properties:
        decided_gateway:
          type: string
          nullable: true
        gateway_priority_map:
          nullable: true
        filter_wise_gateways:
          nullable: true
        priority_logic_tag:
          type: string
          nullable: true
        routing_approach:
          type: string
          nullable: true
        gateway_before_evaluation:
          type: string
          nullable: true
        priority_logic_output:
          allOf:
            - $ref: '#/components/schemas/PriorityLogicOutput'
          nullable: true
        reset_approach:
          type: string
          nullable: true
        routing_dimension:
          type: string
          nullable: true
        routing_dimension_level:
          type: string
          nullable: true
        is_scheduled_outage:
          type: boolean
          nullable: true
        is_dynamic_mga_enabled:
          type: boolean
          nullable: true
        gateway_mga_id_map:
          nullable: true
    PaymentInfo:
      type: object
      required:
        - paymentId
        - amount
        - currency
        - paymentType
        - paymentMethodType
        - paymentMethod
      properties:
        paymentId:
          type: string
        amount:
          $ref: '#/components/schemas/MinorUnit'
        currency:
          $ref: '#/components/schemas/Currency'
        paymentType:
          type: string
        metadata:
          type: string
          nullable: true
        paymentMethodType:
          type: string
        paymentMethod:
          $ref: '#/components/schemas/PaymentMethod'
        cardIsin:
          type: string
          nullable: true
    RankingAlgorithm:
      type: string
      enum:
        - SR_BASED_ROUTING
        - PL_BASED_ROUTING
        - NTW_BASED_ROUTING
    PriorityLogicOutput:
      type: object
      properties:
        isEnforcement:
          type: boolean
          nullable: true
        gws:
          type: array
          items:
            type: string
          nullable: true
        priorityLogicTag:
          type: string
          nullable: true
        gatewayReferenceIds:
          type: object
          additionalProperties:
            type: string
          nullable: true
        primaryLogic:
          allOf:
            - $ref: '#/components/schemas/PriorityLogicData'
          nullable: true
        fallbackLogic:
          allOf:
            - $ref: '#/components/schemas/PriorityLogicData'
          nullable: true
    MinorUnit:
      type: integer
      format: int64
      description: This Unit struct represents MinorUnit in which core amount works
    Currency:
      type: string
      description: >-
        The three-letter ISO 4217 currency code (e.g., "USD", "EUR") for the
        payment amount. This field is mandatory for creating a payment.
      enum:
        - AED
        - AFN
        - ALL
        - AMD
        - ANG
        - AOA
        - ARS
        - AUD
        - AWG
        - AZN
        - BAM
        - BBD
        - BDT
        - BGN
        - BHD
        - BIF
        - BMD
        - BND
        - BOB
        - BRL
        - BSD
        - BTN
        - BWP
        - BYN
        - BZD
        - CAD
        - CDF
        - CHF
        - CLF
        - CLP
        - CNY
        - COP
        - CRC
        - CUC
        - CUP
        - CVE
        - CZK
        - DJF
        - DKK
        - DOP
        - DZD
        - EGP
        - ERN
        - ETB
        - EUR
        - FJD
        - FKP
        - GBP
        - GEL
        - GHS
        - GIP
        - GMD
        - GNF
        - GTQ
        - GYD
        - HKD
        - HNL
        - HRK
        - HTG
        - HUF
        - IDR
        - ILS
        - INR
        - IQD
        - IRR
        - ISK
        - JMD
        - JOD
        - JPY
        - KES
        - KGS
        - KHR
        - KMF
        - KPW
        - KRW
        - KWD
        - KYD
        - KZT
        - LAK
        - LBP
        - LKR
        - LRD
        - LSL
        - LYD
        - MAD
        - MDL
        - MGA
        - MKD
        - MMK
        - MNT
        - MOP
        - MRU
        - MUR
        - MVR
        - MWK
        - MXN
        - MYR
        - MZN
        - NAD
        - NGN
        - NIO
        - NOK
        - NPR
        - NZD
        - OMR
        - PAB
        - PEN
        - PGK
        - PHP
        - PKR
        - PLN
        - PYG
        - QAR
        - RON
        - RSD
        - RUB
        - RWF
        - SAR
        - SBD
        - SCR
        - SDG
        - SEK
        - SGD
        - SHP
        - SLE
        - SLL
        - SOS
        - SRD
        - SSP
        - STD
        - STN
        - SVC
        - SYP
        - SZL
        - THB
        - TJS
        - TMT
        - TND
        - TOP
        - TRY
        - TTD
        - TWD
        - TZS
        - UAH
        - UGX
        - USD
        - UYU
        - UZS
        - VES
        - VND
        - VUV
        - WST
        - XAF
        - XCD
        - XOF
        - XPF
        - YER
        - ZAR
        - ZMW
        - ZWL
    PaymentMethod:
      type: string
      description: 'Indicates the type of payment method. Eg: ''card'', ''wallet'', etc.'
      enum:
        - card
        - card_redirect
        - pay_later
        - wallet
        - bank_redirect
        - bank_transfer
        - crypto
        - bank_debit
        - reward
        - real_time_payment
        - upi
        - voucher
        - gift_card
        - open_banking
        - mobile_payment
    PriorityLogicData:
      type: object
      properties:
        name:
          type: string
          nullable: true
        status:
          type: string
          nullable: true
        failure_reason:
          type: string
          nullable: true
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: api-key
      description: >-
        Use the API key created under your merchant account from the PaymntCloud
        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.

````