PayinferencePayinferenceDocs
payinference.com
Documentation / SDKs

SDKs

PayInference is an HTTP API first — every SDK is a thin, optional convenience over the same two calls (POST /v1/decision, POST /v1/outcomes). Nothing in the product requires one, and the API reference is the contract of record.

Available#

SDK Package Use it for
Node.js @payinference/sdk Server-side decisions, outcome reporting, attempt telemetry
Browser helpers @payinference/sdk-js Checkout-page helpers only — no authentication, no API access

More languages are planned. Until one exists for your stack, call the API directly: it is plain JSON over HTTPS with an x-api-key header, and the API reference documents every endpoint and field.

Which one do I need?#

Almost certainly the Node.js SDK, on your backend. The API key is a secret, so decisions are always requested server-side.

@payinference/sdk-js is deliberately not a client for the API — it holds no credentials and cannot reach PayInference. It exists so the checkout page can render what your backend already decided.

What an SDK gives you over raw HTTP#

  • Request validation before anything leaves your process, so card data and unknown fields are rejected locally rather than by the server.
  • A hard latency budget on decide(), separate from the longer budget used for reporting calls.
  • An optional local fallback decision when PayInference is unreachable, so a checkout never blocks on an outage.
  • Idempotent retries on reporting calls.

All of it is reproducible over plain HTTP — see Idempotency and retries and Production integration.