> For the complete documentation index, see [llms.txt](https://docs.sweep.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sweep.finance/ecosystem-components/sweepay/payment-and-transfer-flow.md).

# Payment & Transfer Flow

SweePay is designed to manage both payment and transfer processes through a structured and consistent transaction flow. Each interaction follows a defined sequence that ensures clarity, efficiency, and reliable execution.

### **Initiation**

The flow begins when a user initiates an action, such as:

* Making a payment
* Sending assets to another user
* Using a card for a purchase

The system captures the request and prepares it for processing.

### **Validation & Authorization**

Before execution, the transaction is validated:

* User balance and asset availability are checked
* Transaction parameters are verified
* Authorization is completed through the user’s wallet or payment method

This step ensures that only valid and authorized transactions proceed.

### **Routing**

After validation, the transaction is routed through the appropriate channel:

* **On-chain routing** for crypto-based payments and transfers
* **Payment network routing** for card-based transactions (Mastercard / Visa)

This allows SweePay to support both blockchain and traditional payment flows within a single system.

### **Execution**

Once routed, the transaction is executed:

* Blockchain transactions are submitted and processed on-chain
* Card transactions are processed through the relevant payment network

Execution occurs automatically based on predefined system logic.

### **Settlement**

Following execution, the transaction is finalized:

* On-chain transactions are confirmed and recorded
* Card transactions are settled through payment networks
* Final balances are updated accordingly

This ensures that each transaction reaches a definitive and traceable state.

### **Confirmation**

After settlement:

* The user receives confirmation of the transaction
* Relevant transaction details are made available
* The outcome is clearly reflected in the user’s account or wallet


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sweep.finance/ecosystem-components/sweepay/payment-and-transfer-flow.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
