Skip to content

Commit 88e0e4a

Browse files
bassgetagitbook-bot
authored andcommitted
GITBOOK-171: Add payment detection docs
1 parent 040fa6c commit 88e0e4a

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

docs/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* [API Portal: Manage API Keys and Webhooks](request-network-api/api-portal-manage-api-keys-and-webhooks.md)
1515
* [Full API Reference](https://api.request.network/open-api)
1616
* [Migrate to V2](request-network-api/migrate-to-v2.md)
17+
* [Payment Detection](request-network-api/payment-detection.md)
1718

1819
## General
1920

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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

Comments
 (0)