Skip to content

Commit 447e16c

Browse files
committed
fix: make webhooks page even better
1 parent 895057b commit 447e16c

File tree

1 file changed

+31
-21
lines changed

1 file changed

+31
-21
lines changed

api-reference/webhooks.mdx

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Webhooks deliver real-time notifications when payment and request events occur.
1010
## Webhook Configuration
1111

1212
### Setup in Portal
13-
1. Navigate to **Platform Settings → Webhooks** in Request Portal
13+
1. Navigate to **Platform Settings → Webhooks** in [Request Portal](https://portal.request.network)
1414
2. Click **Add webhook**
1515
3. In the dialog that opens, enter URL and click **Create webhook**
16-
4. Click copy button to copy **Signing Secret** to clipboard
16+
4. Click copy button to copy **Signing Secret** to clipboard (see [Authentication](/api-reference/authentication) for API key setup)
1717
5. Enable/disable or delete webhooks as needed
1818

1919
### Local Development
@@ -25,6 +25,10 @@ ngrok http 3000
2525

2626
## Event Types
2727

28+
<Info>
29+
See [Payload Examples](#payload-examples) below for detailed webhook structures.
30+
</Info>
31+
2832
### Payment Events
2933

3034
| Event | Description | Context | Primary Use |
@@ -130,6 +134,14 @@ Request API logs all webhook delivery failures with:
130134

131135
## Payload Examples
132136

137+
All payment events include an `explorer` field linking to [Request Scan](https://scan.request.network) for transaction details.
138+
139+
**Common Fields:**
140+
- `requestId` / `requestID`: Unique identifier for the payment request
141+
- `paymentReference`: Short reference, also unique to a request, used to link payments to the request
142+
- `timestamp`: ISO 8601 formatted event timestamp
143+
- `paymentProcessor`: Either `request-network` (crypto) or `request-tech` (fiat)
144+
133145
### Payment Confirmed
134146
```json
135147
{
@@ -148,7 +160,7 @@ Request API logs all webhook delivery failures with:
148160
"paymentCurrency": "USDC",
149161
"isCryptoToFiat": false,
150162
"subStatus": "",
151-
"paymentProcessor": "request_network",
163+
"paymentProcessor": "request-network",
152164
"fees": [
153165
{
154166
"type": "network",
@@ -169,7 +181,7 @@ Request API logs all webhook delivery failures with:
169181
"offrampId": "offramp_test123456789",
170182
"timestamp": "2025-10-03T14:35:00Z",
171183
"subStatus": "ongoing_checks",
172-
"paymentProcessor": "request_tech",
184+
"paymentProcessor": "request-tech",
173185
"rawPayload": {
174186
"status": "ongoing_checks",
175187
"providerId": "provider_test123"
@@ -195,7 +207,7 @@ Request API logs all webhook delivery failures with:
195207
"paymentCurrency": "USDC",
196208
"isCryptoToFiat": false,
197209
"subStatus": "",
198-
"paymentProcessor": "request_network",
210+
"paymentProcessor": "request-network",
199211
"fees": []
200212
}
201213
```
@@ -208,7 +220,7 @@ Request API logs all webhook delivery failures with:
208220
"requestID": "0151b394e3c482c5aebaa04eb04508a8db70595470760293f1b258ed96d1fafa93",
209221
"paymentReference": "0x2c3366941274c34c",
210222
"subStatus": "insufficient_funds",
211-
"paymentProcessor": "request_network"
223+
"paymentProcessor": "request-network"
212224
}
213225
```
214226

@@ -230,6 +242,8 @@ Request API logs all webhook delivery failures with:
230242

231243
## Implementation Examples
232244

245+
For a complete working example, see the [EasyInvoice demo](/use-cases/invoicing) which implements webhook handling for payment notifications.
246+
233247
<Tabs>
234248
<Tab title="Express.js">
235249
```javascript
@@ -354,18 +368,6 @@ app.post("/webhook", (req, res) => {
354368
});
355369
```
356370

357-
### Local Development Setup
358-
```bash
359-
# Terminal 1: Start your application
360-
npm run dev
361-
362-
# Terminal 2: Expose localhost to internet
363-
ngrok http 3000
364-
365-
# Use the HTTPS URL in Portal webhook settings
366-
# Example: https://abc123.ngrok.io/api/webhook
367-
```
368-
369371
## Best Practices
370372

371373
### Error Handling
@@ -399,16 +401,24 @@ ngrok http 3000
399401
<Card title="Webhooks & Events" href="/api-features/webhooks-events">
400402
High-level webhook concepts and workflow
401403
</Card>
402-
404+
403405
<Card title="EasyInvoice Demo" href="/use-cases/invoicing">
404406
Complete webhook implementation example
405407
</Card>
406-
408+
407409
<Card title="Authentication" href="/api-reference/authentication">
408410
API key setup and webhook security
409411
</Card>
410-
412+
411413
<Card title="Payment Processing" href="/api-features/payment-processing">
412414
Understanding payment lifecycle events
413415
</Card>
416+
417+
<Card title="Request Portal" href="https://portal.request.network" icon="browser">
418+
Configure webhooks and manage API keys
419+
</Card>
420+
421+
<Card title="Request Scan" href="https://scan.request.network" icon="magnifying-glass">
422+
Explore transactions and request details
423+
</Card>
414424
</CardGroup>

0 commit comments

Comments
 (0)