Update Gateway Score
Feed a transaction outcome back into the success-rate model. Call this after every transaction so the engine has accurate SR data for future routing decisions.
Update Gateway Score
Use case
Records the observed transaction outcome for a previously selected gateway so auth-rate analytics can learn from real payment results.Authentication
Protected. Send eitherAuthorization: Bearer <jwt_token> or x-api-key: <api_key>. In sandbox, also send x-feature: decision-engine.
For local development, start with:
Request
- Method and path:
POST /update-gateway-score - Parameters: none.
- Body: JSON body with
merchantId,paymentId,gatewayandstatus, plus optionalgatewayReferenceId,enforceDynamicRoutingFailure,txnLatency,errorInfoandisSmartRetry.
Example
Update gateway score
status must be a transaction status value - CHARGED, AUTHORIZATION_FAILED,
AUTHENTICATION_FAILED, JUSPAY_DECLINED, FAILURE, and so on. Lowercase values such as
success are rejected with a 400.
Payment attributes (amount, currency, payment method, auth type) are not part of this
payload - the engine already has them from the /decide-gateway call for this paymentId.
Any unrecognised field is silently ignored, so a misspelled key fails quietly rather than
erroring. Note in particular that latency goes in txnLatency.gatewayLatency, not latency.
Response
errorInfo is supplied in the request and matches a gateway status map rule, the response
also carries a gsm_info object describing the lookup result.
Notes
- Do not call this after
NTW_BASED_ROUTINGjust to record the selected debit network; debit audit comes from/decide-gatewayanalytics. - Call it after payment authorization completes, not before.
Related
Authorizations
JWT token obtained from /auth/login
Body
"test_merchant"
"stripe"
"pay_001"
Transaction status. Must be a TxnStatus value - lowercase values such as success are rejected with a 400.
STARTED, AUTHENTICATION_FAILED, JUSPAY_DECLINED, PENDING_VBV, VBV_SUCCESSFUL, AUTHORIZED, AUTHORIZATION_FAILED, CHARGED, AUTHORIZING, COD_INITIATED, VOIDED, VOID_INITIATED, NOP, CAPTURE_INITIATED, CAPTURE_FAILED, VOID_FAILED, AUTO_REFUNDED, PARTIAL_CHARGED, TO_BE_CHARGED, PENDING, FAILURE, DECLINED "CHARGED"
"stripe_ref_001"
Observed gateway latency, in milliseconds.
Gateway error details for the GSM-based scoring filter. When present and the merchant flag is on, user/issuer-originated failures are skipped so the gateway is not penalised.
Set by the orchestrator when this call is a smart-retry attempt.