API reference

Pi Shield

Security and compliance API for threat detection and risk management.

Base URL

https://api.shield.io/v1

Endpoints

15 documented routes

Table of Contents

  1. What is Shield?
  2. The Problem We Solve
  3. How It Works
  4. Core Capabilities
    • Real-Time Fraud Scoring
    • Binary Fraud Verdict
    • Per-Client Threshold Configuration
    • Broad Signal Coverage
    • Graceful Handling of Incomplete Data
  5. Security & Compliance
    • Authentication
    • Data Isolation
    • Encrypted Connections
    • Credential Protection
  6. Usage Metering & Cost Controls
  7. Observability & Operations
  8. Product Maturity & Version History
  9. What Shield Is Not

1. What is Shield?

Shield is a real-time fraud detection service built by PayIntelli. It sits inside the payment authorisation flow and evaluates every transaction as it happens — before money moves — returning an instant verdict on whether the transaction should be treated as fraudulent or allowed to proceed.

Every time a customer submits a payment, Shield receives the transaction details, analyses a wide range of signals embedded in that transaction, and responds within the authorisation window with two pieces of information: a risk score between 0 and 100, and a binary fraud verdict — true or false.

The calling system then acts on that verdict according to its own business logic: blocking the transaction outright, flagging it for manual review, requiring additional authentication from the customer, or allowing it to proceed normally.

Shield is designed to be invisible to the end customer. It adds no perceptible latency to the payment experience. It requires no changes to how customers pay. It operates entirely in the background, as a silent checkpoint between the customer submitting a payment and the payment reaching an acquirer.

Example scenario: A customer submits a payment of €142 on a Friday evening using a prepaid card, from an IP address that does not match their usual location, with no name on file and no email address provided. Shield analyses all of these signals simultaneously, scores the transaction as high-risk, and returns fraud: true in milliseconds. The payment system blocks the transaction before it is authorised. The customer is asked to verify their identity or try a different payment method.

2. The Problem We Solve

Fraud in online payments is not a niche problem. It is a constant, evolving threat that every business accepting card payments faces, at every scale. The question is never whether fraud will occur — it will — but how much of it gets through, and at what cost.

The fraud detection tools that most businesses rely on today fall into one of two categories, and both have serious shortcomings.

Rule-Based Systems

2. The Problem We Solve

Description

Traditional fraud detection is built on rules. An analyst or engineer writes logic: if the transaction amount is above a threshold, block it. If the card is from a high-risk country, block it. If the customer has no email address, flag it. These rules are clear and auditable, and they work — up to a point.

The problem is that fraudsters adapt faster than rules can be updated. A rule that catches a fraud pattern today becomes ineffective the moment fraudsters change their approach. Writing and maintaining a rule set that remains effective over time requires constant engineering effort, dedicated fraud expertise, and a reactive cycle that always leaves a window of exposure.

Rules are also blunt instruments. A rule that blocks all transactions above a certain amount will stop some fraud, but it will also block a significant volume of legitimate high-value transactions. Every legitimate transaction that is incorrectly blocked is lost revenue, a damaged customer relationship, and a support cost. The industry term for this is a false positive — and false positives are not free.

Third-Party Black Box Solutions

2. The Problem We Solve

Description

The alternative is to buy a fraud scoring service from a specialist vendor. These services are powered by large models trained on industry-wide transaction data, and they produce a risk score per transaction. For many businesses, this is a significant improvement over hand-written rules.

But third-party solutions introduce a different set of problems. The client has no visibility into how the score is produced. They cannot tune the model's behaviour for their specific transaction mix, their specific customer base, or their specific risk tolerance. They are paying per-call for a black box that was trained on someone else's data and may not reflect the patterns unique to their business.

There is also the question of cost and dependency. A business that routes every transaction through a third-party fraud vendor is exposed to that vendor's pricing changes, availability guarantees, and data policies. And as transaction volume grows, so does the bill — with no corresponding improvement in accuracy from the client's perspective.

What Shield Does Differently

