Request
SendPOST /api/decisions with the decisions:create scope. The context you name selects the active
ruleset, and that ruleset’s schema defines the payload. The fields below
are the built-in transaction schema; for a context bound to a custom schema, send the fields that schema
declares in the same envelope. On the transaction schema three domains are required; everything else enriches
the evaluation and is forwarded to backends where applicable.
The payment credential.
type is pan, masked_pan, sepa, or paypal — see
Credential types.Flat string key-value pairs, available to rules as
$.metadata.*. Forwarded to
backends and stored on the decision record, so treat it as data you share with
your backend providers.The complete request and response schema, including every nested field, is in
the API
reference.
Credential types
- pan
- masked_pan
- sepa
- paypal
Full card number. Used to evaluate the transaction and compute the credential fingerprint; never persisted.The seven BIN attributes —
bin, schemes, type, segment, currency_code, issuer_name,
issuer_country_code — are optional and named exactly as Guardian’s
metadata inquiry returns them, so you can pass that
response through. Specter performs no BIN lookup of its own; rules read whatever you send.Example request
Response
Specter returns the decision together with the rules that fired and any backend results.ALLOW, REVIEW, BLOCK, or PROVISIONAL — see
Outcomes. PROVISIONAL only occurs with asynchronous backend
groups.The
(name, version) the decision was evaluated against — the binding of the ruleset that served it.Deterministic HMAC-SHA256 identifier for the payment credential. For
paypal it is computed from the
payer_id.Display-safe masked representation, e.g.
411111 •••••• 4242 for cards or s•••@example.com for PayPal.One entry per backend rule executed, including any error such as
insufficient_context. Present when the ruleset includes backend rules.null until a REVIEW decision is closed — see
Resolving a REVIEW decision.Example response
Use cases
Synchronous pre-authorization decision
Specter returns a definitive decision in one call. Simplest to integrate, and the right default when the added latency of any backends is acceptable.- The merchant requests a decision from Specter.
- Specter applies all rules and, where required, reaches out to backends.
- The merchant uses the definitive result to authorize the payment.
Asynchronous decision with delayed capture
For latency-sensitive flows, Specter returns a fastPROVISIONAL result from local rules and finishes the
backend evaluation in the background. The merchant authorizes optimistically and defers the capture until the
final decision arrives.
- The merchant requests a decision from Specter.
- Specter applies all local rules and returns a
PROVISIONALresult immediately. - The merchant optimistically authorizes and defers the capture.
- Specter reaches out to backends asynchronously.
- Specter notifies the merchant of the definitive decision through a registered webhook. The webhook can arrive before the
PROVISIONALresponse, so match it bydecision_id. - The merchant captures or cancels the authorization based on the final decision.
Related
Decisions
Outcomes, the decision log, and resolving REVIEW decisions.
Rule engine
How your request is evaluated into a decision.