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.
object
required
The payment credential.
type is pan, masked_pan, sepa, or paypal — see
Credential types.object
required
Must include
id. May include email and date_of_birth.object
required
reference, amount (minor units), and currency (ISO 4217).object
ip, fingerprint, user_agent, session, and language.object
Billing address, forwarded to applicable backends.
object
Shipping address, forwarded to applicable backends.
array
Cart line items; each requires at least
name or sku.object
Travel data — passengers and legs — forwarded to backends that consume it.
object
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.string
default:"default"
Selects the active ruleset to evaluate — and through it, the schema.
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.string
Unique decision identifier.
string
ALLOW, REVIEW, BLOCK, or PROVISIONAL — see
Outcomes. PROVISIONAL only occurs with asynchronous backend
groups.string
The ruleset context that was evaluated.
object
The
(name, version) the decision was evaluated against — the binding of the ruleset that served it.string
The ruleset that served the decision.
integer
The exact version pinned to the decision.
string
Deterministic HMAC-SHA256 identifier for the payment credential. For
paypal it is computed from the
payer_id.string
The credential type supplied —
pan, masked_pan, sepa, or paypal.string
Display-safe masked representation, e.g.
411111 •••••• 4242 for cards or s•••@example.com for PayPal.array
Rules that fired, in evaluation order.
array
One entry per backend rule executed, including any error such as
insufficient_context. Present when the ruleset includes backend rules.object
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 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.