2. The Problem We Solve

Description

Shield is built in-house and trained on real transaction data from the PayIntelli platform. This means the model learns the actual fraud patterns that appear in transactions processed through our infrastructure — not generic industry patterns from a vendor dataset.

Thresholds are configurable per client. A high-risk merchant and a low-risk merchant do not share the same fraud sensitivity settings. Each client controls how aggressively Shield blocks, matching their own risk tolerance and their own customer profile.

There is no per-call vendor pricing. Shield is operated as a platform capability, and usage is metered transparently per client without the pricing exposure of third-party APIs.

And because Shield is ours, we can investigate, improve, and tune it. When something goes wrong — when false positives spike, or when a new fraud pattern emerges — we have access to everything we need to respond quickly.


3. How It Works

At a high level, every Shield evaluation follows this flow:

Payment system receives a transaction from a customer
          ↓
Shield API receives the transaction details
          ↓
API key is validated — unauthorised requests are rejected immediately
          ↓
Transaction features are extracted from the payload:
  → Amount, currency, USD equivalent
  → Timestamp signals (hour, day of week, weekend, recency)
  → Customer identity signals (email presence, name presence, name-email match)
  → Card signals (credit / debit / prepaid)
  → Geography signals (domestic vs. foreign, major city indicator)
  → Network signals (IP address characteristics, local vs. external)
  → Payment method (VISA, Mastercard, AMEX, etc.)
  → Strong customer authentication and exemption flags
  → Address signals (postal code, city, state)
          ↓
Fraud scoring model evaluates all signals simultaneously
and produces a raw probability (0.0 – 1.0)
          ↓
Per-client thresholds are loaded from configuration:
  → Is this client's threshold set? If yes, apply it.
  → If not, apply the most recently configured global threshold.
          ↓
Threshold comparison:
  → raw probability >= maximum threshold → fraud: true
  → raw probability < maximum threshold → fraud: false
          ↓
Usage is metered: one unit recorded per call
          ↓
Response returned to calling system:
  { "fraud": "true" | "false", "score": 0–100 }
          ↓
Calling system acts on the verdict according to its own rules

The entire flow — from receiving the request to returning a verdict — is designed to complete within the latency window of a live payment authorisation. No human review is involved in real-time decisions. The system is fully automated.

4. Core Capabilities

4.1 Real-Time Fraud Scoring

4. Core Capabilities

Description

Every transaction submitted to Shield receives a numeric risk score between 0 and 100. This score represents the model's assessment of fraud likelihood — higher means more suspicious.

The score is produced by a machine learning model trained on historical transaction data from the PayIntelli platform. The model analyses the full set of signals available in the transaction payload simultaneously, weighting them according to learned patterns from past fraud events. It does not apply sequential rules — it evaluates everything at once, which allows it to detect complex multi-signal fraud patterns that simple rule systems cannot capture.

The score is always returned to the calling system, regardless of the fraud verdict. This gives clients the option to build their own graduated response logic — for example, requiring additional customer authentication for transactions with a score above 50, but only blocking outright for scores above 80.

4.2 Binary Fraud Verdict

4. Core Capabilities

Description

In addition to the numeric score, Shield returns a simple binary verdict: fraud: "true" or fraud: "false".

This verdict is the primary decision signal for most integration patterns. Calling systems do not need to implement their own threshold logic — Shield applies the client's configured thresholds internally and returns a ready-to-act decision.

The verdict is deterministic for a given transaction and threshold configuration. The same transaction, submitted at the same time, with the same configured thresholds, will always produce the same verdict.

4.3 Per-Client Threshold Configuration

4. Core Capabilities

Description

Different clients have fundamentally different risk profiles. A gaming platform with low average transaction values and a customer base accustomed to occasional friction has very different needs from a high-volume merchant selling physical goods to verified returning customers.

Shield does not impose a single, platform-wide fraud threshold. Each client's fraud sensitivity is configured independently in the shield_configs table. The configuration specifies:

  • A minimum threshold — the lower boundary of the grey zone (stored for future graduated-response logic)
  • A maximum threshold — the decision boundary at which Shield returns fraud: true

