From 5b84b6acc596a901aa48d16087228d065dd7ec0a Mon Sep 17 00:00:00 2001 From: Aimen Sahnoun Date: Mon, 2 Mar 2026 02:32:10 +0400 Subject: [PATCH] =?UTF-8?q?docs(api-features):=20fix=20query-requests=20Op?= =?UTF-8?q?enAPI=20endpoint=20links=20and=20reconciliation=20mapping=20Upd?= =?UTF-8?q?ate=20`api-features/query-requests.mdx`=20to=20use=20the=20corr?= =?UTF-8?q?ect=20OpenAPI=20deep=20links=20for=20request=20status=20and=20w?= =?UTF-8?q?allet-level=20reconciliation.=20-=20replaced=20non-working=20re?= =?UTF-8?q?quest=20status=20endpoint=20links=20with:=20=20=20-=20https://a?= =?UTF-8?q?pi.request.network/open-api/#tag/v2request/GET/v2/request/{requ?= =?UTF-8?q?estId}=20-=20added=20wallet-level=20reconciliation=20endpoint?= =?UTF-8?q?=20reference:=20=20=20-=20https://api.request.network/open-api/?= =?UTF-8?q?#tag/v2payments/GET/v2/payments=20-=20updated=20both=20?= =?UTF-8?q?=E2=80=9CCore=20Endpoints=E2=80=9D=20and=20=E2=80=9CHow=20It=20?= =?UTF-8?q?Works=E2=80=9D=20sections=20to=20keep=20endpoint=20guidance=20c?= =?UTF-8?q?onsistent=20-=20clarified=20that=20request-level=20and=20wallet?= =?UTF-8?q?-level=20querying=20are=20complementary=20in=20reconciliation?= =?UTF-8?q?=20workflows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api-features/query-requests.mdx | 134 ++++++++++++++------------------ 1 file changed, 57 insertions(+), 77 deletions(-) diff --git a/api-features/query-requests.mdx b/api-features/query-requests.mdx index 9a3abbc..9a1b529 100644 --- a/api-features/query-requests.mdx +++ b/api-features/query-requests.mdx @@ -3,103 +3,83 @@ title: "Query Requests" description: "Request status monitoring, lifecycle management, and information retrieval" --- - -**AI-Generated Content** – This page was generated with AI assistance and may contain inaccuracies. While likely close to accurate, please verify critical details with the [stable documentation](https://docs.request.network) or [contact support](https://github.com/orgs/RequestNetwork/discussions). - - ## Overview -Query requests provides comprehensive request status monitoring and information retrieval, enabling real-time tracking of payment requests throughout their lifecycle. +Use query endpoints to retrieve the latest status for a specific request. -## Request Status Lifecycle +These endpoints are the main reconciliation surface for request-level state (paid/not paid, payment references, transaction hash, and optional metadata). - - - Created, pending, partially paid - - - - Paid, cancelled, expired - - +## Core Endpoints + +- [GET /v2/request/{requestId}](https://api.request.network/open-api/#tag/v2request/GET/v2/request/{requestId}) - get request status/details +- [GET /v2/payments](https://api.request.network/open-api/#tag/v2payments/GET/v2/payments) - wallet-level payment search and reconciliation ## How It Works -```mermaid -graph LR - A[Request ID] --> B[Query Status] - B --> C[Retrieve Info] - C --> D[Check Payments] - D --> E[Update Status] -``` - -**Query Process:** -1. **Identify:** Use request ID for lookup -2. **Retrieve:** Get current request information -3. **Analyze:** Check payment status and history -4. **Update:** Reflect latest blockchain state - -## Status Types - -### Request States -- `created` - Request initialized and stored -- `pending` - Awaiting payment completion -- `paid` - Full payment received and confirmed -- `cancelled` - Request cancelled by creator -- `expired` - Past due date without payment - -### Payment States -- `no_payment` - No payment transactions detected -- `partially_paid` - Partial payment received -- `paid` - Full payment amount received -- `overpaid` - Payment exceeds requested amount - -## Query Methods + + +Call [GET /v2/request/{requestId}](https://api.request.network/open-api/#tag/v2request/GET/v2/request/{requestId}) to get current request-level status fields. - - - Detailed status for specific request - - - - Multiple request status in one call - - +Typical fields include: -### Information Retrieved -- **Basic Details:** Amount, currency, participants -- **Payment History:** Transaction details and confirmations -- **Status Timeline:** Creation, updates, completion dates -- **Network Data:** Blockchain and transaction information +- `hasBeenPaid` +- `paymentReference` +- `txHash` +- `isListening` +- optional metadata such as `customerInfo` and `reference` + -## Real-time Monitoring + +Use [Webhooks & Events](/api-features/webhooks-events) for push updates, and use query endpoints as source-of-truth reads. + -### Automatic Updates -Combine with [Payment Detection](/api-features/payment-detection) for automatic status updates + +For wallet-level reconciliation views, use [GET /v2/payments](https://api.request.network/open-api/#tag/v2payments/GET/v2/payments). + + -### Event Integration -Use [Webhooks & Events](/api-features/webhooks-events) for instant notifications +## Request Status Query -## Advanced Filtering +`GET /v2/request/{requestId}` is the canonical request-level status endpoint for: -Filter requests by: -- **Date Range:** Creation or due date periods -- **Status:** Current request or payment state -- **Participants:** Payee or payer addresses -- **Amount Range:** Minimum and maximum values +- request payment completion checks (`hasBeenPaid`) +- transaction linkage (`txHash`) +- request identification (`requestId`, `paymentReference`) +- conversion-related status fields when applicable (`amountInUsd`, `conversionRate`, `conversionBreakdown`) -## Used In +## Reconciliation Pattern - - Real-time payment tracking + + React to events in real time and update app state immediately. - - Invoice status reconciliation + + Use query endpoints to confirm latest status and backfill missed events. + + + +## Practical Notes + +- Use `requestId` for deterministic lookup. +- Keep idempotent reconciliation logic in case the same request is processed multiple times by your workers. + +## Related Pages + + + + Understand automatic detection and status updates. + + + + Search and reconcile payment-level events. + + + + Build real-time event-driven reconciliation. -## Implementation Details +## API Reference -See [API Reference - Query Requests](/api-reference/endpoints/get-request) for complete technical documentation. \ No newline at end of file +For full schemas and examples, see [Request Network API Reference](https://api.request.network/open-api).