generated from mintlify/starter
-
Notifications
You must be signed in to change notification settings - Fork 0
docs(secure-payments): add standalone Secure Payment Pages docs and API reference, clarify support model, and simplify integration guidance #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aimensahnoun
wants to merge
1
commit into
main
Choose a base branch
from
02-12-docs_secure-payments_add_standalone_secure_payment_pages_docs_and_api_reference_clarify_support_model_and_simplify_integration_guidance
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+332
−27
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| --- | ||
| title: "Secure Payment Pages" | ||
| description: "Create hosted secure payment links and let payers complete payments from a dedicated secure flow." | ||
| --- | ||
|
|
||
| ## Overview | ||
|
|
||
| Secure Payment Pages let you generate a hosted payment URL from the API and redirect the payer to a dedicated payment experience. | ||
|
|
||
| This feature is useful when you want to reduce frontend tampering risk and separate payment execution from your checkout UI. | ||
|
|
||
| ## Built-in contract safety check | ||
|
|
||
| Before signing, the secure page validates that the transaction targets official Request Network contracts. | ||
|
|
||
| The payer-facing status copy is: | ||
| - "This is a safe smart contract" | ||
| - "The smart contract you are interacting with is an official Request Network smart contract, it is audited and valid." | ||
|
|
||
| If validation fails, the secure page warns the payer and prevents continuing with unsafe contract interactions. | ||
|
|
||
| ## How the flow works | ||
|
|
||
| <Steps> | ||
| <Step title="Create a secure payment link"> | ||
| Call `POST /v2/secure-payments` with one or more requests. | ||
|
|
||
| The API creates Request records and returns: | ||
| - `requestIds` | ||
| - `token` | ||
| - `securePaymentUrl` | ||
| </Step> | ||
|
|
||
| <Step title="Redirect the payer to the hosted page"> | ||
| Send the payer to `securePaymentUrl`. | ||
| </Step> | ||
|
|
||
| <Step title="Payer reviews payment details"> | ||
| The hosted page loads the payment details and prepares the required transaction flow. | ||
| </Step> | ||
|
|
||
| <Step title="Sign and submit payment transactions"> | ||
| The payer signs the returned transaction set from their wallet. Depending on token approvals, this can be one or more transactions. | ||
| </Step> | ||
| </Steps> | ||
|
|
||
| ## Authentication | ||
|
|
||
| Both secure payment endpoints accept: | ||
| - `x-api-key`, or | ||
| - `x-client-id` with browser `Origin` | ||
|
|
||
| See [Authentication](/api-reference/authentication) for implementation options. | ||
|
|
||
| ## API Reference | ||
|
|
||
| <Card title="POST /v2/secure-payments" icon="code" href="/api-reference/v2secure-payment/create-a-secure-payment-entry"> | ||
| Create a secure payment entry and return a hosted secure payment URL. View the complete endpoint documentation with request/response schemas and examples. | ||
| </Card> | ||
|
|
||
| ## Status outcomes | ||
|
|
||
| - `200`: token is valid and payable | ||
| - `403`: token expired or status is not payable | ||
| - `404`: token not found | ||
| - `409`: payment already completed | ||
|
|
||
| ## Next pages | ||
|
|
||
| <CardGroup cols={2}> | ||
| <Card title="Secure Payments API Reference" icon="book" href="/api-reference/secure-payments"> | ||
| Endpoint details, request and response schemas, and error codes. | ||
| </Card> | ||
|
|
||
| <Card title="Supported Networks and Currencies" icon="globe" href="/api-features/secure-payment-supported-networks-and-currencies"> | ||
| Check supported chain and currency coverage before creating links. | ||
| </Card> | ||
| </CardGroup> | ||
55 changes: 55 additions & 0 deletions
55
api-features/secure-payment-supported-networks-and-currencies.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| --- | ||
| title: "Secure Payment Supported Networks and Currencies" | ||
| description: "Chain and currency coverage for Secure Payment Pages." | ||
| --- | ||
|
|
||
| ## Coverage model | ||
|
|
||
| Secure Payment Pages use the same chain and currency coverage as standard Request API request flows. | ||
|
|
||
| This means supported options are the networks and currencies available through the API token list and request creation endpoints. | ||
|
|
||
| ## Supported currencies | ||
|
|
||
| Currencies are determined by the Request token list and available per network. | ||
|
|
||
| Use `GET /v2/currencies` to query support by network. | ||
|
|
||
| <RequestExample> | ||
| ```bash cURL | ||
| curl -X GET "https://api.request.network/v2/currencies?network=sepolia" \ | ||
| -H "x-api-key: YOUR_API_KEY" | ||
| ``` | ||
| </RequestExample> | ||
|
|
||
| <ResponseExample> | ||
| ```json Example | ||
| [ | ||
| { | ||
| "id": "FAU-sepolia", | ||
| "name": "FAU", | ||
| "symbol": "FAU", | ||
| "decimals": 18, | ||
| "network": "sepolia", | ||
| "type": "ERC20", | ||
| "chainId": 11155111 | ||
| } | ||
| ] | ||
| ``` | ||
| </ResponseExample> | ||
|
|
||
| ## How to verify support | ||
|
|
||
| - Query `GET /v2/currencies` with `network` and `symbol` filters for discovery | ||
| - Validate currency IDs before calling `POST /v2/secure-payments` | ||
| - Use the same network and currency validation rules you apply to normal request flows | ||
|
|
||
| <Info> | ||
| For an at-a-glance list of ecosystem support, see [Supported Chains and Currencies](/resources/supported-chains-and-currencies). | ||
| </Info> | ||
|
|
||
| ## Preflight checklist | ||
|
|
||
| - Confirm each currency ID exists in `GET /v2/currencies` | ||
| - Confirm each request network is supported by your target flow | ||
| - Confirm your selected currencies are available on those networks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,166 @@ | ||
| --- | ||
| title: "Secure Payments API Reference" | ||
| description: "Generate secure payment URLs and retrieve token-based payment calldata." | ||
| --- | ||
|
|
||
| ## Endpoints | ||
|
|
||
| - `POST /v2/secure-payments` | ||
| - `GET /v2/secure-payments/:token` | ||
|
|
||
| ## Authentication | ||
|
|
||
| Both endpoints support: | ||
| - `x-api-key`, or | ||
| - `x-client-id` with browser `Origin` | ||
|
|
||
| ## POST /v2/secure-payments | ||
|
|
||
| Create a secure payment entry and return a hosted payment URL. | ||
|
|
||
| ### Request fields | ||
|
|
||
| <ParamField body="requests" type="array" required> | ||
| Array of payment requests. One item creates a single payment. Multiple items create a batch payment. | ||
| </ParamField> | ||
|
|
||
| <ParamField body="requests[].payee" type="string" required> | ||
| Payee EVM address. | ||
| </ParamField> | ||
|
|
||
| <ParamField body="requests[].amount" type="string" required> | ||
| Human-readable amount. | ||
| </ParamField> | ||
|
|
||
| <ParamField body="requests[].invoiceCurrency" type="string" required> | ||
| Invoice currency ID. | ||
| </ParamField> | ||
|
|
||
| <ParamField body="requests[].paymentCurrency" type="string" required> | ||
| Payment currency ID. | ||
| </ParamField> | ||
|
|
||
| <ParamField body="feePercentage" type="string"> | ||
| Optional fee percentage from `0` to `100`. | ||
| </ParamField> | ||
|
|
||
| <ParamField body="feeAddress" type="string"> | ||
| Optional fee recipient address. | ||
| </ParamField> | ||
|
|
||
| <RequestExample> | ||
| ```bash cURL | ||
| curl -X POST "https://api.request.network/v2/secure-payments" \ | ||
| -H "x-api-key: YOUR_API_KEY" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{ | ||
| "requests": [ | ||
| { | ||
| "payee": "0x6923831ACf5c327260D7ac7C9DfF5b1c3cB3C7D7", | ||
| "amount": "10", | ||
| "invoiceCurrency": "FAU-sepolia", | ||
| "paymentCurrency": "FAU-sepolia" | ||
| } | ||
| ], | ||
| "feePercentage": "2.5", | ||
| "feeAddress": "0x6923831ACf5c327260D7ac7C9DfF5b1c3cB3C7D7" | ||
| }' | ||
| ``` | ||
| </RequestExample> | ||
|
|
||
| <ResponseExample> | ||
| ```json 201 Created | ||
| { | ||
| "requestIds": [ | ||
| "01e273ecc29d4b526df3a0f1f05ffc59372af8752c2b678096e49ac270416a7cdb" | ||
| ], | ||
| "securePaymentUrl": "https://secure.request.network/?token=01ABC123DEF456GHI789JKL", | ||
| "token": "01ABC123DEF456GHI789JKL" | ||
| } | ||
| ``` | ||
| </ResponseExample> | ||
|
|
||
| ### Error responses | ||
|
|
||
| - `400`: invalid body or unsupported secure payment configuration | ||
| - `401`: unauthorized | ||
| - `429`: rate limited | ||
|
|
||
| ## GET /v2/secure-payments/:token | ||
|
|
||
| Retrieve secure payment status and prepared transactions. | ||
|
|
||
| ### Path parameters | ||
|
|
||
| <ParamField path="token" type="string" required> | ||
| Secure payment token returned from `POST /v2/secure-payments`. | ||
| </ParamField> | ||
|
|
||
| ### Query parameters | ||
|
|
||
| <ParamField query="wallet" type="string"> | ||
| Optional payer wallet address used to optimize approval checks. | ||
| </ParamField> | ||
|
|
||
| <RequestExample> | ||
| ```bash cURL | ||
| curl -X GET "https://api.request.network/v2/secure-payments/01ABC123DEF456GHI789JKL?wallet=0x1234567890123456789012345678901234567890" \ | ||
| -H "x-api-key: YOUR_API_KEY" | ||
| ``` | ||
| </RequestExample> | ||
|
|
||
| <ResponseExample> | ||
| ```json 200 Single payment | ||
| { | ||
| "paymentType": "single", | ||
| "payee": "0x6923831ACf5c327260D7ac7C9DfF5b1c3cB3C7D7", | ||
| "network": "sepolia", | ||
| "amount": "10000000000000000000", | ||
| "paymentCurrency": "FAU-sepolia", | ||
| "isNativeCurrency": false, | ||
| "status": "pending", | ||
| "transactions": [ | ||
| { | ||
| "to": "0x370DE27fdb7D1Ff1e1BaA7D11c5820a324Cf623C", | ||
| "data": "0x...", | ||
| "value": 0 | ||
| } | ||
| ], | ||
| "metadata": { | ||
| "stepsRequired": 1, | ||
| "needsApproval": false, | ||
| "paymentTransactionIndex": 0 | ||
| } | ||
| } | ||
| ``` | ||
| </ResponseExample> | ||
|
|
||
| <ResponseExample> | ||
| ```json 200 Batch payment | ||
| { | ||
| "paymentType": "batch", | ||
| "payees": [ | ||
| "0xb07d2398d2004378cad234da0ef14f1c94a530e4", | ||
| "0x6923831ACf5c327260D7ac7C9DfF5b1c3cB3C7D7" | ||
| ], | ||
| "network": "sepolia", | ||
| "amounts": ["50", "10"], | ||
| "paymentCurrencies": ["FAU-sepolia", "FAU-sepolia"], | ||
| "isNativeCurrency": [false, false], | ||
| "status": "pending", | ||
| "ERC20ApprovalTransactions": [], | ||
| "batchPaymentTransaction": { | ||
| "to": "0x399F5EE127ce7432E4921a61b8CF52b0af52cbfE", | ||
| "data": "0x...", | ||
| "value": 0 | ||
| } | ||
| } | ||
| ``` | ||
| </ResponseExample> | ||
|
|
||
| ### Error responses | ||
|
|
||
| - `403`: token expired or not payable | ||
| - `404`: token not found | ||
| - `409`: secure payment already completed | ||
| - `429`: rate limited |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.