|
| 1 | +--- |
| 2 | +description: A high level overview on how our API does payment detection |
| 3 | +--- |
| 4 | + |
| 5 | +# Payment Detection |
| 6 | + |
| 7 | +## Payment Detection in Request API |
| 8 | + |
| 9 | +### Overview |
| 10 | + |
| 11 | +The Request API uses a [**reference-based payment detection system**](https://docs.request.network/advanced/protocol-overview/how-payment-networks-work#reference-based-payment-networks-recommended) that automatically monitors blockchain transactions to detect when payments are made to your requests. This system works across [multiple blockchains](../general/supported-chains/) and handles various payment scenarios. |
| 12 | + |
| 13 | +### How It Works |
| 14 | + |
| 15 | +#### 1. Payment Reference Generation |
| 16 | + |
| 17 | +When you create a payment request, the API automatically generates a unique[ **payment reference**](https://docs.request.network/advanced/request-network-sdk/sdk-guides/request-client/payment-reference)**,** a 16-character identifier that acts as a fingerprint for your request. This reference is what connects blockchain transactions back to your specific request. |
| 18 | + |
| 19 | +#### 2. Blockchain Monitoring |
| 20 | + |
| 21 | +The API continuously monitors supported blockchains using subgraphs that scan for transactions containing payment references. This happens automatically in the background, no action required from you. |
| 22 | + |
| 23 | +#### 3. Automatic Detection |
| 24 | + |
| 25 | +When someone makes a payment and includes the payment reference in their transaction, our system: |
| 26 | + |
| 27 | +* Detects the transaction within minutes |
| 28 | +* Validates the payment details (amount, currency, recipient) |
| 29 | +* Updates the request status (partially paid, fully paid, etc.) |
| 30 | +* Triggers your configured webhooks |
| 31 | + |
| 32 | +#### 4. Real-time Updates |
| 33 | + |
| 34 | +Once a payment is detected, your request status is immediately updated and you can get the latest information via: |
| 35 | + |
| 36 | +* GET requests to check payment status using the request's id |
| 37 | +* Automatically receive updates to your [webhooks](api-portal-manage-api-keys-and-webhooks.md) |
| 38 | + |
| 39 | +### Crosschain Support |
| 40 | + |
| 41 | +All crosschain payments done using the [Request Network API](crosschain-payments.md) use our [ERC 20 Fee proxy contract](https://docs.request.network/advanced/protocol-overview/how-payment-networks-work#erc20-fee-proxy-contract) as the last leg of payment, so payment detection works out of the box. |
| 42 | + |
| 43 | +### Webhook Notifications |
| 44 | + |
| 45 | +For real-time integration, you can configure webhooks to be notified for the following events: |
| 46 | + |
| 47 | +* **Payment Confirmed**: Full payment received |
| 48 | +* **Payment Partial**: Partial payment received |
| 49 | +* **Payment Failed**: Transaction failed |
| 50 | +* **Payment Refunded**: Payment was refunded |
| 51 | + |
| 52 | +This allows your application to react immediately to payment events without constantly polling the API. |
| 53 | + |
| 54 | +### Integration Benefits |
| 55 | + |
| 56 | +* **Zero Configuration**: Payment detection happens automatically |
| 57 | +* **Multi-blockchain**: Works across all supported networks |
| 58 | +* **Real-time**: Fast detection and status updates |
| 59 | +* **Flexible**: Handles various payment scenarios |
| 60 | +* **Reliable**: Built on proven blockchain indexing infrastructure |
| 61 | + |
| 62 | +The system is designed to be completely transparent to your application, simply create requests and let the API handle all the complexity of monitoring blockchains for payments. |
0 commit comments