> For the complete documentation index, see [llms.txt](https://docs.fetcch.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fetcch.xyz/pull-payments-layer/how-it-works/pull-payments-flow.md).

# Pull Payments Flow

Here's a breakdown of the sequential actions taken by the receiver and sender to facilitate a smooth transaction:

### **Receiver's Workflow**

<figure><img src="/files/dfxhI5R2qG9Ih2d2Xs7u" alt=""><figcaption></figcaption></figure>

1. **Transaction List Compilation**:
   * Generates a list encompassing detailed transactions.
     * **Specification**: Primarily token transfers leveraging ERC (or corresponding token standards) protocols.
2. **Payment Request Configuration**:
   * Instigates a `PaymentRequest` object derived from the transaction list.
   * Incorporates transaction metadata such as token type, quantity, and intended beneficiary.
   * Uses a private key to digitally sign the request, confirming its authenticity.
3. **Engagement with the Fetcch Network**:
   * Transmits the `PaymentRequest` to the Fetcch Network using a designated API endpoint.
     * **Consensus Phase**: The network conducts a swift consensus check to prevent any unauthorized actions.
     * **Data Storage**: Initially, the request is archived in a local distributed repository.
     * **On-Chain Integration**: Post verification, the request is bundled with similar ones and inscribed onto the target blockchain, ensuring efficient fee management.
4. **Notification to Sender**:
   * Sender (Initiator) is notified of the payment request through one or more of the channels, listed below
     * **Push Mechanisms**: Utilizing Google/Apple Notification Services.
     * **Server Intercommunication**: Deploying webhooks for seamless server-to-server relay.
     * **Synchronous Communication**: Through websockets ensuring real-time notification dispatch.

### Sender’s Workflow

<figure><img src="/files/i5zsZ7ZO1xDvVgmJR202" alt=""><figcaption></figcaption></figure>

1. **Payment Request** :
   * Captures the incoming alert regarding the payment request through designated notification channels.
   * Extracts and deciphers the `PaymentRequest` payload to assimilate the transaction prerequisites.
2. **Authentication and Authorization**:
   * Confirms the details and signs the transactions on the blockchain.
3. **Transaction Confirmation**:
   * Upon successful validation and recording of the transaction on the blockchain, a transaction hash is generated as a unique identifier.
   * Updates the payment request with the generated transaction hash
     * **Integrity Verification**: Fetcch's backend compares the transaction hash with the original `PaymentRequest` to validate the asset exchange and to preclude any unauthorized alterations.
4. **Notification Dispatch to Receiver**:
   * Receiver is notified of the completion of the payment request through one or more of the channels, listed below
     * **Push Mechanisms**: Utilizing Google/Apple Notification Services.
     * **Server Intercommunication**: Deploying webhooks for seamless server-to-server relay.
     * **Synchronous Communication**: Through websockets ensuring real-time notification dispatch.


---

# 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:

```
GET https://docs.fetcch.xyz/pull-payments-layer/how-it-works/pull-payments-flow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
