docs(secure-payments): document redirectUrl + redirectLabel#93
docs(secure-payments): document redirectUrl + redirectLabel#93rodrigopavezi wants to merge 1 commit into
Conversation
The Request API now accepts an optional redirectUrl (and matching
redirectLabel) on POST /v2/secure-payments and POST /v2/secure-payments/
payouts. After a successful payment, the secure payment app renders a
button on the success screen that takes the payer back to the URL —
explicit user action, not an auto-redirect.
Documented across three pages so the API surface, payer-side UI, and
integration story all line up:
- api-reference/secure-payments.mdx — added redirectUrl + redirectLabel
ParamFields on both POST endpoints, with the exact validation rules:
http(s) only, no HTML/script payload chars; redirectLabel is 1–255
chars and rejected without a redirectUrl.
- tools/secure-payments.mdx — Confirm step now mentions the back-to-site
button, default copy ("Go Back and Close"), and the redirectLabel
override.
- use-cases/programmatic-payment-links.mdx — added a "Send the customer
back to your site after payment" section with a TS snippet and the
full validation/error-string list, plus a note that the same fields
apply to /payouts.
Greptile SummaryThis PR documents the new optional
Confidence Score: 4/5Safe to merge after fixing the incomplete TypeScript snippet; the missing response capture means developers copying the new example have no way to retrieve the payment URL. The new TypeScript snippet in the use-case page discards the fetch response entirely, so a developer following the example cannot obtain securePaymentUrl — the only output that matters. Every other code sample on the same page captures and uses the response. The redirectUrl ParamField description also opens with 'the payer is redirected to,' which directly contradicts the '(no auto-redirect)' clarification in the same sentence. use-cases/programmatic-payment-links.mdx (incomplete code example) and api-reference/secure-payments.mdx (contradictory redirectUrl description) Important Files Changed
Sequence DiagramsequenceDiagram
participant M as Merchant Backend
participant API as Request API
participant P as Payer (pay.request.network)
participant S as Merchant Site
M->>API: "POST /v2/secure-payments {redirectUrl, redirectLabel}"
API-->>M: "{securePaymentUrl, token}"
M->>P: Share securePaymentUrl with customer
P->>P: Connect wallet and confirm payment
P->>P: Show success screen with button
P-->>S: Payer clicks button, navigates to redirectUrl
API-->>M: Webhook: payment.confirmed
Reviews (1): Last reviewed commit: "docs(secure-payments): document redirect..." | Re-trigger Greptile |

The Request API now accepts an optional redirectUrl (and matching
redirectLabel) on POST /v2/secure-payments and POST /v2/secure-payments/
payouts. After a successful payment, the secure payment app renders a
button on the success screen that takes the payer back to the URL —
explicit user action, not an auto-redirect.
Documented across three pages so the API surface, payer-side UI, and
integration story all line up:
ParamFields on both POST endpoints, with the exact validation rules:
http(s) only, no HTML/script payload chars; redirectLabel is 1–255
chars and rejected without a redirectUrl.
button, default copy ("Go Back and Close"), and the redirectLabel
override.
back to your site after payment" section with a TS snippet and the
full validation/error-string list, plus a note that the same fields
apply to /payouts.