Decision API
One call before you charge. POST /v1/decision evaluates provider health, cost, risk and your merchant policy, and returns a single executable instruction, one of route, use default route, step-up, hold, retry, failover or block, with reason codes, route scores and confidence. You execute it on your own stack and report the outcome back.
One call before you charge
One call evaluates provider health, cost, risk and your merchant policy, and returns a single structured instruction, one of route, use default route, step-up, hold, retry, failover or block, with reason codes, route scores and per-signal confidence explaining why. You execute it on your own stack and report the outcome back.
const payinference = new PayInferenceClient({
apiKey: process.env.PAYINFERENCE_API_KEY,
merchantId: "m_123",
});
const decision = await payinference.decide(
{
order_id: order.id,
transaction: {
amount: 129900, currency: "USD",
country: "US", payment_method: "card",
},
available_providers: ["adyen", "stripe"],
},
{ idempotencyKey: order.id }
);
if (decision.action === "route") {
await psp.authorize(decision.route.primary_provider, order);
}
await payinference.recordOutcome({
decision_id: decision.decision_id,
order_id: order.id,
provider_used: "adyen",
outcome: "approved",
provider_latency_ms: 412,
amount: 129900, currency: "USD",
});Frequently asked questions
Common questions about Decision API and how Payinference works.
The decision path is built for the authorization hot path. It computes from cached policy, cached provider health and cached pricing, with no PSP calls and no LLM calls, targeting under 50 ms at p95 with typical decisions around 1 ms.
Two endpoints. Your backend calls POST /v1/decision with safe payment context and receives one instruction. You execute that instruction through your own providers, then report what happened to POST /v1/outcomes so future decisions keep improving. A server-side SDK wraps both calls.
No. The API accepts only safe payment context, such as amount, currency, country, payment method and network-level signals. Request schemas are strict and reject PANs, CVVs and customer identity at the boundary, so card data cannot enter the system even by accident.
No. Payinference never moves money, never charges cards and never holds funds. It returns an instruction; your own payment stack executes it. It is not a PSP, gateway, orchestrator or wallet.
