# E2E Purchase Flow

Canonical URL: https://agent.payrail.one/docs/guides/e2e-purchase
Markdown URL: https://agent.payrail.one/docs/guides/e2e-purchase.md
Summary: The built-in agent clarifies intent, searches providers, selects a channel, uses built-in browser or an agentic protocol, and raises user requests during the session.
Description: How the built-in Payrail Agent agent turns a user payment intent into a completed purchase session.

## Canonical Answer

The built-in agent clarifies intent, searches providers, selects a channel, uses built-in browser or an agentic protocol, and raises user requests during the session. How the built-in Payrail Agent agent turns a user payment intent into a completed purchase session. Protected payment and identity data stays behind Payrail Agent requests instead of entering LLM-visible context.

![A purchase from intent to receipt](https://agent.payrail.one/docs-assets/images/guides-e2e-purchase-flow.svg)

## Flow

The end-to-end purchase flow starts from a user intent and ends with a completed session or an explicit stop reason.

1. User asks the built-in agent to complete a purchase or payment intent.
2. The agent checks previous payment operations and infers the full payment prompt when possible.
3. If required data is missing, the agent asks clarifying questions.
4. Payrail Agent Search returns relevant provider methods, URLs, official docs, and operating guidance.
5. The agent chooses a provider and channel, preferring agentic protocols, then public API/MCP, reverse API/MCP, and legacy browser checkout.
6. If no candidate is found, the agent falls back to agentic web search.
7. built-in browser or the selected payment protocol executes the flow while Payrail Agent delivers requests to the user.

Note: Done when: the session reaches a completed payment, or it stops with an explicit reason you can act on.

## During The Session

The user receives requests for approvals, choices, Memory reads, Memory writes, and payment confirmation through enabled channels.

## Completion

The session records events, payment results, and any learned hints that can improve future purchase sessions.

## Related

- Payrail Agent Search: https://agent.payrail.one/docs/components/payrailAgentSearch
- Payrail Agent Fill: https://agent.payrail.one/docs/components/payrailAgentFill
- Omnichannel UI: https://agent.payrail.one/docs/components/omnichannel-ui