When a transaction is evaluated, Shield looks up the threshold configuration for the requesting client. If a client-specific configuration exists, it is used. If no client-specific configuration has been set, Shield falls back to the most recently updated global configuration.

This fallback ensures that new clients are protected immediately, before their specific thresholds have been configured, without requiring manual intervention for every onboarding.

Thresholds can be updated at any time. Changes take effect on the next request — there is no deployment or restart required.

4.4 Broad Signal Coverage

4. Core Capabilities

Description

Shield analyses a wide range of signals from every transaction. No single signal is determinative on its own — it is the combination of signals, and the learned relationships between them, that produces accurate fraud assessments.

The signals covered include:

Transaction signals — the amount and currency of the payment, whether the amount is unusually large for the context, the USD-equivalent value, and whether the transaction is in a foreign currency.

Timing signals — the hour of day, day of the week, whether the transaction falls on a weekend, the specific calendar month and day, and how recently the transaction timestamp is relative to the current time. Fraud has temporal patterns — certain hours, days, and times of year see elevated risk — and Shield captures this.

Customer identity signals — whether an email address is present and non-empty, whether a customer name is on file, whether the name appears in the email address (a consistency check), whether the email domain is a personal provider like Gmail or a corporate domain, and an encoded representation of the email domain itself.

Card signals — whether the card is a credit card, debit card, or prepaid card. Prepaid cards in particular are a commonly used instrument in fraud, and the card type is a meaningful signal.

Geography signals — the country of the card, normalised to a standard format, and whether the transaction is domestic or from abroad. Major city indicators are also captured.

Network signals — the first octet of the customer's IP address (a coarse-grained geography and network type indicator), and whether the IP address is a private/local address (which is unusual for a real customer payment and can indicate testing environments or misconfigured integrations).

Payment method signals — one-hot encoded flags for VISA, Mastercard, American Express, Maestro, Diners, and other accepted payment brands.

Authentication signals — whether Strong Customer Authentication (SCA) was applied, which version of the SCA protocol was used, and whether any SCA exemption was claimed and of what type. Transactions that skip authentication or claim unusual exemptions carry higher risk.

Address signals — encoded representations of the billing postal code, state, and city. These are not matched against customer records but provide geographic consistency signals when compared with other transaction attributes.

4.5 Graceful Handling of Incomplete Data

4. Core Capabilities

Description

Real-world transaction payloads are rarely complete. Customers may not have a name on file. SCA data may not have been populated. The customer IP address may be missing or in an unexpected format. Country codes may arrive in different formats from different integration sources.

Shield is designed to handle incomplete and inconsistent data without failing.

All fields are optional from the API's perspective. Missing fields produce safe zero-value features — the model was trained to handle these absences, and a missing field does not cause an error or an artificially elevated fraud score.

Enum fields (payment method, card type, currency, country code, SCA type, exemption type) use fuzzy matching against the known vocabulary. Minor spelling differences or capitalisation inconsistencies are resolved automatically. Values that are too dissimilar from any known value are mapped to a safe NONE default rather than causing a failure.

Country codes may arrive as two-letter ISO codes (e.g. US) or three-letter ISO codes (e.g. USA). Shield normalises both formats automatically.


5. Security & Compliance

5.1 Authentication

5. Security & Compliance

Description

Every request to Shield must include a valid API key. The key is validated against the Shield product scope before any processing begins. Requests without a key are rejected with HTTP 401. Requests with an invalid or expired key are rejected with HTTP 403. No transaction data is processed for unauthenticated requests.

5.2 Data Isolation

5. Security & Compliance

Description

Shield is a single-tenant processing model — each API call is evaluated in isolation. Transaction data submitted by one client is never visible to, stored alongside, or combined with data from another client. Threshold configurations are loaded per client, ensuring that one client's settings cannot affect another client's fraud decisions.

5.3 Encrypted Connections

