From 1bcd2a3e7656aabe00e5a804c842c76ecb3ac47f Mon Sep 17 00:00:00 2001 From: Tom Ra Date: Mon, 26 Oct 2026 10:57:26 -0300 Subject: [PATCH] Move API Reference to its own navbar tab with a version switcher Co-Authored-By: Claude Opus 5.5 (1M context) --- AGENTS.md | 4 +- components/snippets/home.tsx | 16 +- content/docs/index.mdx | 3 - ...hants-merchantid-settlements-crypto-id.mdx | 2 + .../delete-v1-merchants-merchantid.mdx | 2 + .../get-v1-gateway-payment-id-status.mdx | 2 + .../2026-02-18/get-v1-gateway-payment-id.mdx | 2 + .../get-v1-merchants-merchant-id-payments.mdx | 2 + ...et-v1-merchants-merchantid-settlements.mdx | 2 + .../get-v1-merchants-merchantid.mdx | 2 + .../2026-02-18/get-v1-merchants-payments.mdx | 2 + .../2026-02-18/get-v1-merchants.mdx | 2 + .../2026-02-18/get-v1-payments-id-status.mdx | 2 + .../2026-02-18/get-v1-payments-id.mdx | 2 + .../2026-02-18/get-v1-payments.mdx | 2 + .../patch-v1-merchants-merchantid.mdx | 2 + .../post-v1-gateway-payment-id-cancel.mdx | 2 + .../post-v1-gateway-payment-id-confirm.mdx | 2 + .../post-v1-gateway-payment-id-fetch.mdx | 2 + .../post-v1-gateway-payment-id-options.mdx | 2 + ...erchants-merchantid-settlements-crypto.mdx | 2 + .../2026-02-18/post-v1-merchants.mdx | 2 + .../2026-02-18/post-v1-payments-id-cancel.mdx | 2 + .../2026-02-18/post-v1-payments.mdx | 2 + .../2026-02-18/post-v1-refunds.mdx | 2 + ...hants-merchantid-settlements-crypto-id.mdx | 2 + ...hants-merchantid-settlements-crypto-id.mdx | 2 + .../delete-v1-merchants-merchantid.mdx | 2 + .../get-v1-gateway-payment-id-status.mdx | 2 + .../get-v1-gateway-payment-id.mdx | 2 + .../get-v1-merchants-merchant-id-payments.mdx | 2 + ...et-v1-merchants-merchantid-settlements.mdx | 2 + .../get-v1-merchants-merchantid.mdx | 2 + .../get-v1-merchants-payments.mdx | 2 + .../2026-02-19.preview/get-v1-merchants.mdx | 2 + .../get-v1-payments-id-status.mdx | 2 + .../2026-02-19.preview/get-v1-payments-id.mdx | 2 + .../2026-02-19.preview/get-v1-payments.mdx | 2 + .../patch-v1-merchants-merchantid.mdx | 2 + .../post-v1-gateway-payment-id-cancel.mdx | 2 + .../post-v1-gateway-payment-id-confirm.mdx | 2 + .../post-v1-gateway-payment-id-fetch.mdx | 2 + .../post-v1-gateway-payment-id-options.mdx | 2 + ...erchants-merchantid-settlements-crypto.mdx | 2 + .../2026-02-19.preview/post-v1-merchants.mdx | 2 + .../post-v1-payments-id-cancel.mdx | 2 + .../2026-02-19.preview/post-v1-payments.mdx | 2 + .../2026-02-19.preview/post-v1-refunds.mdx | 2 + ...hants-merchantid-settlements-crypto-id.mdx | 2 + content/navigation.json | 219 +++++++++--------- lib/navigation.tsx | 56 ++++- lib/source.ts | 2 + public/images/api-reference-dark.svg | 21 ++ public/images/api-reference.svg | 21 ++ public/images/wallet-verification-dark.svg | 21 ++ public/images/wallet-verification.svg | 21 ++ scripts/generate-specs.mjs | 62 +++-- 57 files changed, 388 insertions(+), 150 deletions(-) create mode 100644 public/images/api-reference-dark.svg create mode 100644 public/images/api-reference.svg create mode 100644 public/images/wallet-verification-dark.svg create mode 100644 public/images/wallet-verification.svg diff --git a/AGENTS.md b/AGENTS.md index efccdee..9aa40c9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -172,7 +172,7 @@ Always wrap `` in ``. Use them for FAQs and optional deta - ``: API reference pages (generated, see below). - ``, ``: live lists from the WalletConnect Explorer. -- ``, ``, `<ProductCard>`, `<ProductCards>`: landing pages only (`mode: frame`). `<ProductCards>` is the four product cards shared by the home page and the 404 page. +- `<Container>`, `<Title>`, `<ProductCard>`, `<ProductCards>`: landing pages only (`mode: frame`). `<ProductCards>` is the product cards shared by the home page and the 404 page. ### Headings and links @@ -193,7 +193,7 @@ Put imports right after the frontmatter. Reuse a snippet instead of copying the ## Generated files (don't hand-edit) -- `openapi/*.json`, `content/docs/payments/api-reference/<version>/`, the API Reference group in `navigation.json` and the `/payments/api-reference/latest` redirect are all rewritten by `pnpm generate` (also the **Update OpenAPI Specs** workflow). Change `scripts/generate-specs.mjs` instead. `content/docs/payments/api-reference/{index,authentication,versioning}.mdx` are hand-written. +- `openapi/*.json`, `content/docs/payments/api-reference/<version>/`, the API Reference tab in `navigation.json` and the `/payments/api-reference/latest` redirect are all rewritten by `pnpm generate` (also the **Update OpenAPI Specs** workflow). Change `scripts/generate-specs.mjs` instead. `content/docs/payments/api-reference/{index,authentication,versioning}.mdx` are hand-written. - `.source/` is generated by `fumadocs-mdx`. - `out/` is the static export from `pnpm build`, and `.wrangler/` is Wrangler's local state. diff --git a/components/snippets/home.tsx b/components/snippets/home.tsx index 7dad3fc..fc93218 100644 --- a/components/snippets/home.tsx +++ b/components/snippets/home.tsx @@ -60,7 +60,7 @@ export function ProductCard({ img, imgDark, href, title, description, model, typ ); } -/** The four product entry points, shown on the home page and the 404 page. */ +/** The product entry points, shown on the home page and the 404 page. */ export function ProductCards() { return ( <div className="grid gap-4 sm:grid-cols-2"> @@ -92,6 +92,20 @@ export function ProductCards() { img="/images/network.svg" imgDark="/images/network-dark.svg" /> + <ProductCard + title="Wallet Verification" + description="Prove that a user controls a crypto wallet by having them sign a message." + href="/wallet-verification" + img="/images/wallet-verification.svg" + imgDark="/images/wallet-verification-dark.svg" + /> + <ProductCard + title="API Reference" + description="Explore every WalletConnect Pay API endpoint, with authentication and versioning." + href="/payments/api-reference" + img="/images/api-reference.svg" + imgDark="/images/api-reference-dark.svg" + /> </div> ); } diff --git a/content/docs/index.mdx b/content/docs/index.mdx index 2952a6d..47151c0 100644 --- a/content/docs/index.mdx +++ b/content/docs/index.mdx @@ -14,9 +14,6 @@ description: "The Connectivity Layer for the Financial Internet" <p className="text-[#5B616E] dark:text-gray-300 text-md mb-1 mt-3"> WalletConnect powers apps, wallets and end-users via the WalletConnect network. </p> - <p className="text-[#5B616E] dark:text-gray-300 text-md mt-4"> - <strong>Check out our quickstart guides to get started!</strong> - </p> </div> <ProductCards /> <ul className="not-prose pb-[1px] h-1 min-w-full mt-3 overflow-auto" /> diff --git a/content/docs/payments/api-reference/2026-02-18/delete-v1-merchants-merchantid-settlements-crypto-id.mdx b/content/docs/payments/api-reference/2026-02-18/delete-v1-merchants-merchantid-settlements-crypto-id.mdx index 2ec56f0..6ed11a3 100644 --- a/content/docs/payments/api-reference/2026-02-18/delete-v1-merchants-merchantid-settlements-crypto-id.mdx +++ b/content/docs/payments/api-reference/2026-02-18/delete-v1-merchants-merchantid-settlements-crypto-id.mdx @@ -1,5 +1,7 @@ --- title: "Delete a crypto settlement" +_openapi: + method: DELETE --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/merchants/{merchantId}/settlements/crypto/{id}","method":"delete"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/delete-v1-merchants-merchantid.mdx b/content/docs/payments/api-reference/2026-02-18/delete-v1-merchants-merchantid.mdx index d96701e..9fcae99 100644 --- a/content/docs/payments/api-reference/2026-02-18/delete-v1-merchants-merchantid.mdx +++ b/content/docs/payments/api-reference/2026-02-18/delete-v1-merchants-merchantid.mdx @@ -1,5 +1,7 @@ --- title: "Delete a merchant" +_openapi: + method: DELETE --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/merchants/{merchantId}","method":"delete"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/get-v1-gateway-payment-id-status.mdx b/content/docs/payments/api-reference/2026-02-18/get-v1-gateway-payment-id-status.mdx index 66f9f1a..893a940 100644 --- a/content/docs/payments/api-reference/2026-02-18/get-v1-gateway-payment-id-status.mdx +++ b/content/docs/payments/api-reference/2026-02-18/get-v1-gateway-payment-id-status.mdx @@ -1,5 +1,7 @@ --- title: "Get the payment status" +_openapi: + method: GET --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/gateway/payment/{id}/status","method":"get"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/get-v1-gateway-payment-id.mdx b/content/docs/payments/api-reference/2026-02-18/get-v1-gateway-payment-id.mdx index 0476000..1a4336b 100644 --- a/content/docs/payments/api-reference/2026-02-18/get-v1-gateway-payment-id.mdx +++ b/content/docs/payments/api-reference/2026-02-18/get-v1-gateway-payment-id.mdx @@ -1,5 +1,7 @@ --- title: "Get a payment" +_openapi: + method: GET --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/gateway/payment/{id}","method":"get"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-merchant-id-payments.mdx b/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-merchant-id-payments.mdx index e5dfb47..7a6fb5e 100644 --- a/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-merchant-id-payments.mdx +++ b/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-merchant-id-payments.mdx @@ -1,5 +1,7 @@ --- title: "Get payments for a merchant" +_openapi: + method: GET --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/merchants/{merchant_id}/payments","method":"get"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-merchantid-settlements.mdx b/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-merchantid-settlements.mdx index 21bb0b8..2046ae6 100644 --- a/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-merchantid-settlements.mdx +++ b/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-merchantid-settlements.mdx @@ -1,5 +1,7 @@ --- title: "List settlements" +_openapi: + method: GET --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/merchants/{merchantId}/settlements","method":"get"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-merchantid.mdx b/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-merchantid.mdx index 57a0090..c74f571 100644 --- a/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-merchantid.mdx +++ b/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-merchantid.mdx @@ -1,5 +1,7 @@ --- title: "Get a merchant" +_openapi: + method: GET --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/merchants/{merchantId}","method":"get"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-payments.mdx b/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-payments.mdx index 14477cc..edba46b 100644 --- a/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-payments.mdx +++ b/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-payments.mdx @@ -1,5 +1,7 @@ --- title: "List payments for a merchant" +_openapi: + method: GET --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/merchants/payments","method":"get"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/get-v1-merchants.mdx b/content/docs/payments/api-reference/2026-02-18/get-v1-merchants.mdx index 979cd26..2e2272a 100644 --- a/content/docs/payments/api-reference/2026-02-18/get-v1-merchants.mdx +++ b/content/docs/payments/api-reference/2026-02-18/get-v1-merchants.mdx @@ -1,5 +1,7 @@ --- title: "List merchants" +_openapi: + method: GET --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/merchants","method":"get"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/get-v1-payments-id-status.mdx b/content/docs/payments/api-reference/2026-02-18/get-v1-payments-id-status.mdx index 1bb20d0..783187a 100644 --- a/content/docs/payments/api-reference/2026-02-18/get-v1-payments-id-status.mdx +++ b/content/docs/payments/api-reference/2026-02-18/get-v1-payments-id-status.mdx @@ -1,5 +1,7 @@ --- title: "Get the payment status" +_openapi: + method: GET --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/payments/{id}/status","method":"get"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/get-v1-payments-id.mdx b/content/docs/payments/api-reference/2026-02-18/get-v1-payments-id.mdx index 9e9fa70..f130c5c 100644 --- a/content/docs/payments/api-reference/2026-02-18/get-v1-payments-id.mdx +++ b/content/docs/payments/api-reference/2026-02-18/get-v1-payments-id.mdx @@ -1,5 +1,7 @@ --- title: "Get payment details" +_openapi: + method: GET --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/payments/{id}","method":"get"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/get-v1-payments.mdx b/content/docs/payments/api-reference/2026-02-18/get-v1-payments.mdx index 69551df..816857a 100644 --- a/content/docs/payments/api-reference/2026-02-18/get-v1-payments.mdx +++ b/content/docs/payments/api-reference/2026-02-18/get-v1-payments.mdx @@ -1,5 +1,7 @@ --- title: "List payments" +_openapi: + method: GET --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/payments","method":"get"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/patch-v1-merchants-merchantid.mdx b/content/docs/payments/api-reference/2026-02-18/patch-v1-merchants-merchantid.mdx index d3596cd..30c8e80 100644 --- a/content/docs/payments/api-reference/2026-02-18/patch-v1-merchants-merchantid.mdx +++ b/content/docs/payments/api-reference/2026-02-18/patch-v1-merchants-merchantid.mdx @@ -1,5 +1,7 @@ --- title: "Update a merchant" +_openapi: + method: PATCH --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/merchants/{merchantId}","method":"patch"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/post-v1-gateway-payment-id-cancel.mdx b/content/docs/payments/api-reference/2026-02-18/post-v1-gateway-payment-id-cancel.mdx index e37a0ee..ab7df5b 100644 --- a/content/docs/payments/api-reference/2026-02-18/post-v1-gateway-payment-id-cancel.mdx +++ b/content/docs/payments/api-reference/2026-02-18/post-v1-gateway-payment-id-cancel.mdx @@ -1,5 +1,7 @@ --- title: "POST /v1/gateway/payment/{id}/cancel" +_openapi: + method: POST --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/gateway/payment/{id}/cancel","method":"post"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/post-v1-gateway-payment-id-confirm.mdx b/content/docs/payments/api-reference/2026-02-18/post-v1-gateway-payment-id-confirm.mdx index ed325bb..2211d7c 100644 --- a/content/docs/payments/api-reference/2026-02-18/post-v1-gateway-payment-id-confirm.mdx +++ b/content/docs/payments/api-reference/2026-02-18/post-v1-gateway-payment-id-confirm.mdx @@ -1,5 +1,7 @@ --- title: "Confirm a payment" +_openapi: + method: POST --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/gateway/payment/{id}/confirm","method":"post"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/post-v1-gateway-payment-id-fetch.mdx b/content/docs/payments/api-reference/2026-02-18/post-v1-gateway-payment-id-fetch.mdx index 4a312f8..f1dfc62 100644 --- a/content/docs/payments/api-reference/2026-02-18/post-v1-gateway-payment-id-fetch.mdx +++ b/content/docs/payments/api-reference/2026-02-18/post-v1-gateway-payment-id-fetch.mdx @@ -1,5 +1,7 @@ --- title: "Fetches an action" +_openapi: + method: POST --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/gateway/payment/{id}/fetch","method":"post"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/post-v1-gateway-payment-id-options.mdx b/content/docs/payments/api-reference/2026-02-18/post-v1-gateway-payment-id-options.mdx index d3b2b92..2fc0611 100644 --- a/content/docs/payments/api-reference/2026-02-18/post-v1-gateway-payment-id-options.mdx +++ b/content/docs/payments/api-reference/2026-02-18/post-v1-gateway-payment-id-options.mdx @@ -1,5 +1,7 @@ --- title: "Get payment options" +_openapi: + method: POST --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/gateway/payment/{id}/options","method":"post"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/post-v1-merchants-merchantid-settlements-crypto.mdx b/content/docs/payments/api-reference/2026-02-18/post-v1-merchants-merchantid-settlements-crypto.mdx index 0920d00..8030dbe 100644 --- a/content/docs/payments/api-reference/2026-02-18/post-v1-merchants-merchantid-settlements-crypto.mdx +++ b/content/docs/payments/api-reference/2026-02-18/post-v1-merchants-merchantid-settlements-crypto.mdx @@ -1,5 +1,7 @@ --- title: "Create crypto settlements" +_openapi: + method: POST --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/merchants/{merchantId}/settlements/crypto","method":"post"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/post-v1-merchants.mdx b/content/docs/payments/api-reference/2026-02-18/post-v1-merchants.mdx index 36e4c8c..9bc69b5 100644 --- a/content/docs/payments/api-reference/2026-02-18/post-v1-merchants.mdx +++ b/content/docs/payments/api-reference/2026-02-18/post-v1-merchants.mdx @@ -1,5 +1,7 @@ --- title: "Create a merchant" +_openapi: + method: POST --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/merchants","method":"post"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/post-v1-payments-id-cancel.mdx b/content/docs/payments/api-reference/2026-02-18/post-v1-payments-id-cancel.mdx index 11a322e..a3e135d 100644 --- a/content/docs/payments/api-reference/2026-02-18/post-v1-payments-id-cancel.mdx +++ b/content/docs/payments/api-reference/2026-02-18/post-v1-payments-id-cancel.mdx @@ -1,5 +1,7 @@ --- title: "POST /v1/payments/{id}/cancel" +_openapi: + method: POST --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/payments/{id}/cancel","method":"post"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/post-v1-payments.mdx b/content/docs/payments/api-reference/2026-02-18/post-v1-payments.mdx index 0a7920a..dd71c8c 100644 --- a/content/docs/payments/api-reference/2026-02-18/post-v1-payments.mdx +++ b/content/docs/payments/api-reference/2026-02-18/post-v1-payments.mdx @@ -1,5 +1,7 @@ --- title: "Create a new payment" +_openapi: + method: POST --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/payments","method":"post"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/post-v1-refunds.mdx b/content/docs/payments/api-reference/2026-02-18/post-v1-refunds.mdx index 0aa240f..dcd452f 100644 --- a/content/docs/payments/api-reference/2026-02-18/post-v1-refunds.mdx +++ b/content/docs/payments/api-reference/2026-02-18/post-v1-refunds.mdx @@ -1,5 +1,7 @@ --- title: "Mark a payment as refunded" +_openapi: + method: POST --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/refunds","method":"post"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-18/put-v1-merchants-merchantid-settlements-crypto-id.mdx b/content/docs/payments/api-reference/2026-02-18/put-v1-merchants-merchantid-settlements-crypto-id.mdx index 939e13f..627b4ea 100644 --- a/content/docs/payments/api-reference/2026-02-18/put-v1-merchants-merchantid-settlements-crypto-id.mdx +++ b/content/docs/payments/api-reference/2026-02-18/put-v1-merchants-merchantid-settlements-crypto-id.mdx @@ -1,5 +1,7 @@ --- title: "Update a crypto settlement destination" +_openapi: + method: PUT --- <APIPage document="2026-02-18.json" operations={[{"path":"/v1/merchants/{merchantId}/settlements/crypto/{id}","method":"put"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid-settlements-crypto-id.mdx b/content/docs/payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid-settlements-crypto-id.mdx index 595f584..2d0cb45 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid-settlements-crypto-id.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid-settlements-crypto-id.mdx @@ -1,5 +1,7 @@ --- title: "Delete a crypto settlement" +_openapi: + method: DELETE --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/merchants/{merchantId}/settlements/crypto/{id}","method":"delete"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid.mdx b/content/docs/payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid.mdx index aed52bc..81fd656 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid.mdx @@ -1,5 +1,7 @@ --- title: "Delete a merchant" +_openapi: + method: DELETE --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/merchants/{merchantId}","method":"delete"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-gateway-payment-id-status.mdx b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-gateway-payment-id-status.mdx index 812aeb3..894c173 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-gateway-payment-id-status.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-gateway-payment-id-status.mdx @@ -1,5 +1,7 @@ --- title: "Get the payment status" +_openapi: + method: GET --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/gateway/payment/{id}/status","method":"get"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-gateway-payment-id.mdx b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-gateway-payment-id.mdx index 2ff34f4..a508ca3 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-gateway-payment-id.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-gateway-payment-id.mdx @@ -1,5 +1,7 @@ --- title: "Get a payment" +_openapi: + method: GET --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/gateway/payment/{id}","method":"get"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-merchant-id-payments.mdx b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-merchant-id-payments.mdx index 243381d..1484937 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-merchant-id-payments.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-merchant-id-payments.mdx @@ -1,5 +1,7 @@ --- title: "Get payments for a merchant" +_openapi: + method: GET --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/merchants/{merchant_id}/payments","method":"get"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid-settlements.mdx b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid-settlements.mdx index 36464d2..24acecf 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid-settlements.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid-settlements.mdx @@ -1,5 +1,7 @@ --- title: "List settlements" +_openapi: + method: GET --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/merchants/{merchantId}/settlements","method":"get"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid.mdx b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid.mdx index 39b59f0..29ec420 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid.mdx @@ -1,5 +1,7 @@ --- title: "Get a merchant" +_openapi: + method: GET --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/merchants/{merchantId}","method":"get"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-payments.mdx b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-payments.mdx index 8d83fd3..cdd95ea 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-payments.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-payments.mdx @@ -1,5 +1,7 @@ --- title: "List payments for a merchant" +_openapi: + method: GET --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/merchants/payments","method":"get"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants.mdx b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants.mdx index 4486b49..8d7ab2c 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants.mdx @@ -1,5 +1,7 @@ --- title: "List merchants" +_openapi: + method: GET --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/merchants","method":"get"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-payments-id-status.mdx b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-payments-id-status.mdx index e7d0304..8d749eb 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-payments-id-status.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-payments-id-status.mdx @@ -1,5 +1,7 @@ --- title: "Get the payment status" +_openapi: + method: GET --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/payments/{id}/status","method":"get"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-payments-id.mdx b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-payments-id.mdx index 8951975..84a9a2c 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-payments-id.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-payments-id.mdx @@ -1,5 +1,7 @@ --- title: "Get payment details" +_openapi: + method: GET --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/payments/{id}","method":"get"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-payments.mdx b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-payments.mdx index 1ee8eaf..99a9128 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-payments.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-payments.mdx @@ -1,5 +1,7 @@ --- title: "List payments" +_openapi: + method: GET --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/payments","method":"get"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/patch-v1-merchants-merchantid.mdx b/content/docs/payments/api-reference/2026-02-19.preview/patch-v1-merchants-merchantid.mdx index 3533008..c180537 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/patch-v1-merchants-merchantid.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/patch-v1-merchants-merchantid.mdx @@ -1,5 +1,7 @@ --- title: "Update a merchant" +_openapi: + method: PATCH --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/merchants/{merchantId}","method":"patch"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-cancel.mdx b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-cancel.mdx index f866e23..f4abe17 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-cancel.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-cancel.mdx @@ -1,5 +1,7 @@ --- title: "POST /v1/gateway/payment/{id}/cancel" +_openapi: + method: POST --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/gateway/payment/{id}/cancel","method":"post"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-confirm.mdx b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-confirm.mdx index f30647e..3c6f91a 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-confirm.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-confirm.mdx @@ -1,5 +1,7 @@ --- title: "Confirm a payment" +_openapi: + method: POST --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/gateway/payment/{id}/confirm","method":"post"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-fetch.mdx b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-fetch.mdx index b44c996..05d5ec8 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-fetch.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-fetch.mdx @@ -1,5 +1,7 @@ --- title: "Fetches an action" +_openapi: + method: POST --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/gateway/payment/{id}/fetch","method":"post"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-options.mdx b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-options.mdx index 3dee465..ebfa28c 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-options.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-options.mdx @@ -1,5 +1,7 @@ --- title: "Get payment options" +_openapi: + method: POST --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/gateway/payment/{id}/options","method":"post"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-merchants-merchantid-settlements-crypto.mdx b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-merchants-merchantid-settlements-crypto.mdx index f7909e7..bd4e3a6 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-merchants-merchantid-settlements-crypto.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-merchants-merchantid-settlements-crypto.mdx @@ -1,5 +1,7 @@ --- title: "Create crypto settlements" +_openapi: + method: POST --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/merchants/{merchantId}/settlements/crypto","method":"post"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-merchants.mdx b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-merchants.mdx index ae3083f..64175d2 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-merchants.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-merchants.mdx @@ -1,5 +1,7 @@ --- title: "Create a merchant" +_openapi: + method: POST --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/merchants","method":"post"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-payments-id-cancel.mdx b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-payments-id-cancel.mdx index 6548741..8cab5aa 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-payments-id-cancel.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-payments-id-cancel.mdx @@ -1,5 +1,7 @@ --- title: "POST /v1/payments/{id}/cancel" +_openapi: + method: POST --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/payments/{id}/cancel","method":"post"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-payments.mdx b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-payments.mdx index e6d2429..1f2595c 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-payments.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-payments.mdx @@ -1,5 +1,7 @@ --- title: "Create a new payment" +_openapi: + method: POST --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/payments","method":"post"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-refunds.mdx b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-refunds.mdx index 57e412b..f60c345 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-refunds.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-refunds.mdx @@ -1,5 +1,7 @@ --- title: "Mark a payment as refunded" +_openapi: + method: POST --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/refunds","method":"post"}]} /> diff --git a/content/docs/payments/api-reference/2026-02-19.preview/put-v1-merchants-merchantid-settlements-crypto-id.mdx b/content/docs/payments/api-reference/2026-02-19.preview/put-v1-merchants-merchantid-settlements-crypto-id.mdx index 0a0d381..19990c2 100644 --- a/content/docs/payments/api-reference/2026-02-19.preview/put-v1-merchants-merchantid-settlements-crypto-id.mdx +++ b/content/docs/payments/api-reference/2026-02-19.preview/put-v1-merchants-merchantid-settlements-crypto-id.mdx @@ -1,5 +1,7 @@ --- title: "Update a crypto settlement destination" +_openapi: + method: PUT --- <APIPage document="2026-02-19.preview.json" operations={[{"path":"/v1/merchants/{merchantId}/settlements/crypto/{id}","method":"put"}]} /> diff --git a/content/navigation.json b/content/navigation.json index e98033b..55b0634 100644 --- a/content/navigation.json +++ b/content/navigation.json @@ -357,110 +357,6 @@ ] } ] - }, - { - "group": "API Reference", - "pages": [ - "payments/api-reference/index", - "payments/api-reference/authentication", - "payments/api-reference/versioning", - { - "group": "2026-02-18 (Latest)", - "pages": [ - { - "group": "Gateway", - "pages": [ - "payments/api-reference/2026-02-18/get-v1-gateway-payment-id", - "payments/api-reference/2026-02-18/post-v1-gateway-payment-id-cancel", - "payments/api-reference/2026-02-18/post-v1-gateway-payment-id-confirm", - "payments/api-reference/2026-02-18/post-v1-gateway-payment-id-fetch", - "payments/api-reference/2026-02-18/post-v1-gateway-payment-id-options", - "payments/api-reference/2026-02-18/get-v1-gateway-payment-id-status" - ] - }, - { - "group": "Payments", - "pages": [ - "payments/api-reference/2026-02-18/post-v1-payments", - "payments/api-reference/2026-02-18/get-v1-payments", - "payments/api-reference/2026-02-18/get-v1-payments-id", - "payments/api-reference/2026-02-18/post-v1-payments-id-cancel", - "payments/api-reference/2026-02-18/get-v1-payments-id-status" - ] - }, - { - "group": "Refunds", - "pages": [ - "payments/api-reference/2026-02-18/post-v1-refunds" - ] - }, - { - "group": "Merchants", - "pages": [ - "payments/api-reference/2026-02-18/get-v1-merchants-payments", - "payments/api-reference/2026-02-18/post-v1-merchants", - "payments/api-reference/2026-02-18/get-v1-merchants", - "payments/api-reference/2026-02-18/get-v1-merchants-merchantid", - "payments/api-reference/2026-02-18/patch-v1-merchants-merchantid", - "payments/api-reference/2026-02-18/delete-v1-merchants-merchantid", - "payments/api-reference/2026-02-18/get-v1-merchants-merchantid-settlements", - "payments/api-reference/2026-02-18/post-v1-merchants-merchantid-settlements-crypto", - "payments/api-reference/2026-02-18/put-v1-merchants-merchantid-settlements-crypto-id", - "payments/api-reference/2026-02-18/delete-v1-merchants-merchantid-settlements-crypto-id", - "payments/api-reference/2026-02-18/get-v1-merchants-merchant-id-payments" - ] - } - ] - }, - { - "group": "2026-02-19.preview", - "pages": [ - { - "group": "Gateway", - "pages": [ - "payments/api-reference/2026-02-19.preview/get-v1-gateway-payment-id", - "payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-cancel", - "payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-confirm", - "payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-fetch", - "payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-options", - "payments/api-reference/2026-02-19.preview/get-v1-gateway-payment-id-status" - ] - }, - { - "group": "Payments", - "pages": [ - "payments/api-reference/2026-02-19.preview/post-v1-payments", - "payments/api-reference/2026-02-19.preview/get-v1-payments", - "payments/api-reference/2026-02-19.preview/get-v1-payments-id", - "payments/api-reference/2026-02-19.preview/post-v1-payments-id-cancel", - "payments/api-reference/2026-02-19.preview/get-v1-payments-id-status" - ] - }, - { - "group": "Refunds", - "pages": [ - "payments/api-reference/2026-02-19.preview/post-v1-refunds" - ] - }, - { - "group": "Merchants", - "pages": [ - "payments/api-reference/2026-02-19.preview/get-v1-merchants-payments", - "payments/api-reference/2026-02-19.preview/post-v1-merchants", - "payments/api-reference/2026-02-19.preview/get-v1-merchants", - "payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid", - "payments/api-reference/2026-02-19.preview/patch-v1-merchants-merchantid", - "payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid", - "payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid-settlements", - "payments/api-reference/2026-02-19.preview/post-v1-merchants-merchantid-settlements-crypto", - "payments/api-reference/2026-02-19.preview/put-v1-merchants-merchantid-settlements-crypto-id", - "payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid-settlements-crypto-id", - "payments/api-reference/2026-02-19.preview/get-v1-merchants-merchant-id-payments" - ] - } - ] - } - ] } ] }, @@ -560,6 +456,121 @@ ] } ] + }, + { + "tab": "API Reference", + "icon": "code", + "align": "end", + "versions": [ + { + "version": "2026-02-18", + "tag": "Latest", + "default": true, + "pages": [ + "payments/api-reference/index", + "payments/api-reference/authentication", + "payments/api-reference/versioning" + ], + "groups": [ + { + "group": "Gateway", + "pages": [ + "payments/api-reference/2026-02-18/get-v1-gateway-payment-id", + "payments/api-reference/2026-02-18/post-v1-gateway-payment-id-cancel", + "payments/api-reference/2026-02-18/post-v1-gateway-payment-id-confirm", + "payments/api-reference/2026-02-18/post-v1-gateway-payment-id-fetch", + "payments/api-reference/2026-02-18/post-v1-gateway-payment-id-options", + "payments/api-reference/2026-02-18/get-v1-gateway-payment-id-status" + ] + }, + { + "group": "Payments", + "pages": [ + "payments/api-reference/2026-02-18/post-v1-payments", + "payments/api-reference/2026-02-18/get-v1-payments", + "payments/api-reference/2026-02-18/get-v1-payments-id", + "payments/api-reference/2026-02-18/post-v1-payments-id-cancel", + "payments/api-reference/2026-02-18/get-v1-payments-id-status" + ] + }, + { + "group": "Refunds", + "pages": [ + "payments/api-reference/2026-02-18/post-v1-refunds" + ] + }, + { + "group": "Merchants", + "pages": [ + "payments/api-reference/2026-02-18/get-v1-merchants-payments", + "payments/api-reference/2026-02-18/post-v1-merchants", + "payments/api-reference/2026-02-18/get-v1-merchants", + "payments/api-reference/2026-02-18/get-v1-merchants-merchantid", + "payments/api-reference/2026-02-18/patch-v1-merchants-merchantid", + "payments/api-reference/2026-02-18/delete-v1-merchants-merchantid", + "payments/api-reference/2026-02-18/get-v1-merchants-merchantid-settlements", + "payments/api-reference/2026-02-18/post-v1-merchants-merchantid-settlements-crypto", + "payments/api-reference/2026-02-18/put-v1-merchants-merchantid-settlements-crypto-id", + "payments/api-reference/2026-02-18/delete-v1-merchants-merchantid-settlements-crypto-id", + "payments/api-reference/2026-02-18/get-v1-merchants-merchant-id-payments" + ] + } + ] + }, + { + "version": "2026-02-19.preview", + "pages": [ + "payments/api-reference/index", + "payments/api-reference/authentication", + "payments/api-reference/versioning" + ], + "groups": [ + { + "group": "Gateway", + "pages": [ + "payments/api-reference/2026-02-19.preview/get-v1-gateway-payment-id", + "payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-cancel", + "payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-confirm", + "payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-fetch", + "payments/api-reference/2026-02-19.preview/post-v1-gateway-payment-id-options", + "payments/api-reference/2026-02-19.preview/get-v1-gateway-payment-id-status" + ] + }, + { + "group": "Payments", + "pages": [ + "payments/api-reference/2026-02-19.preview/post-v1-payments", + "payments/api-reference/2026-02-19.preview/get-v1-payments", + "payments/api-reference/2026-02-19.preview/get-v1-payments-id", + "payments/api-reference/2026-02-19.preview/post-v1-payments-id-cancel", + "payments/api-reference/2026-02-19.preview/get-v1-payments-id-status" + ] + }, + { + "group": "Refunds", + "pages": [ + "payments/api-reference/2026-02-19.preview/post-v1-refunds" + ] + }, + { + "group": "Merchants", + "pages": [ + "payments/api-reference/2026-02-19.preview/get-v1-merchants-payments", + "payments/api-reference/2026-02-19.preview/post-v1-merchants", + "payments/api-reference/2026-02-19.preview/get-v1-merchants", + "payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid", + "payments/api-reference/2026-02-19.preview/patch-v1-merchants-merchantid", + "payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid", + "payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid-settlements", + "payments/api-reference/2026-02-19.preview/post-v1-merchants-merchantid-settlements-crypto", + "payments/api-reference/2026-02-19.preview/put-v1-merchants-merchantid-settlements-crypto-id", + "payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid-settlements-crypto-id", + "payments/api-reference/2026-02-19.preview/get-v1-merchants-merchant-id-payments" + ] + } + ] + } + ] } ], "global": { diff --git a/lib/navigation.tsx b/lib/navigation.tsx index 81cb947..e3466a2 100644 --- a/lib/navigation.tsx +++ b/lib/navigation.tsx @@ -39,6 +39,8 @@ interface NavTab extends NavContainer { tab: string; /** Keep the tab out of the navbar tab row; its pages still get a sidebar and a URL. */ hidden?: boolean; + /** `end` pushes the tab to the far right of the navbar tab row (API Reference). */ + align?: 'start' | 'end'; /** Replace global anchors with the same `anchor` label (others are appended) on this tab. */ anchors?: NavAnchor[]; dropdowns?: NavDropdown[]; @@ -51,8 +53,8 @@ export interface NavAnchor { icon?: string; } -/** Carries `hidden` and `anchors` on the page tree, so they can be read back from it. */ -export type TabFolder = PageTree.Folder & { hidden?: boolean; anchors?: NavAnchor[] }; +/** Carries `hidden`, `align` and `anchors` on the page tree, so they can be read back from it. */ +export type TabFolder = PageTree.Folder & { hidden?: boolean; align?: NavTab['align']; anchors?: NavAnchor[] }; let nextId = 0; const id = (prefix: string) => `${prefix}-${nextId++}`; @@ -61,6 +63,26 @@ function icon(name?: string) { return name ? <Icon icon={name} /> : undefined; } +// Mintlify's method pills in the API reference sidebar, in the colours fumadocs-openapi uses for +// methods on the page itself. `self-start` keeps the pill on the first line of a wrapped title. +const methodColors: Record<string, string> = { + GET: 'bg-green-500/10 text-green-600 dark:text-green-400', + POST: 'bg-blue-500/10 text-blue-600 dark:text-blue-400', + PUT: 'bg-yellow-500/10 text-yellow-600 dark:text-yellow-400', + PATCH: 'bg-orange-500/10 text-orange-600 dark:text-orange-400', + DELETE: 'bg-red-500/10 text-red-600 dark:text-red-400', +}; + +function methodBadge(method: string) { + return ( + <span + className={`mt-0.5 w-11 shrink-0 self-start rounded-md py-0.5 text-center font-mono font-semibold text-[0.625rem] leading-4 ${methodColors[method] ?? 'bg-fd-muted text-fd-muted-foreground'}`} + > + {method === 'DELETE' ? 'DEL' : method} + </span> + ); +} + function pageNode(path: string): PageTree.Item | undefined { const slugs = path === 'index' ? [] : path.replace(/\/index$/, '').split('/'); const page = source.getPage(slugs); @@ -72,6 +94,7 @@ function pageNode(path: string): PageTree.Item | undefined { $id: page.url, type: 'page', name: page.data.sidebarTitle ?? page.data.title, + icon: page.data._openapi && methodBadge(page.data._openapi.method), url: page.url, $ref: page.path, }; @@ -127,7 +150,7 @@ function buildTab(tab: NavTab): PageTree.Folder { type: 'folder', root: 'version', name: v.tag ? `${v.version} (${v.tag})` : v.version, - description: v.description ?? `API version ${v.version}`, + description: v.description, icon: icon(v.icon ?? 'code-branch'), children: containerChildren(v), })); @@ -142,6 +165,7 @@ function buildTab(tab: NavTab): PageTree.Folder { name: tab.tab, icon: icon(tab.icon), hidden: tab.hidden, + align: tab.align, anchors: tab.anchors && mergeAnchors(getGlobalAnchors(), tab.anchors), children, } as TabFolder; @@ -213,26 +237,41 @@ function mergeAnchors(global: NavAnchor[], overrides: NavAnchor[]): NavAnchor[] return [...merged, ...overrides.filter((a) => !global.some((g) => g.anchor === a.anchor))]; } -function firstUrl(nodes: PageTree.Node[]): string | undefined { +function firstUrl(nodes: PageTree.Node[], skip?: Set<string>): string | undefined { for (const node of nodes) { - if (node.type === 'page' && !node.external) return node.url; + if (node.type === 'page' && !node.external && !skip?.has(node.url)) return node.url; if (node.type === 'folder') { - const url = node.index?.url ?? firstUrl(node.children); + const url = node.index && !skip?.has(node.index.url) ? node.index.url : firstUrl(node.children, skip); if (url) return url; } } } +function tabClassName(tab: TabFolder) { + if (tab.hidden) return { className: 'hidden' }; + if (tab.align === 'end') return { className: 'lg:ms-auto' }; +} + /** * Navbar tabs + dropdown options for every root folder. Fumadocs' `getLayoutTabs()` only * picks up root folders with a direct page child, which skips tabs made only of dropdowns. */ export function getNavigationTabs(tree = getNavigationTree()): LayoutTab[] { const tabs: LayoutTab[] = []; + // API versions all start with the same Overview pages, so a later version would link to the + // first version's page and the switcher could never select it. Each dropdown option links to + // the first page that an earlier option doesn't already claim. + const claimed = new Set<string>(); const visit = (nodes: PageTree.Node[]) => { for (const node of nodes) { if (node.type !== 'folder') continue; - const url = node.root ? (node.index?.url ?? firstUrl(node.children)) : undefined; + let url: string | undefined; + if (typeof node.root === 'string') { + url = firstUrl([node], claimed); + if (url) for (const u of collectUrls([node])) claimed.add(u); + } else if (node.root) { + url = node.index?.url ?? firstUrl(node.children); + } if (url) { tabs.push({ title: node.name, @@ -242,7 +281,8 @@ export function getNavigationTabs(tree = getNavigationTree()): LayoutTab[] { icon: node.icon ? <div className="size-full [&_svg]:size-full">{node.icon}</div> : undefined, // `hidden` tabs stay in the list so the tree still resolves them (and the mobile // switcher still labels the current one) — they just don't render in the tab row. - props: (node as TabFolder).hidden ? { className: 'hidden' } : undefined, + // `lg:` because the tab row only shows from `lg`; below it the tabs are a dropdown list. + props: tabClassName(node as TabFolder), }); } visit(node.children); diff --git a/lib/source.ts b/lib/source.ts index df0ef30..ebca1d2 100644 --- a/lib/source.ts +++ b/lib/source.ts @@ -19,6 +19,8 @@ const docs = defineDocs({ /** `frame` renders the page without title, TOC and page chrome (landing pages). */ mode: z.enum(['default', 'wide', 'frame', 'custom', 'center']).optional(), metatags: z.record(z.string(), z.string()).optional(), + /** Set on generated API reference pages; the sidebar shows the method as a badge. */ + _openapi: z.object({ method: z.string() }).optional(), }), mdxOptions: applyMdxPreset({ // ```mermaid code blocks → <Mermaid chart="..." /> diff --git a/public/images/api-reference-dark.svg b/public/images/api-reference-dark.svg new file mode 100644 index 0000000..5256d13 --- /dev/null +++ b/public/images/api-reference-dark.svg @@ -0,0 +1,21 @@ +<svg width="280" height="146" viewBox="0 0 280 146" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path d="M0 16C0 7.16344 7.16344 0 16 0H264C272.837 0 280 7.16344 280 16V130C280 138.837 272.837 146 264 146H16C7.16344 146 0 138.837 0 130V16Z" fill="#181817"/> +<g clip-path="url(#card)" stroke="#1F2228" stroke-dasharray="5 5"> +<path d="M-26.354 18.5H306.354"/> +<path d="M-26.354 45.5H306.354"/> +<path d="M-26.354 72.5H306.354"/> +<path d="M-26.354 99.5H306.354"/> +<path d="M-26.354 126.5H306.354"/> +<path d="M26.5 239V-93"/> +<path d="M83 239V-93"/> +<path d="M139.5 239V-93"/> +<path d="M196 239V-93"/> +<path d="M252.5 239V-93"/> +</g> +<path transform="translate(118 51) scale(0.17578125)" d="M71.68,97.22,34.74,128l36.94,30.78a12,12,0,1,1-15.36,18.44l-48-40a12,12,0,0,1,0-18.44l48-40A12,12,0,0,1,71.68,97.22Zm176,21.56-48-40a12,12,0,1,0-15.36,18.44L221.26,128l-36.94,30.78a12,12,0,1,0,15.36,18.44l48-40a12,12,0,0,0,0-18.44ZM164.1,28.72a12,12,0,0,0-15.38,7.18l-64,176a12,12,0,0,0,7.18,15.37A11.79,11.79,0,0,0,96,228a12,12,0,0,0,11.28-7.9l64-176A12,12,0,0,0,164.1,28.72Z" fill="white"/> +<defs> +<clipPath id="card"> +<path d="M0 16C0 7.16344 7.16344 0 16 0H264C272.837 0 280 7.16344 280 16V130C280 138.837 272.837 146 264 146H16C7.16344 146 0 138.837 0 130V16Z"/> +</clipPath> +</defs> +</svg> diff --git a/public/images/api-reference.svg b/public/images/api-reference.svg new file mode 100644 index 0000000..efc9115 --- /dev/null +++ b/public/images/api-reference.svg @@ -0,0 +1,21 @@ +<svg width="280" height="146" viewBox="0 0 280 146" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path d="M0 16C0 7.16344 7.16344 0 16 0H264C272.837 0 280 7.16344 280 16V130C280 138.837 272.837 146 264 146H16C7.16344 146 0 138.837 0 130V16Z" fill="#F7F7F8"/> +<g clip-path="url(#card)" stroke="#E9EAEC" stroke-dasharray="5 5"> +<path d="M-26.354 18.5H306.354"/> +<path d="M-26.354 45.5H306.354"/> +<path d="M-26.354 72.5H306.354"/> +<path d="M-26.354 99.5H306.354"/> +<path d="M-26.354 126.5H306.354"/> +<path d="M26.5 239V-93"/> +<path d="M83 239V-93"/> +<path d="M139.5 239V-93"/> +<path d="M196 239V-93"/> +<path d="M252.5 239V-93"/> +</g> +<path transform="translate(118 51) scale(0.17578125)" d="M71.68,97.22,34.74,128l36.94,30.78a12,12,0,1,1-15.36,18.44l-48-40a12,12,0,0,1,0-18.44l48-40A12,12,0,0,1,71.68,97.22Zm176,21.56-48-40a12,12,0,1,0-15.36,18.44L221.26,128l-36.94,30.78a12,12,0,1,0,15.36,18.44l48-40a12,12,0,0,0,0-18.44ZM164.1,28.72a12,12,0,0,0-15.38,7.18l-64,176a12,12,0,0,0,7.18,15.37A11.79,11.79,0,0,0,96,228a12,12,0,0,0,11.28-7.9l64-176A12,12,0,0,0,164.1,28.72Z" fill="#202020"/> +<defs> +<clipPath id="card"> +<path d="M0 16C0 7.16344 7.16344 0 16 0H264C272.837 0 280 7.16344 280 16V130C280 138.837 272.837 146 264 146H16C7.16344 146 0 138.837 0 130V16Z"/> +</clipPath> +</defs> +</svg> diff --git a/public/images/wallet-verification-dark.svg b/public/images/wallet-verification-dark.svg new file mode 100644 index 0000000..941cf54 --- /dev/null +++ b/public/images/wallet-verification-dark.svg @@ -0,0 +1,21 @@ +<svg width="280" height="146" viewBox="0 0 280 146" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path d="M0 16C0 7.16344 7.16344 0 16 0H264C272.837 0 280 7.16344 280 16V130C280 138.837 272.837 146 264 146H16C7.16344 146 0 138.837 0 130V16Z" fill="#181817"/> +<g clip-path="url(#card)" stroke="#1F2228" stroke-dasharray="5 5"> +<path d="M-26.354 18.5H306.354"/> +<path d="M-26.354 45.5H306.354"/> +<path d="M-26.354 72.5H306.354"/> +<path d="M-26.354 99.5H306.354"/> +<path d="M-26.354 126.5H306.354"/> +<path d="M26.5 239V-93"/> +<path d="M83 239V-93"/> +<path d="M139.5 239V-93"/> +<path d="M196 239V-93"/> +<path d="M252.5 239V-93"/> +</g> +<path transform="translate(118 51) scale(0.17578125)" d="M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.26,47,25.53a8,8,0,0,0,4.2,0c1-.27,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40Zm-34.32,69.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z" fill="white"/> +<defs> +<clipPath id="card"> +<path d="M0 16C0 7.16344 7.16344 0 16 0H264C272.837 0 280 7.16344 280 16V130C280 138.837 272.837 146 264 146H16C7.16344 146 0 138.837 0 130V16Z"/> +</clipPath> +</defs> +</svg> diff --git a/public/images/wallet-verification.svg b/public/images/wallet-verification.svg new file mode 100644 index 0000000..85e90c8 --- /dev/null +++ b/public/images/wallet-verification.svg @@ -0,0 +1,21 @@ +<svg width="280" height="146" viewBox="0 0 280 146" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path d="M0 16C0 7.16344 7.16344 0 16 0H264C272.837 0 280 7.16344 280 16V130C280 138.837 272.837 146 264 146H16C7.16344 146 0 138.837 0 130V16Z" fill="#F7F7F8"/> +<g clip-path="url(#card)" stroke="#E9EAEC" stroke-dasharray="5 5"> +<path d="M-26.354 18.5H306.354"/> +<path d="M-26.354 45.5H306.354"/> +<path d="M-26.354 72.5H306.354"/> +<path d="M-26.354 99.5H306.354"/> +<path d="M-26.354 126.5H306.354"/> +<path d="M26.5 239V-93"/> +<path d="M83 239V-93"/> +<path d="M139.5 239V-93"/> +<path d="M196 239V-93"/> +<path d="M252.5 239V-93"/> +</g> +<path transform="translate(118 51) scale(0.17578125)" d="M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.26,47,25.53a8,8,0,0,0,4.2,0c1-.27,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40Zm-34.32,69.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z" fill="#202020"/> +<defs> +<clipPath id="card"> +<path d="M0 16C0 7.16344 7.16344 0 16 0H264C272.837 0 280 7.16344 280 16V130C280 138.837 272.837 146 264 146H16C7.16344 146 0 138.837 0 130V16Z"/> +</clipPath> +</defs> +</svg> diff --git a/scripts/generate-specs.mjs b/scripts/generate-specs.mjs index ecb08a7..5563b7e 100644 --- a/scripts/generate-specs.mjs +++ b/scripts/generate-specs.mjs @@ -1,6 +1,6 @@ // Fetches the WalletConnect Pay OpenAPI specs for every published API version, writes them to // openapi/, generates one page per operation under content/docs/payments/api-reference/<version>/ -// and updates the API Reference group (Payments tab → Get Started) in content/navigation.json +// and updates the API Reference tab in content/navigation.json // + the "latest" redirect. import { mkdir, readdir, readFile, rm, writeFile } from 'node:fs/promises'; import { dirname, join } from 'node:path'; @@ -114,7 +114,9 @@ async function generatePages(version, spec) { expectedFiles.add(filename); const title = (op.summary || `${method} ${path}`).replace(/["\\]/g, '\\$&'); const operations = JSON.stringify([{ path, method: method.toLowerCase() }]); - const mdx = `---\ntitle: "${title}"\n---\n\n<APIPage document="${version}.json" operations={${operations}} />\n`; + // `_openapi.method` is the frontmatter fumadocs-openapi uses; lib/navigation.tsx reads it + // to put a method badge next to the page in the sidebar. + const mdx = `---\ntitle: "${title}"\n_openapi:\n method: ${method}\n---\n\n<APIPage document="${version}.json" operations={${operations}} />\n`; writes.push(writeFile(join(dir, filename), mdx)); pages.push(`payments/api-reference/${version}/${slug}`); } @@ -143,45 +145,41 @@ async function generateSpec(version) { return { version, spec: merged }; } -// The API reference lives at the bottom of the Payments tab's "Get Started" section: the shared -// overview pages first, then one collapsible group per API version (newest stable first). -const API_REFERENCE_GROUP = 'API Reference'; +// The API reference is a navbar tab of its own, with one version per entry (newest stable first, +// the default) switched from the dropdown at the top of the sidebar. Each version lists the +// shared overview pages first, with no section heading, then one sidebar section per endpoint group. +const API_REFERENCE_TAB = 'API Reference'; async function buildNavigation(currentNavigation, stableVersions, previewVersions, versionSpecs) { - const makeVersionGroup = async (version, tag) => { + const makeVersion = async (version, { tag, isDefault } = {}) => { const spec = versionSpecs.get(version); const groups = await generatePages(version, spec); console.log(`Generated ${groups.reduce((n, g) => n + g.pages.length, 0)} pages for ${version}`); - return { group: tag ? `${version} (${tag})` : version, pages: groups }; + return { + version, + ...(tag && { tag }), + ...(isDefault && { default: true }), + pages: [ + 'payments/api-reference/index', + 'payments/api-reference/authentication', + 'payments/api-reference/versioning', + ], + groups, + }; }; - const versionGroups = await Promise.all([ - ...stableVersions.map((v, i) => makeVersionGroup(v, i === 0 ? 'Latest' : undefined)), - ...previewVersions.map((v) => makeVersionGroup(v, 'Preview')), + // Preview versions already end in `.preview`, so only the latest stable one gets a tag. + const versions = await Promise.all([ + ...stableVersions.map((v, i) => makeVersion(v, i === 0 ? { tag: 'Latest', isDefault: true } : {})), + ...previewVersions.map((v) => makeVersion(v)), ]); - const apiReferenceGroup = { - group: API_REFERENCE_GROUP, - pages: [ - 'payments/api-reference/index', - 'payments/api-reference/authentication', - 'payments/api-reference/versioning', - ...versionGroups, - ], - }; - - const isApiReference = (page) => typeof page === 'object' && page.group === API_REFERENCE_GROUP; - const tabs = currentNavigation.tabs - .filter((t) => t.tab !== API_REFERENCE_GROUP) - .map((t) => { - if (t.tab !== 'Payments') return t; - const groups = t.groups.map((g) => - g.group === 'Get Started' - ? { ...g, pages: [...g.pages.filter((p) => !isApiReference(p)), apiReferenceGroup] } - : g, - ); - return { ...t, groups }; - }); + // Keeps any other settings on an existing tab (`align`). + const existing = currentNavigation.tabs.find((t) => t.tab === API_REFERENCE_TAB); + const apiReferenceTab = { tab: API_REFERENCE_TAB, icon: 'code', align: 'end', ...existing, versions }; + const tabs = existing + ? currentNavigation.tabs.map((t) => (t === existing ? apiReferenceTab : t)) + : [...currentNavigation.tabs, apiReferenceTab]; return { ...currentNavigation, tabs }; }