TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JoseOlivares19/Proyecto-PC3-JavaScript-Avanzado/llms.txt
Use this file to discover all available pages before exploring further.
/predict/fraud-shield endpoint analyses a single financial transaction against seven behavioral and contextual risk signals and returns one of three classification labels. The underlying RandomForest model weighs transaction amount, time-of-day, prior failed attempts, customer tenure, device novelty, country risk, and recent purchase frequency to produce a fraud risk score. The response includes confidence, a full probability ranking, and a concrete action set for your fraud operations team or automated decision engine.
Endpoint
Request Body
Transaction amount in local currency. Must be between
1 and 20000.Hour of the day the transaction was initiated, in 24-hour format. Must be between
0 and 23.Number of previous failed transaction attempts by this customer in the current session. Must be between
0 and 10.Customer account age in months. Must be between
0 and 120. Newer accounts carry higher risk weight.Whether the transaction originates from a device not previously seen for this account:
0— Known device1— New / unrecognised device
Risk classification of the transaction’s originating country:
0— Low-risk country1— High-risk country
Number of purchase attempts made by this account in the last 60 minutes. Must be between
0 and 20. Values above 5 contribute additional risk.Example Request
Example Response
Response Fields
Human-readable model identifier. Always
"FraudShield" for this endpoint.The top predicted fraud classification. One of:
| Label | Meaning |
|---|---|
FRAUDE_PROBABLE | High fraud risk — block and escalate immediately |
REVISION_MANUAL | Moderate risk — request additional customer verification |
TRANSACCION_SEGURA | Low risk — authorise and continue passive monitoring |
Probability assigned to the top predicted class, in the range
0.0 to 1.0.Probability distribution across all three fraud labels, sorted in descending order of probability.
Action set appropriate to the predicted label. For
FRAUDE_PROBABLE this includes blocking and escalation steps; for REVISION_MANUAL it includes verification steps; for TRANSACCION_SEGURA it authorises the operation.Echo of the validated request payload as parsed by Pydantic. Use this for audit logging without re-serialising the original request.
dispositivo_nuevo and pais_riesgo are binary integer flags (0 or 1). Boolean true/false values are not accepted and will produce a 422 Unprocessable Entity error.