5. Security & Compliance

Description

All communication between the calling system and Shield uses encrypted connections. Transaction data is never transmitted in plaintext. Database connections used by Shield for threshold lookups also enforce encryption in transit.

5.4 Credential Protection

5. Security & Compliance

Description

Database credentials used internally by Shield are not stored in code or configuration files. They are retrieved at runtime from a centralised secrets management service and held only in memory for the duration of the connection. They are never logged or exposed in error responses.


6. Usage Metering & Cost Controls

Shield tracks usage per client for billing and transparency purposes.

Every successful Shield evaluation — regardless of the fraud verdict — records one unit of usage against the calling client's account. Usage is recorded asynchronously via an internal messaging queue, so metering does not add latency to the fraud evaluation itself.

Usage data feeds into PayIntelli's billing and reporting infrastructure, giving clients visibility into how many fraud evaluations they have run across any time period, and allowing usage to be tied to pricing tiers.

Clients can request usage reports through their account management contact.

7. Observability & Operations

Logging

7. Observability & Operations

Description

All Shield evaluations produce structured log entries that are written to centralised log storage. Every log entry includes:

  • Whether the evaluation succeeded or failed
  • The fraud verdict and score produced (on success)
  • The error type and source line (on failure)
  • A unique request identifier for tracing

Log entries are available to the PayIntelli operations team for investigation, debugging, and performance monitoring.

Error Transparency

7. Observability & Operations

Description

When Shield encounters an error — a database connection issue, a configuration problem, a model invocation failure — the response includes an error type and the location within the system where the failure occurred. This information is also written to logs with a full traceback, enabling rapid diagnosis.

The most common operational issue that clients may encounter is a missing threshold configuration. If Shield cannot find a threshold configuration for a client (and no global fallback exists), it returns a clear error indicating that threshold configuration is required. This is resolved by inserting the appropriate configuration record through the operations team.

Health and Availability

7. Observability & Operations

Description

Shield is hosted on AWS Lambda, which provides automatic scaling to handle traffic spikes without pre-provisioning. There is no fixed instance count to manage. Capacity scales with demand.

The underlying SageMaker inference endpoint that hosts the fraud model is a managed, persistent endpoint that is available continuously. It does not need to be started or stopped per request.


8. Product Maturity & Version History

VersionDateMilestone
1.0.0August 2025Initial deployment: XGBoost fraud model trained on platform transaction data; per-client threshold configuration; binary fraud verdict + numeric score; API key authentication; usage metering via SQS
1.0.1October 2025Threshold normalisation fix (percentage vs. decimal inputs now handled automatically); improved fuzzy matching for enum fields; structured error logging with line numbers
1.1.0June 2026Per-client threshold lookup with global fallback; client_id-scoped metering; connection timeout improvements on threshold DB reads

9. What Shield Is Not

To set accurate expectations for clients and integration teams:

Shield is not a replacement for human fraud investigation. Shield makes real-time automated decisions. For complex fraud cases, disputes, or chargebacks, human review remains essential. Shield's score can inform that review — but it is not a substitute for it.

Shield is not a rules engine. Shield does not accept client-defined rules ("block all transactions from country X"). It applies a trained model to the full set of transaction signals and returns a probability. Threshold configuration controls the decision boundary, not the signals considered.

Shield is not a case management system. It does not store transaction history, track fraud cases over time, or provide a dashboard for reviewing flagged transactions. Each evaluation is stateless from Shield's perspective.

Shield is not a chargeback prevention platform. Shield evaluates transactions at authorisation time. It does not participate in the chargeback process, generate dispute evidence, or interact with card networks.

Shield is not a compliance certification. Operating Shield does not by itself satisfy PCI-DSS, PSD2, or any other regulatory requirement. It is one layer of a broader fraud and security programme.

Shield is not a customer profiling system. Shield does not maintain profiles of individual customers across transactions. Each transaction is evaluated independently using only the signals present in that transaction's payload. Shield does not accumulate a history of individual customer behaviour.