Legacy Update Score

August 4, 2026 ยท View on GitHub

Use case

Compatibility endpoint for older integrations that still call /update-score.

Authentication

Protected. Send either Authorization: Bearer <jwt_token> or x-api-key: <api_key>. In sandbox, also send x-feature: decision-engine.

For local development, start with:

export BASE_URL=http://localhost:8080
export AUTH_HEADER="Authorization: Bearer <jwt_token>"
# Sandbox only:
# export BASE_URL=https://sandbox.hyperswitch.io
# export FEATURE_HEADER="x-feature: decision-engine"

Request

  • Method and path: POST /update-score
  • Parameters: none.
  • Body: The legacy feedback payload built from full internal transaction objects (txn_detail, txn_card_info, plus log_message). This is not the /update-gateway-score shape.

txn_detail and txn_card_info must each carry a partitionKey key. The value may be null, but omitting the key fails with missing field \partitionKey`- it is anOptionfield with a custom deserializer and noserde(default)`, so serde requires the key to be present even though the value is nullable.

Example

Legacy update score

curl --location "$BASE_URL/update-score" \
  --header "$AUTH_HEADER" \
  --header "Content-Type: application/json" \
  --data '{
  "txn_detail": {
    "id": "1",
    "txnId": "txn_001",
    "orderId": "order_001",
    "merchantId": "merchant_demo",
    "status": "CHARGED",
    "type": "ORDER_PAYMENT",
    "txnUuid": "pay_001",
    "gateway": "stripe",
    "dateCreated": "2026-04-30T00:00:00.000000000Z",
    "txnAmount": 1000.0,
    "netAmount": 1000.0,
    "currency": "USD",
    "txnObjectType": "ORDER_PAYMENT",
    "sourceObject": "CREDIT",
    "isEmi": false,
    "partitionKey": null
  },
  "txn_card_info": {
    "id": "1",
    "txnId": "txn_001",
    "txnDetailId": "1",
    "paymentMethodType": "CARD",
    "paymentMethod": "CREDIT",
    "authType": "THREE_DS",
    "cardIsin": "411111",
    "cardType": "CREDIT",
    "dateCreated": "2026-04-30T00:00:00.000000000Z",
    "partitionKey": null
  },
  "log_message": "Transaction completed",
  "enforce_dynaic_routing_failure": false,
  "txn_latency": { "gatewayLatency": 120.5 }
}'

txn_detail.id, txn_card_info.id and txn_card_info.txnDetailId are numeric strings - the server parses them as integers, so a value like "card_001" is rejected. txn_detail.id in particular must be present and numeric: the conversion does .unwrap() on the parsed value, so a missing or non-numeric id panics the handler and the connection is closed with no response rather than a 4xx.

txn_detail also requires netAmount and currency alongside txnAmount.

Response

"Success"

Notes

  • New integrations should use /update-gateway-score.
  • Keep this route only for older clients.