Conversation
…ence Expand the Ecommerce and Online Checkout section from a placeholder into full merchant integration documentation covering payment creation, buyer redirect flow, and server-side status verification. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds comprehensive merchant-facing documentation for the WalletConnect Pay ecommerce/online checkout flow, replacing the previous “Contact Sales” placeholder with actionable integration and API reference content.
Changes:
- Added a step-by-step ecommerce checkout integration guide (redirect flow, Mermaid diagram, and TypeScript examples).
- Added a Merchant API reference for creating payments and verifying payment status (schemas, examples, and status semantics).
- Updated the ecommerce overview page and docs navigation to surface the new content.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| payments/ecommerce/overview.mdx | Replaces placeholder content with an overview of the checkout flow plus “Get Started” entry points. |
| payments/ecommerce/integration.mdx | New integration guide describing the redirect-based checkout flow with examples and operational notes. |
| payments/ecommerce/api-reference.mdx | New reference documentation for POST /v1/merchant/payment and GET /v1/merchant/payment/{id}/status. |
| docs.json | Adds the new ecommerce pages to the “Ecommerce and Online Checkout” sidebar group. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - **Partner API Key** — available in your Merchant Dashboard after onboarding | ||
| - **Merchant ID** — your merchant identifier from the Merchant Dashboard | ||
| - **A backend server** — all API calls must be made server-side to keep your API key secure |
There was a problem hiding this comment.
The prerequisites call the credential a “Partner API Key”, while the overview page refers to an “API Key”. Consider standardizing the term across the ecommerce docs (and aligning with the header name Api-Key) to reduce confusion for merchants.
| - **Partner API Key** — available in your Merchant Dashboard after onboarding | |
| - **Merchant ID** — your merchant identifier from the Merchant Dashboard | |
| - **A backend server** — all API calls must be made server-side to keep your API key secure | |
| - **API Key** — available in your Merchant Dashboard after onboarding (used as the `Api-Key` header) | |
| - **Merchant ID** — your merchant identifier from the Merchant Dashboard | |
| - **A backend server** — all API calls must be made server-side to keep your API Key secure |
|
|
||
| | Header | Required | Description | | ||
| |--------|----------|-------------| | ||
| | `Content-Type` | Yes | Must be `application/json` | |
There was a problem hiding this comment.
The Authentication section says every request requires Content-Type: application/json, but the GET status endpoint examples/headers omit it. Either make Content-Type conditional (e.g., only required for requests with a JSON body) or include it consistently in the Verify Status section/examples.
| | `Content-Type` | Yes | Must be `application/json` | | |
| | `Content-Type` | Conditional | Must be `application/json` for requests with a JSON body | |
| BX->>MF: Redirect to successUrl?payment_id=id | ||
| else Payment fails | ||
| BX->>MF: Redirect to errorUrl?payment_id=id | ||
| end | ||
|
|
||
| MF->>MB: Verify payment status | ||
| MB->>API: GET /v1/merchant/payment/{id}/status |
There was a problem hiding this comment.
In the Mermaid diagram, the return redirect query string uses payment_id=id, which doesn’t match the rest of the guide’s placeholder ({paymentId}) and could mislead integrators copying the URL format. Update the diagram placeholders to consistently use paymentId (or {paymentId}) for the appended query param.
| BX->>MF: Redirect to successUrl?payment_id=id | |
| else Payment fails | |
| BX->>MF: Redirect to errorUrl?payment_id=id | |
| end | |
| MF->>MB: Verify payment status | |
| MB->>API: GET /v1/merchant/payment/{id}/status | |
| BX->>MF: Redirect to successUrl?paymentId={paymentId} | |
| else Payment fails | |
| BX->>MF: Redirect to errorUrl?paymentId={paymentId} | |
| end | |
| MF->>MB: Verify payment status | |
| MB->>API: GET /v1/merchant/payment/{paymentId}/status |
| // Extract the payment ID from the redirect URL | ||
| const url = new URL(window.location.href); | ||
| const paymentId = url.searchParams.get("payment_id"); | ||
|
|
There was a problem hiding this comment.
url.searchParams.get("payment_id") can return null, but the example immediately passes paymentId into verifyPayment(...). Add a guard/error handling (or reflect the nullable type) so the example remains valid TypeScript and doesn’t imply payment_id is always present.
| if (!paymentId) { | |
| throw new Error("Missing payment_id in URL"); | |
| } |
| const { status, isFinal } = await response.json(); | ||
|
|
||
| if (status === "succeeded") { | ||
| await fulfillOrder(orderId); | ||
| } else if (status === "processing") { | ||
| // Transaction submitted but not yet confirmed — check again shortly | ||
| } else { | ||
| // "failed" or "expired" — inform the buyer | ||
| } |
There was a problem hiding this comment.
In the server-side verification example, fulfillOrder(orderId) references orderId which is not defined anywhere in the snippet, making the example non-runnable and ambiguous about how to correlate the payment back to an order. Use a defined identifier (e.g., the order you stored alongside paymentId / referenceId) or clarify where orderId comes from.
| // Extract the payment ID from the redirect URL | ||
| const url = new URL(window.location.href); | ||
| const paymentId = url.searchParams.get("payment_id"); | ||
|
|
||
| // Verify the payment status from your backend (next step) | ||
| const status = await verifyPayment(paymentId); | ||
| ``` | ||
|
|
||
| <Warning> | ||
| **Never trust the redirect URL alone.** The redirect can be spoofed by a buyer navigating directly to your success URL. Always verify the payment status server-side before fulfilling an order. | ||
| </Warning> | ||
| </Step> | ||
|
|
||
| <Step title="Verify Payment Status" icon="shield-check"> | ||
| From your backend, call the status endpoint to get the authoritative payment result. | ||
|
|
||
| ```typescript | ||
| // Server-side: verify payment status | ||
| const response = await fetch( | ||
| `https://api.pay.walletconnect.org/v1/merchant/payment/${paymentId}/status`, | ||
| { | ||
| headers: { | ||
| "Api-Key": process.env.WCP_API_KEY, | ||
| "Merchant-Id": process.env.WCP_MERCHANT_ID, | ||
| }, | ||
| } | ||
| ); | ||
|
|
||
| const { status, isFinal } = await response.json(); |
There was a problem hiding this comment.
The integration flow currently shows taking the payment_id query parameter from the redirect URL and passing it directly to your backend to decide whether to fulfill an order. Because buyers can tamper with the URL, this pattern allows replay or substitution of a previously successful paymentId to mark a different order as paid if the backend relies only on status for fulfillment. Instead, treat the redirect payment_id as an untrusted hint: look up the expected paymentId for the current order from your own database (or verify the referenceId/amount against your records) and only fulfill the order if the verified payment matches that specific order.
Summary
payments/ecommerce/integration.mdx) — Step-by-step guide for merchants to integrate the online checkout flow: create payment via Merchant API, redirect buyer to BX portal, handle return redirect, and verify payment status server-side. Includes Mermaid sequence diagram, TypeScript code examples, checkout URL requirements, merchant branding, and staging/testing info.payments/ecommerce/api-reference.mdx) — Merchant API reference documentingPOST /v1/merchant/payment(create payment) andGET /v1/merchant/payment/{id}/status(verify status) with request/response schemas, field tables, cURL/TypeScript examples, and error codes.payments/ecommerce/overview.mdx) — Transformed from "Contact Sales" placeholder into a proper section overview with a "How It Works" flow description, prerequisite note linking to merchant onboarding, and Get Started navigation cards.docs.json) — Added new pages to the "Ecommerce and Online Checkout" sidebar group.Test plan
npx mintlify broken-links— verified no broken links<CodeGroup>tabs work for cURL/TypeScript examples/payments/merchant/onboardingand/payments/ecommerce/api-referenceresolve correctly🤖 Generated with Claude Code