> ## 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 - Update success based dynamic routing config for profile

> Update success based dynamic routing algorithm



## OpenAPI

````yaml public/openapi.json patch /account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/config/{algorithm_id}
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:
  /account/{account_id}/business_profile/{profile_id}/dynamic_routing/success_based/config/{algorithm_id}:
    patch:
      tags:
        - Routing
      summary: Routing - Update success based dynamic routing config for profile
      description: Update success based dynamic routing algorithm
      operationId: Update success based dynamic routing configs
      parameters:
        - name: account_id
          in: path
          description: Merchant id
          required: true
          schema:
            type: string
        - name: profile_id
          in: path
          description: Profile id under which Dynamic routing needs to be toggled
          required: true
          schema:
            type: string
        - name: algorithm_id
          in: path
          description: >-
            Success based routing algorithm id which was last activated to
            update the config
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SuccessBasedRoutingConfig'
        required: true
      responses:
        '200':
          description: Routing Algorithm updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutingDictionaryRecord'
        '400':
          description: Update body is malformed
        '403':
          description: Forbidden
        '404':
          description: Resource missing
        '422':
          description: Unprocessable request
        '500':
          description: Internal server error
      security:
        - api_key: []
        - jwt_key: []
components:
  schemas:
    SuccessBasedRoutingConfig:
      type: object
      required:
        - decision_engine_configs
      properties:
        params:
          type: array
          items:
            $ref: '#/components/schemas/DynamicRoutingConfigParams'
          nullable: true
        config:
          allOf:
            - $ref: '#/components/schemas/SuccessBasedRoutingConfigBody'
          nullable: true
        decision_engine_configs:
          $ref: '#/components/schemas/DecisionEngineSuccessRateData'
      additionalProperties: false
    RoutingDictionaryRecord:
      type: object
      required:
        - id
        - profile_id
        - name
        - kind
        - description
        - created_at
        - modified_at
      properties:
        id:
          type: string
        profile_id:
          type: string
        name:
          type: string
        kind:
          $ref: '#/components/schemas/RoutingAlgorithmKind'
        description:
          type: string
        created_at:
          type: integer
          format: int64
        modified_at:
          type: integer
          format: int64
        algorithm_for:
          allOf:
            - $ref: '#/components/schemas/TransactionType'
          nullable: true
        decision_engine_routing_id:
          type: string
          nullable: true
    DynamicRoutingConfigParams:
      type: string
      enum:
        - PaymentMethod
        - PaymentMethodType
        - AuthenticationType
        - Currency
        - Country
        - CardNetwork
        - CardBin
    SuccessBasedRoutingConfigBody:
      type: object
      properties:
        min_aggregates_size:
          type: integer
          format: int32
          nullable: true
          minimum: 0
        default_success_rate:
          type: number
          format: double
          nullable: true
        max_aggregates_size:
          type: integer
          format: int32
          nullable: true
          minimum: 0
        current_block_threshold:
          allOf:
            - $ref: '#/components/schemas/CurrentBlockThreshold'
          nullable: true
        specificity_level:
          $ref: '#/components/schemas/SuccessRateSpecificityLevel'
        exploration_percent:
          type: number
          format: double
          nullable: true
        shuffle_on_tie_during_exploitation:
          type: boolean
          nullable: true
    DecisionEngineSuccessRateData:
      type: object
      properties:
        defaultLatencyThreshold:
          type: number
          format: double
          nullable: true
        defaultBucketSize:
          type: integer
          format: int32
          nullable: true
        defaultHedgingPercent:
          type: number
          format: double
          nullable: true
        defaultLowerResetFactor:
          type: number
          format: double
          nullable: true
        defaultUpperResetFactor:
          type: number
          format: double
          nullable: true
        defaultGatewayExtraScore:
          type: array
          items:
            $ref: '#/components/schemas/DecisionEngineGatewayWiseExtraScore'
          nullable: true
        subLevelInputConfig:
          type: array
          items:
            $ref: '#/components/schemas/DecisionEngineSRSubLevelInputConfig'
          nullable: true
    RoutingAlgorithmKind:
      type: string
      enum:
        - single
        - priority
        - volume_split
        - advanced
        - dynamic
        - three_ds_decision_rule
    TransactionType:
      type: string
      enum:
        - payment
        - payout
        - three_ds_authentication
    CurrentBlockThreshold:
      type: object
      properties:
        duration_in_mins:
          type: integer
          format: int64
          nullable: true
          minimum: 0
        max_total_count:
          type: integer
          format: int64
          nullable: true
          minimum: 0
    SuccessRateSpecificityLevel:
      type: string
      enum:
        - merchant
        - global
    DecisionEngineGatewayWiseExtraScore:
      type: object
      required:
        - gatewayName
        - gatewaySigmaFactor
      properties:
        gatewayName:
          type: string
        gatewaySigmaFactor:
          type: number
          format: double
    DecisionEngineSRSubLevelInputConfig:
      type: object
      properties:
        paymentMethodType:
          type: string
          nullable: true
        paymentMethod:
          type: string
          nullable: true
        latencyThreshold:
          type: number
          format: double
          nullable: true
        bucketSize:
          type: integer
          format: int32
          nullable: true
        hedgingPercent:
          type: number
          format: double
          nullable: true
        lowerResetFactor:
          type: number
          format: double
          nullable: true
        upperResetFactor:
          type: number
          format: double
          nullable: true
        gatewayExtraScore:
          type: array
          items:
            $ref: '#/components/schemas/DecisionEngineGatewayWiseExtraScore'
          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.
    jwt_key:
      type: http
      scheme: bearer
      bearerFormat: JWT

````