Skip to content

docs: Add merchant, refund and list-payments endpoints to Pay API reference - #183

Open
rtomas wants to merge 1 commit into
mainfrom
rtomas/pay-api-single
Open

rtomas wants to merge 1 commit into
mainfrom
rtomas/pay-api-single

Conversation

@rtomas

@rtomas rtomas commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

  • The API reference only listed the Core API (https://api.pay.walletconnect.com). scripts/generate-specs.mjs skipped the merchant service (api.merchant.pay.walletconnect.com) on purpose.
  • Merchant endpoints like /v1/merchants and /v1/refunds were missing from the docs, even though integrators can call them.
  • Integrators only ever call https://api.pay.walletconnect.com. The API gateway forwards some routes to the merchant API, so there's no need to block the merchant spec, only to filter it down to what the gateway forwards.

How the endpoints appear in the merchant spec

  • The merchant spec (api.merchant.pay.walletconnect.com/spec/<version>/openapi.json) lists these routes, which are forwarded and now documented:
    • GET /v1/payments
    • POST /v1/refunds
    • GET /v1/merchants/payments
    • POST /v1/merchants/payments/{paymentId}/receipt
    • GET / POST /v1/merchants
    • GET / PATCH / DELETE /v1/merchants/{merchantId}
    • GET /v1/merchants/{merchantId}/settlements and /settlements/tokens
    • POST /v1/merchants/{merchantId}/settlements/crypto, plus PUT / DELETE /v1/merchants/{merchantId}/settlements/crypto/{id}
    • POST /v1/merchants/{merchantId}/settlements/fiat, plus PATCH / DELETE /v1/merchants/{merchantId}/settlements/fiat/{id}
  • It also lists routes the gateway doesn't forward. These stay out of the docs:
    • /v1/sign/{token}/*
    • /v1/payouts*, /v1/payout-accounts and /v1/screenings (preview only)
  • Merchant operations have no security of their own. They inherit the spec-level apiKey scheme (Api-Key header).
  • The merchant and Core specs share no schema names, so merging them overwrites nothing.

How we show them

  • Every operation, Core and merchant, is documented under the single server https://api.pay.walletconnect.com. The merchant host never appears in the docs.
  • GET /v1/payments sits in the existing Payments group, next to Core's POST /v1/payments.
  • New sidebar groups: Refunds (1 page) and Merchants (15 pages).
  • Each version (2026-02-18, 2026-02-19.preview) goes from 16 to 33 pages.

Changes

  • scripts/generate-specs.mjs: fetch the merchant spec and keep only the forwarded routes, using an isForwarded filter per service.
  • scripts/generate-specs.mjs: copy each spec's top-level security onto its operations, because only the first spec's top-level security survives the merge.
  • scripts/generate-specs.mjs: drop tags used only by excluded routes.
  • scripts/generate-specs.mjs: fail if the same method and path appear in more than one spec, instead of letting the last one silently win.
  • Regenerated openapi/*.json, the API reference pages under content/docs/payments/api-reference/<version>/ and the API Reference tab in content/navigation.json with pnpm generate.
  • AGENTS.md: API Reference pages generated by pnpm generate no longer need rtomas and Jem-reown as reviewers.
  • pnpm build and pnpm lint pass.

…reference

- Merge the merchant service spec into the generated Core spec, keeping
  only routes the API gateway forwards (merchants, refunds, GET payments)
- Preserve each operation's own security, since only the first spec's
  top-level security survives the merge
- Skip tags from the filtered merchant spec and fail on duplicate
  method/path pairs across specs
- Regenerate specs for 2026-02-18 and 2026-02-19.preview with new pages
  and Refunds and Merchants sidebar groups
- Exempt generated API Reference pages from the reviewer rule in AGENTS.md
@github-actions

Copy link
Copy Markdown
Contributor

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant