Skip to main content

Prerequisites

  • An active Payrails session (see Quick Start)
  • The Session reference returned by Payrails.createSession(...)

Query session data with session.query()

Hold on to the Session returned by createSession(...) and call query() on it with a typed key from PayrailsQuery:
All keys return null when the queried data is not present. No exception is thrown.

Available keys

PayrailsQuery.ExecutionId

The unique identifier for the active payment execution.
Use this to tell your backend which execution to act on — for example, before calling the Payrails lookup action to update the checkout amount.

PayrailsQuery.HolderReference

The holder reference for the active session.

PayrailsQuery.Amount

The current checkout amount as a PayrailsAmount.

PayrailsQuery.BinLookup

The BIN lookup action link from the session config, as a PayrailsLink.

PayrailsQuery.InstrumentDelete

The stored instrument delete action link.

PayrailsQuery.InstrumentUpdate

The stored instrument update action link.

PayrailsQuery.PaymentMethodConfig

Configuration for a specific payment method, as a PayrailsPaymentMethodConfig.
Pass the payment method code (e.g. "card", "paypal") as the parameter. Returns null if the code is not present in the session config.

PayrailsQuery.PaymentMethodInstruments

Stored instruments for a specific payment method.
Returns null if the payment method code is unrecognised or has no stored instruments. Never returns an empty list — use null as the “nothing available” signal.

Discovering redirect-capable payment methods

PayrailsQuery.AvailableRedirectMethods has been removed. To list redirect-based payment methods configured for the session, use session.getPaymentMethodConfig(PaymentMethodFilter.Redirect):
Returns an empty list (not null) when no redirect methods are configured. Use this to dynamically build your redirect payment UI rather than hardcoding method codes. See How to Accept Redirect Payments for the full integration guide.

Example: passing the execution ID to your backend

See also

Last modified on September 30, 2026