Introduction
Payment Options are the payment methods and instruments available to a customer in a given context. You configure rules for their availability in the Payrails Portal and then use the lookup endpoint to synchronously determine and present the right payment options to customers on the client side.Steps
1. Get the execution ID
For your request to the lookup endpoint, you’ll need the ID of the workflow execution. You can find the ID in the response to the creation of this workflow execution, with the keyid
2. Make a POST request
Make aPOST request to the Lookup payment options endpoint, where executionId is the ID from the previous step.
In your request, include:
amount.value: The decimal amount of the major currency unit, in any precisionamount.currency: ISO 3-letter currency code
The payment options available to a customer vary according to context. If the context changes during checkout (for example, the total amount changes), look up the payment options again and refresh the results to ensure the payment methods and instruments displayed to your consumer remain accurate.
3. Receive the lookup response
If the lookup was successfully executed, you’ll find the following in the response:actionId: The unique identifier for this capture executiondata.paymentCompositionOptions: This is the list of payment methods and payment instruments that can be used to complete the execution.links: Links to the next possible actions that can be taken
By default, the
paymentInstruments list inside each of the payment methods returned includes only the ones with status Created or Enabled for the Holder that created the execution. This means that any inactive, expired, or blocked instrument will be excluded to avoid payment rejections.To query all the instruments for that holder regardless of their current state, use the List Instruments API.