> ## Documentation Index
> Fetch the complete documentation index at: https://juspay-78-sa-banks.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Legacy Update Score

> Legacy compatibility route. New integrations should use /update-gateway-score.



## OpenAPI

````yaml decision_engine_openapi-specs.json POST /update-score
openapi: 3.1.0
info:
  title: Decision Engine
  description: >-
    Open-source payment gateway routing service by Juspay. Selects the optimal
    payment processor for each transaction in real-time using success-rate
    scoring, rule-based routing, and elimination logic.


    ## Authentication


    This API supports two authentication methods:


    1. **JWT Bearer Token** - For dashboard/user sessions
       - Header: `Authorization: Bearer <jwt_token>`
       - Obtain via `/auth/login` endpoint

    2. **API Key** - For service-to-service/programmatic access
       - Header: `x-api-key: DE_<64_char_hex>`
       - Create via `/api-key/create` endpoint

    Protected endpoints require one of these authentication methods.
  version: 1.4.0
  contact:
    name: Juspay
    url: https://github.com/juspay/decision-engine
  license:
    name: AGPL-3.0
    url: https://www.gnu.org/licenses/agpl-3.0.html
servers:
  - url: http://localhost:8080
    description: Local development
  - url: https://sandbox.hyperswitch.io
    description: 'Hyperswitch sandbox with x-feature: decision-engine'
security: []
tags:
  - name: Health
    description: Service liveness, readiness, and diagnostics
  - name: Auth
    description: Dashboard auth and merchant selection
  - name: API Keys
    description: Service-to-service API key management
  - name: Gateway Decision
    description: Core routing decision APIs
  - name: Score Feedback
    description: Feed transaction outcomes back to improve SR scoring
  - name: Merchant Account
    description: Merchant configuration management
  - name: Routing Rules
    description: Euclid declarative routing rules engine
  - name: Rule Configuration
    description: Service-level SR/elimination config
  - name: Config
    description: Routing key and dimension metadata
  - name: Analytics
    description: ClickHouse-backed analytics and audit reads
  - name: Compatibility
    description: Legacy compatibility routes
  - name: Connector Costs
  - name: Merchant Features
  - name: Autopilot
paths:
  /update-score:
    post:
      tags:
        - Compatibility
      summary: Legacy update score
      description: >-
        Legacy compatibility route. New integrations should use
        /update-gateway-score.
      operationId: legacyUpdateScore
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LegacyUpdateScoreRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: string
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
components:
  schemas:
    LegacyUpdateScoreRequest:
      type: object
      required:
        - txn_detail
        - txn_card_info
        - log_message
      properties:
        txn_detail:
          type: object
          required:
            - partitionKey
            - id
            - netAmount
            - currency
          properties:
            partitionKey:
              type:
                - string
                - 'null'
              description: Required key. May be null.
            id:
              type: string
              example: '1'
              description: >-
                Numeric string. Must be present and parse as an integer - the
                conversion unwraps the parsed value, so a missing or non-numeric
                id panics the handler instead of returning a 4xx.
            netAmount:
              type: number
              format: double
              example: 1000
            currency:
              type: string
              example: USD
          additionalProperties: true
          description: >-
            Full internal transaction object. Note: `partitionKey` must be
            PRESENT in this object (it may be `null`). It is an `Option` field
            with a custom `deserialize_with` and no `serde(default)`, so serde
            requires the key even though the value is nullable.
        txn_card_info:
          type: object
          required:
            - partitionKey
            - id
          properties:
            partitionKey:
              type:
                - string
                - 'null'
              description: Required key. May be null.
            id:
              type: string
              example: '1'
              description: Numeric string.
            txnId:
              type: string
            txnDetailId:
              type: string
              example: '1'
              description: Numeric string.
          additionalProperties: true
          description: >-
            Full internal card/payment-method object. Note: `partitionKey` must
            be PRESENT in this object (it may be `null`). It is an `Option`
            field with a custom `deserialize_with` and no `serde(default)`, so
            serde requires the key even though the value is nullable.
        log_message:
          type: string
          example: Transaction completed
        enforce_dynaic_routing_failure:
          type:
            - boolean
            - 'null'
        gateway_reference_id:
          type:
            - string
            - 'null'
        txn_latency:
          type:
            - object
            - 'null'
          properties:
            gatewayLatency:
              type:
                - number
                - 'null'
              format: double
              example: 120.5
      description: >-
        Legacy score-feedback payload built from full internal transaction
        objects. This is NOT the `/update-gateway-score` shape. `txn_detail` and
        `txn_card_info` must each carry a `partitionKey` key (value may be
        null), and their `id` fields are numeric strings.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token obtained from /auth/login
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key created via /api-key/create

````