From 342f9cfee7ec1d25bd6b669546eb071cf5d988cd Mon Sep 17 00:00:00 2001 From: Tom Ra Date: Fri, 20 Nov 2026 14:57:15 -0300 Subject: [PATCH] Add List payments (GET /v1/payments) to the API reference - Document the list payments endpoint for 2026-02-18 and 2026-02-19.preview, with generated pages and sidebar entries under Payments. - Keep the operation definition in scripts/payments-list-operation.json, since the Core spec doesn't describe it yet, so pnpm generate keeps it. - Merge it after the Core spec in generate-specs.mjs. The script fails if a version has no entry, warns once Core includes the operation, and errors on schema conflicts. - The preview version adds the `cancelled` status. - Regenerated specs also refresh the example payment IDs. --- .../2026-02-18/get-v1-payments.mdx | 7 + .../2026-02-19.preview/get-v1-payments.mdx | 7 + content/navigation.json | 2 + openapi/2026-02-18.json | 936 +++++++++- openapi/2026-02-19.preview.json | 938 +++++++++- scripts/generate-specs.mjs | 47 +- scripts/payments-list-operation.json | 1630 +++++++++++++++++ 7 files changed, 3555 insertions(+), 12 deletions(-) create mode 100644 content/docs/payments/api-reference/2026-02-18/get-v1-payments.mdx create mode 100644 content/docs/payments/api-reference/2026-02-19.preview/get-v1-payments.mdx create mode 100644 scripts/payments-list-operation.json 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 new file mode 100644 index 00000000..816857af --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-18/get-v1-payments.mdx @@ -0,0 +1,7 @@ +--- +title: "List payments" +_openapi: + 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 new file mode 100644 index 00000000..99a91285 --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-payments.mdx @@ -0,0 +1,7 @@ +--- +title: "List payments" +_openapi: + method: GET +--- + + diff --git a/content/navigation.json b/content/navigation.json index 8c1786d6..53a7ae74 100644 --- a/content/navigation.json +++ b/content/navigation.json @@ -521,6 +521,7 @@ "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", @@ -562,6 +563,7 @@ "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", diff --git a/openapi/2026-02-18.json b/openapi/2026-02-18.json index 2fd9b5c3..542dbbf8 100644 --- a/openapi/2026-02-18.json +++ b/openapi/2026-02-18.json @@ -1277,6 +1277,496 @@ } } } + }, + "get": { + "operationId": "PartnerPayments_list", + "parameters": [ + { + "name": "WCP-Version", + "in": "header", + "required": false, + "description": "Optional WalletConnect Pay API version override. If omitted, the partner's pinned version is used.", + "schema": { + "type": "string", + "examples": [ + "2026-02-18", + "2026-02-19.preview" + ] + } + }, + { + "in": "query", + "name": "startTs", + "schema": { + "examples": [ + "2026-01-06T00:00:00Z" + ], + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "description": "RFC3339 timestamp, inclusive" + }, + { + "in": "query", + "name": "endTs", + "schema": { + "examples": [ + "2026-01-07T00:00:00Z" + ], + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "description": "RFC3339 timestamp, exclusive" + }, + { + "in": "query", + "name": "token_symbol", + "schema": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "description": "Filter by token symbol (e.g. `USDC`). CAIP-19 identifiers are not supported. Accepts a single value or multiple repeated params:\n\n- Single: `?token_symbol=USDC`\n- Multiple: `?token_symbol=USDC&token_symbol=EURC`" + }, + { + "in": "query", + "name": "network", + "schema": { + "examples": [ + "eip155:8453", + "eip155:8453,eip155:1" + ], + "type": "string" + }, + "description": "Filter by [CAIP-2](https://standards.chainagnostic.org/CAIPs/caip-2) chain ID. Comma-separated for multiple." + }, + { + "in": "query", + "name": "sortBy", + "schema": { + "type": "string", + "enum": [ + "date", + "amount" + ] + }, + "description": "Field to sort by" + }, + { + "in": "query", + "name": "sortDir", + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ] + }, + "description": "Sort direction" + }, + { + "in": "query", + "name": "cursor", + "schema": { + "type": "string" + }, + "description": "Opaque pagination cursor — use the value from `nextCursor` in the previous response." + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 200 + }, + "description": "Page size (default 50, max 200)" + }, + { + "in": "query", + "name": "status", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "requires_action", + "processing", + "succeeded", + "failed", + "expired" + ] + } + }, + "description": "Filter by payment status. Accepts a single value or multiple repeated params:\n\n- Single: `?status=succeeded`\n- Multiple: `?status=succeeded&status=processing`" + }, + { + "in": "query", + "name": "referenceId", + "schema": { + "type": "string", + "minLength": 3, + "maxLength": 35, + "pattern": "^[A-Za-z0-9 /:.,+-]+$", + "examples": [ + "order-42" + ] + }, + "description": "Substring search on the merchant-provided reference ID. Between 3 and 35 characters. Allowed characters: ASCII letters, digits, and ` /-:.,+`." + }, + { + "in": "query", + "name": "merchantId", + "schema": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "examples": [ + [ + "acme-store-1" + ], + [ + "acme-store-1", + "widget_co" + ] + ] + }, + "description": "Filter by merchant ID. Accepts a single value or multiple repeated params:\n\n- Single: `?merchantId=acme-store-1`\n- Multiple: `?merchantId=acme-store-1&merchantId=widget_co`" + } + ], + "responses": { + "200": { + "description": "Payments with statistics", + "headers": { + "WCP-Version": { + "description": "WalletConnect Pay API version resolved for this request.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MerchantPaymentsResponse" + }, + "example": { + "data": [ + { + "paymentId": "pay_a1a2ecc101KGF210FP7PN3BK08PZARS1CZ", + "merchant": { + "id": "acme-store-1", + "name": "Acme Store", + "iconUrl": "https://imagedelivery.net/example/icon.png" + }, + "referenceId": "a1b2cad4e5f2783012345678axcdea90", + "status": "succeeded", + "isTerminal": true, + "paymentUrl": "https://pay.walletconnect.com/?pid=pay_a1a2ecc101KGF210FP7PN3BK08PZARS1CZ", + "fiatAmount": { + "unit": "iso4217/USD", + "value": "500", + "display": { + "assetSymbol": "USD", + "assetName": "US Dollar", + "decimals": 2 + } + }, + "tokenAmount": { + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "5000000", + "display": { + "assetSymbol": "USDC", + "assetName": "USD Coin", + "decimals": 6, + "networkName": "Base", + "iconUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md", + "networkIconUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + }, + "buyer": { + "accountCaip10": "eip155:8453:0x0000000000000000000000000000000000000000", + "accountProviderName": "MetaMask", + "accountProviderIcon": "https://api.walletconnect.com/assets/v1/image/wallet/metamask/md" + }, + "transaction": { + "networkId": "8453", + "hash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "settlement": { + "amount": { + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "4840000", + "display": { + "assetSymbol": "USDC", + "assetName": "USD Coin", + "decimals": 6, + "iconUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md", + "networkName": "Base", + "networkIconUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + }, + "settled": true, + "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "fees": { + "total": { + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "160000", + "display": { + "assetSymbol": "USDC", + "assetName": "USD Coin", + "decimals": 6, + "iconUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md", + "networkName": "Base", + "networkIconUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + }, + "fixed": { + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "140000", + "display": { + "assetSymbol": "USDC", + "assetName": "USD Coin", + "decimals": 6, + "iconUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md", + "networkName": "Base", + "networkIconUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + }, + "percentage": "0.4" + }, + "refund": { + "status": "fully_refunded", + "fullyRefundedAt": "2024-01-02T08:30:00.000Z" + }, + "createdAt": "2024-01-01T12:00:00.000Z", + "expiresAt": "2024-01-01T12:15:00.000Z", + "lastUpdatedAt": "2024-01-01T12:00:00.000Z", + "settledAt": "2024-01-01T12:00:00.000Z" + } + ], + "nextCursor": null, + "stats": { + "totalRevenue": [ + { + "amount": 1000, + "currency": "USD" + } + ], + "totalTransactions": 100, + "totalCustomers": 25 + } + } + } + } + }, + "400": { + "description": "Bad request — invalid parameters or API version", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "invalid_params", + "params_validation", + "invalid_api_version", + "unknown_api_version", + "api_version_downgrade" + ], + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "issues": { + "description": "Field-level validation issues (present on validation errors)", + "type": "array", + "items": { + "type": "object", + "properties": { + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "field", + "message" + ] + } + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + }, + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "invalid_api_version": { + "summary": "Invalid API version", + "value": { + "code": "invalid_api_version", + "message": "Invalid API version" + } + }, + "unknown_api_version": { + "summary": "Unknown API version", + "value": { + "code": "unknown_api_version", + "message": "Unknown API version" + } + }, + "api_version_downgrade": { + "summary": "Requested API version is older than the partner pin", + "value": { + "code": "api_version_downgrade", + "message": "Requested API version is older than the partner pin" + } + } + } + } + } + }, + "401": { + "description": "Unauthorized — missing or invalid partner API key", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "missing_api_key", + "invalid_api_key" + ], + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "missing_api_key": { + "summary": "Missing API key", + "value": { + "code": "missing_api_key", + "message": "Missing API key" + } + }, + "invalid_api_key": { + "summary": "Invalid API key", + "value": { + "code": "invalid_api_key", + "message": "Invalid API key" + } + } + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "internal_error", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "internal_error": { + "summary": "Internal Server Error", + "value": { + "code": "internal_error", + "message": "Internal Server Error" + } + } + } + } + } + } + }, + "tags": [ + "Payments" + ], + "summary": "List payments", + "description": "Retrieve paginated payments with optional filters.", + "security": [ + { + "API Key": [] + } + ] } }, "/v1/payments/{id}": { @@ -2667,7 +3157,7 @@ "expiresAt": 1718236800, "gatewayUrl": "https://api.pay.walletconnect.com/pay_123", "isFinal": false, - "paymentId": "pay_23a2ecc101M7W4JSEM0EW14VJJTN3H1DW6", + "paymentId": "pay_78a2ecc101M7WG10HBZEA7GEKBQAYVY39R", "pollInMs": 1000, "status": "requires_action" } @@ -2814,7 +3304,7 @@ "example": { "cancelledAt": "2025-01-14T10:30:00Z", "cancelledReason": "cancelled_by_user", - "paymentId": "pay_34a2ecc101M7W4JSEP1H78P1HT49GMNMTT", + "paymentId": "pay_8ba2ecc101M7WG10HDS0VAKCFANFZ6TKXD", "status": "cancelled" } }, @@ -3714,7 +4204,7 @@ "example": { "cancelledAt": "2025-01-14T10:30:00Z", "cancelledReason": "cancelled_by_merchant", - "paymentId": "pay_88a2ecc101M7W4JSEMEY9C69PYKACFTAXB", + "paymentId": "pay_eda2ecc101M7WG10HC6HE6NF47W5XY9JSG", "status": "cancelled" } }, @@ -4259,6 +4749,446 @@ "{\"domain\":{\"name\":\"USD Coin\",\"version\":\"2\",\"chainId\":\"0x2105\",\"verifyingContract\":\"0x0000000000000000000000000000000000000000\"},\"types\":{\"EIP712Domain\":[{\"type\":\"string\",\"name\":\"name\"},{\"type\":\"string\",\"name\":\"version\"},{\"type\":\"uint256\",\"name\":\"chainId\"},{\"type\":\"address\",\"name\":\"verifyingContract\"}],\"ReceiveWithAuthorization\":[{\"type\":\"address\",\"name\":\"from\"},{\"type\":\"address\",\"name\":\"to\"},{\"type\":\"uint256\",\"name\":\"value\"},{\"type\":\"uint256\",\"name\":\"validAfter\"},{\"type\":\"uint256\",\"name\":\"validBefore\"},{\"type\":\"bytes32\",\"name\":\"nonce\"}]},\"primaryType\":\"ReceiveWithAuthorization\",\"message\":{\"from\":\"0x0000000000000000000000000000000000000000\",\"nonce\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"to\":\"0x0000000000000000000000000000000000000000\",\"validAfter\":\"0x0\",\"validBefore\":\"0x0\",\"value\":\"0x0\"}}" ] } + }, + "MerchantPaymentsResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "paymentId": { + "type": "string", + "description": "Unique payment identifier" + }, + "merchant": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Partner-provided merchant ID" + }, + "name": { + "description": "Merchant display name", + "type": "string" + }, + "iconUrl": { + "description": "Merchant logo URL", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id" + ] + }, + "referenceId": { + "type": "string", + "description": "Idempotency / reference ID provided at payment creation" + }, + "status": { + "type": "string", + "enum": [ + "requires_action", + "processing", + "succeeded", + "failed", + "expired" + ] + }, + "isTerminal": { + "type": "boolean", + "description": "Whether the payment has reached a final state" + }, + "fiatAmount": { + "$ref": "#/components/schemas/MerchantPaymentFiatAmount" + }, + "tokenAmount": { + "$ref": "#/components/schemas/MerchantPaymentTokenAmount" + }, + "buyer": { + "description": "Buyer wallet information", + "type": "object", + "properties": { + "accountCaip10": { + "type": "string", + "description": "Buyer address as a [CAIP-10](https://standards.chainagnostic.org/CAIPs/caip-10) account ID", + "examples": [ + "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + ] + }, + "accountProviderName": { + "description": "Wallet provider name", + "examples": [ + "MetaMask" + ], + "type": "string" + }, + "accountProviderIcon": { + "description": "Wallet provider logo URL", + "type": "string" + } + }, + "required": [ + "accountCaip10" + ] + }, + "transaction": { + "description": "On-chain transaction details", + "type": "object", + "properties": { + "networkId": { + "type": "string", + "description": "Numeric chain ID", + "examples": [ + "8453" + ] + }, + "hash": { + "description": "On-chain transaction hash", + "type": "string" + } + }, + "required": [ + "networkId" + ] + }, + "fees": { + "description": "Fee breakdown derived from payment option data. Omitted when total fee data is unavailable.", + "type": "object", + "properties": { + "total": { + "anyOf": [ + { + "$ref": "#/components/schemas/MerchantPaymentFiatAmount" + }, + { + "$ref": "#/components/schemas/MerchantPaymentTokenAmount" + } + ], + "description": "Total fee amount." + }, + "fixed": { + "description": "Fixed fee component.", + "anyOf": [ + { + "$ref": "#/components/schemas/MerchantPaymentFiatAmount" + }, + { + "$ref": "#/components/schemas/MerchantPaymentTokenAmount" + } + ] + }, + "percentage": { + "description": "Percentage fee component as a decimal percentage string, not a ratio. For example, \"0.4\" means 0.4%.", + "type": "string" + } + }, + "required": [ + "total" + ] + }, + "settlement": { + "$ref": "#/components/schemas/MerchantPaymentSettlement" + }, + "exchangeRate": { + "$ref": "#/components/schemas/MerchantPaymentExchangeRate" + }, + "refund": { + "$ref": "#/components/schemas/MerchantPaymentRefund" + }, + "paymentUrl": { + "description": "Hosted payment page URL for this payment. The hosted page reflects the payment's current state.", + "type": "string", + "format": "uri" + }, + "createdAt": { + "type": "string", + "description": "ISO 8601 timestamp" + }, + "expiresAt": { + "description": "ISO 8601 timestamp of the payment deadline, present only when the payment has an expiration", + "type": "string" + }, + "lastUpdatedAt": { + "type": "string", + "description": "ISO 8601 timestamp" + }, + "settledAt": { + "description": "ISO 8601 timestamp, present only when `settlement.settled` is `true` and a timestamp is available", + "type": "string" + } + }, + "required": [ + "paymentId", + "merchant", + "referenceId", + "status", + "isTerminal", + "createdAt", + "lastUpdatedAt" + ] + } + }, + "nextCursor": { + "description": "Cursor for the next page, or null if no more results", + "type": [ + "string", + "null" + ] + }, + "stats": { + "type": "object", + "properties": { + "totalRevenue": { + "type": "array", + "items": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "description": "Revenue amount in currency's standard unit" + }, + "currency": { + "type": "string", + "description": "ISO 4217 currency code", + "examples": [ + "USD" + ] + } + }, + "required": [ + "amount", + "currency" + ] + }, + "description": "Total revenue over succeeded payments, converted to USD. Always exactly one element — a merchant with no volume gets a zero rather than an empty array. Kept as an array for backwards compatibility." + }, + "totalTransactions": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "description": "Total payments matching the query" + }, + "totalCustomers": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "description": "Unique buyers matching the query" + } + }, + "required": [ + "totalRevenue", + "totalTransactions", + "totalCustomers" + ], + "description": "Aggregate statistics for the query" + } + }, + "required": [ + "data", + "nextCursor", + "stats" + ] + }, + "MerchantPaymentFiatAmount": { + "type": "object", + "properties": { + "unit": { + "type": "string", + "pattern": "^iso4217\\/", + "description": "Fiat unit, for example \"iso4217/USD\"" + }, + "value": { + "type": "string", + "description": "Amount in minor units for the fiat currency" + }, + "display": { + "type": "object", + "properties": { + "assetSymbol": { + "type": "string" + }, + "assetName": { + "type": "string" + }, + "decimals": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + } + }, + "required": [ + "assetSymbol", + "assetName", + "decimals" + ], + "description": "Display metadata for fiat-denominated amounts" + } + }, + "required": [ + "unit", + "value", + "display" + ], + "description": "Fiat-denominated amount" + }, + "MerchantPaymentTokenAmount": { + "type": "object", + "properties": { + "unit": { + "type": "string", + "pattern": "^caip19\\/", + "description": "Token unit, for example \"caip19/...\"" + }, + "value": { + "type": "string", + "description": "Amount in minor units for the token asset" + }, + "display": { + "anyOf": [ + { + "type": "object", + "properties": { + "assetSymbol": { + "type": "string" + }, + "assetName": { + "type": "string" + }, + "decimals": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "iconUrl": { + "type": "string" + }, + "networkName": { + "type": "string" + }, + "networkIconUrl": { + "type": "string" + } + }, + "required": [ + "assetSymbol", + "assetName", + "decimals" + ], + "description": "Display metadata for token-denominated amounts" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "unit", + "value", + "display" + ], + "description": "Token-denominated amount" + }, + "MerchantPaymentSettlement": { + "description": "Settlement details. Omitted when settlement details cannot be reported yet. When present, `settled` is always included. When `settled` is `false`, no additional settlement fields are returned. When `settled` is `true`, `amount` is included and `txHash` is included when available.", + "type": "object", + "properties": { + "settled": { + "type": "boolean", + "description": "Whether settlement is complete." + }, + "amount": { + "description": "Net settlement amount after fees in the settlement unit. Present when `settled` is `true`.", + "anyOf": [ + { + "$ref": "#/components/schemas/MerchantPaymentFiatAmount" + }, + { + "$ref": "#/components/schemas/MerchantPaymentTokenAmount" + } + ] + }, + "txHash": { + "description": "Settlement transaction hash. Present when `settled` is `true` and an upstream settlement transaction hash is available.", + "type": "string" + } + }, + "required": [ + "settled" + ] + }, + "MerchantPaymentExchangeRate": { + "type": "object", + "properties": { + "from": { + "type": "string", + "description": "Unit the payment was priced in", + "examples": [ + "iso4217/EUR" + ] + }, + "fromSymbol": { + "type": "string", + "description": "Display symbol for `from`", + "examples": [ + "EUR" + ] + }, + "to": { + "type": "string", + "description": "Unit the payment settles in", + "examples": [ + "caip19/eip155:8453/erc20:0x833589fcd6edb6e08f4c7c32d4f71b54bda02913" + ] + }, + "toSymbol": { + "type": "string", + "description": "Display symbol for `to`", + "examples": [ + "USDC" + ] + }, + "rate": { + "type": "string", + "description": "How many whole `to` units one whole `from` unit converted into, as a decimal string", + "examples": [ + "1.085" + ] + } + }, + "required": [ + "from", + "fromSymbol", + "to", + "toSymbol", + "rate" + ], + "description": "Conversion applied between the payment unit and the settlement unit. Derived from the payment amount and the gross settlement amount (settlement plus fees), so it is the effective rate for this payment rather than a rate quoted independently. Omitted when the payment does not convert, or when the amounts needed to derive it are unavailable." + }, + "MerchantPaymentRefund": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Refund state. \"fully_refunded\" is the only value this API emits.", + "examples": [ + "fully_refunded" + ] + }, + "fullyRefundedAt": { + "description": "ISO 8601 timestamp when the payment was fully refunded. Present only for fully refunded payments.", + "type": "string" + } + }, + "required": [ + "status" + ], + "description": "Refund details. Not currently populated: refund state is not yet projected into the payment read model, so this field is always omitted today. Reserved for a future release." } }, "securitySchemes": { diff --git a/openapi/2026-02-19.preview.json b/openapi/2026-02-19.preview.json index 1dd0100d..ef56c40a 100644 --- a/openapi/2026-02-19.preview.json +++ b/openapi/2026-02-19.preview.json @@ -1277,6 +1277,497 @@ } } } + }, + "get": { + "operationId": "PartnerPayments_list", + "parameters": [ + { + "name": "WCP-Version", + "in": "header", + "required": false, + "description": "Optional WalletConnect Pay API version override. If omitted, the partner's pinned version is used.", + "schema": { + "type": "string", + "examples": [ + "2026-02-18", + "2026-02-19.preview" + ] + } + }, + { + "in": "query", + "name": "startTs", + "schema": { + "examples": [ + "2026-01-06T00:00:00Z" + ], + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "description": "RFC3339 timestamp, inclusive" + }, + { + "in": "query", + "name": "endTs", + "schema": { + "examples": [ + "2026-01-07T00:00:00Z" + ], + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "description": "RFC3339 timestamp, exclusive" + }, + { + "in": "query", + "name": "token_symbol", + "schema": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "description": "Filter by token symbol (e.g. `USDC`). CAIP-19 identifiers are not supported. Accepts a single value or multiple repeated params:\n\n- Single: `?token_symbol=USDC`\n- Multiple: `?token_symbol=USDC&token_symbol=EURC`" + }, + { + "in": "query", + "name": "network", + "schema": { + "examples": [ + "eip155:8453", + "eip155:8453,eip155:1" + ], + "type": "string" + }, + "description": "Filter by [CAIP-2](https://standards.chainagnostic.org/CAIPs/caip-2) chain ID. Comma-separated for multiple." + }, + { + "in": "query", + "name": "sortBy", + "schema": { + "type": "string", + "enum": [ + "date", + "amount" + ] + }, + "description": "Field to sort by" + }, + { + "in": "query", + "name": "sortDir", + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ] + }, + "description": "Sort direction" + }, + { + "in": "query", + "name": "cursor", + "schema": { + "type": "string" + }, + "description": "Opaque pagination cursor — use the value from `nextCursor` in the previous response." + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 200 + }, + "description": "Page size (default 50, max 200)" + }, + { + "in": "query", + "name": "status", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "requires_action", + "processing", + "succeeded", + "failed", + "expired", + "cancelled" + ] + } + }, + "description": "Filter by payment status. Accepts a single value or multiple repeated params:\n\n- Single: `?status=succeeded`\n- Multiple: `?status=succeeded&status=processing`" + }, + { + "in": "query", + "name": "referenceId", + "schema": { + "type": "string", + "minLength": 3, + "maxLength": 35, + "pattern": "^[A-Za-z0-9 /:.,+-]+$", + "examples": [ + "order-42" + ] + }, + "description": "Substring search on the merchant-provided reference ID. Between 3 and 35 characters. Allowed characters: ASCII letters, digits, and ` /-:.,+`." + }, + { + "in": "query", + "name": "merchantId", + "schema": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "examples": [ + [ + "acme-store-1" + ], + [ + "acme-store-1", + "widget_co" + ] + ] + }, + "description": "Filter by merchant ID. Accepts a single value or multiple repeated params:\n\n- Single: `?merchantId=acme-store-1`\n- Multiple: `?merchantId=acme-store-1&merchantId=widget_co`" + } + ], + "responses": { + "200": { + "description": "Payments with statistics", + "headers": { + "WCP-Version": { + "description": "WalletConnect Pay API version resolved for this request.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MerchantPaymentsResponse" + }, + "example": { + "data": [ + { + "paymentId": "pay_a1a2ecc101KGF210FP7PN3BK08PZARS1CZ", + "merchant": { + "id": "acme-store-1", + "name": "Acme Store", + "iconUrl": "https://imagedelivery.net/example/icon.png" + }, + "referenceId": "a1b2cad4e5f2783012345678axcdea90", + "status": "succeeded", + "isTerminal": true, + "paymentUrl": "https://pay.walletconnect.com/?pid=pay_a1a2ecc101KGF210FP7PN3BK08PZARS1CZ", + "fiatAmount": { + "unit": "iso4217/USD", + "value": "500", + "display": { + "assetSymbol": "USD", + "assetName": "US Dollar", + "decimals": 2 + } + }, + "tokenAmount": { + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "5000000", + "display": { + "assetSymbol": "USDC", + "assetName": "USD Coin", + "decimals": 6, + "networkName": "Base", + "iconUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md", + "networkIconUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + }, + "buyer": { + "accountCaip10": "eip155:8453:0x0000000000000000000000000000000000000000", + "accountProviderName": "MetaMask", + "accountProviderIcon": "https://api.walletconnect.com/assets/v1/image/wallet/metamask/md" + }, + "transaction": { + "networkId": "8453", + "hash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "settlement": { + "amount": { + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "4840000", + "display": { + "assetSymbol": "USDC", + "assetName": "USD Coin", + "decimals": 6, + "iconUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md", + "networkName": "Base", + "networkIconUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + }, + "settled": true, + "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "fees": { + "total": { + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "160000", + "display": { + "assetSymbol": "USDC", + "assetName": "USD Coin", + "decimals": 6, + "iconUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md", + "networkName": "Base", + "networkIconUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + }, + "fixed": { + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "140000", + "display": { + "assetSymbol": "USDC", + "assetName": "USD Coin", + "decimals": 6, + "iconUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md", + "networkName": "Base", + "networkIconUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + }, + "percentage": "0.4" + }, + "refund": { + "status": "fully_refunded", + "fullyRefundedAt": "2024-01-02T08:30:00.000Z" + }, + "createdAt": "2024-01-01T12:00:00.000Z", + "expiresAt": "2024-01-01T12:15:00.000Z", + "lastUpdatedAt": "2024-01-01T12:00:00.000Z", + "settledAt": "2024-01-01T12:00:00.000Z" + } + ], + "nextCursor": null, + "stats": { + "totalRevenue": [ + { + "amount": 1000, + "currency": "USD" + } + ], + "totalTransactions": 100, + "totalCustomers": 25 + } + } + } + } + }, + "400": { + "description": "Bad request — invalid parameters or API version", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "invalid_params", + "params_validation", + "invalid_api_version", + "unknown_api_version", + "api_version_downgrade" + ], + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "issues": { + "description": "Field-level validation issues (present on validation errors)", + "type": "array", + "items": { + "type": "object", + "properties": { + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "field", + "message" + ] + } + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + }, + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "invalid_api_version": { + "summary": "Invalid API version", + "value": { + "code": "invalid_api_version", + "message": "Invalid API version" + } + }, + "unknown_api_version": { + "summary": "Unknown API version", + "value": { + "code": "unknown_api_version", + "message": "Unknown API version" + } + }, + "api_version_downgrade": { + "summary": "Requested API version is older than the partner pin", + "value": { + "code": "api_version_downgrade", + "message": "Requested API version is older than the partner pin" + } + } + } + } + } + }, + "401": { + "description": "Unauthorized — missing or invalid partner API key", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "missing_api_key", + "invalid_api_key" + ], + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "missing_api_key": { + "summary": "Missing API key", + "value": { + "code": "missing_api_key", + "message": "Missing API key" + } + }, + "invalid_api_key": { + "summary": "Invalid API key", + "value": { + "code": "invalid_api_key", + "message": "Invalid API key" + } + } + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "internal_error", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "internal_error": { + "summary": "Internal Server Error", + "value": { + "code": "internal_error", + "message": "Internal Server Error" + } + } + } + } + } + } + }, + "tags": [ + "Payments" + ], + "summary": "List payments", + "description": "Retrieve paginated payments with optional filters.", + "security": [ + { + "API Key": [] + } + ] } }, "/v1/payments/{id}": { @@ -2714,7 +3205,7 @@ "expiresAt": 1718236800, "gatewayUrl": "https://api.pay.walletconnect.com/pay_123", "isFinal": false, - "paymentId": "pay_c8a2ecc101M7W4KR8EF5FM7CMD14MAEK85", + "paymentId": "pay_78a2ecc101M7WG10HBZEA7GEKBQAYVY39R", "pollInMs": 1000, "status": "requires_action" } @@ -2861,7 +3352,7 @@ "example": { "cancelledAt": "2025-01-14T10:30:00Z", "cancelledReason": "cancelled_by_user", - "paymentId": "pay_daa2ecc101M7W4KR8GJK7F86HM8J02BMCT", + "paymentId": "pay_8ba2ecc101M7WG10HDS0VAKCFANFZ6TKXD", "status": "cancelled" } }, @@ -3761,7 +4252,7 @@ "example": { "cancelledAt": "2025-01-14T10:30:00Z", "cancelledReason": "cancelled_by_merchant", - "paymentId": "pay_4aa2ecc101M7W4KR8E2Z6Z02DB70AGET15", + "paymentId": "pay_eda2ecc101M7WG10HC6HE6NF47W5XY9JSG", "status": "cancelled" } }, @@ -4306,6 +4797,447 @@ "{\"domain\":{\"name\":\"USD Coin\",\"version\":\"2\",\"chainId\":\"0x2105\",\"verifyingContract\":\"0x0000000000000000000000000000000000000000\"},\"types\":{\"EIP712Domain\":[{\"type\":\"string\",\"name\":\"name\"},{\"type\":\"string\",\"name\":\"version\"},{\"type\":\"uint256\",\"name\":\"chainId\"},{\"type\":\"address\",\"name\":\"verifyingContract\"}],\"ReceiveWithAuthorization\":[{\"type\":\"address\",\"name\":\"from\"},{\"type\":\"address\",\"name\":\"to\"},{\"type\":\"uint256\",\"name\":\"value\"},{\"type\":\"uint256\",\"name\":\"validAfter\"},{\"type\":\"uint256\",\"name\":\"validBefore\"},{\"type\":\"bytes32\",\"name\":\"nonce\"}]},\"primaryType\":\"ReceiveWithAuthorization\",\"message\":{\"from\":\"0x0000000000000000000000000000000000000000\",\"nonce\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"to\":\"0x0000000000000000000000000000000000000000\",\"validAfter\":\"0x0\",\"validBefore\":\"0x0\",\"value\":\"0x0\"}}" ] } + }, + "MerchantPaymentsResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "paymentId": { + "type": "string", + "description": "Unique payment identifier" + }, + "merchant": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Partner-provided merchant ID" + }, + "name": { + "description": "Merchant display name", + "type": "string" + }, + "iconUrl": { + "description": "Merchant logo URL", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id" + ] + }, + "referenceId": { + "type": "string", + "description": "Idempotency / reference ID provided at payment creation" + }, + "status": { + "type": "string", + "enum": [ + "requires_action", + "processing", + "succeeded", + "failed", + "expired", + "cancelled" + ] + }, + "isTerminal": { + "type": "boolean", + "description": "Whether the payment has reached a final state" + }, + "fiatAmount": { + "$ref": "#/components/schemas/MerchantPaymentFiatAmount" + }, + "tokenAmount": { + "$ref": "#/components/schemas/MerchantPaymentTokenAmount" + }, + "buyer": { + "description": "Buyer wallet information", + "type": "object", + "properties": { + "accountCaip10": { + "type": "string", + "description": "Buyer address as a [CAIP-10](https://standards.chainagnostic.org/CAIPs/caip-10) account ID", + "examples": [ + "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + ] + }, + "accountProviderName": { + "description": "Wallet provider name", + "examples": [ + "MetaMask" + ], + "type": "string" + }, + "accountProviderIcon": { + "description": "Wallet provider logo URL", + "type": "string" + } + }, + "required": [ + "accountCaip10" + ] + }, + "transaction": { + "description": "On-chain transaction details", + "type": "object", + "properties": { + "networkId": { + "type": "string", + "description": "Numeric chain ID", + "examples": [ + "8453" + ] + }, + "hash": { + "description": "On-chain transaction hash", + "type": "string" + } + }, + "required": [ + "networkId" + ] + }, + "fees": { + "description": "Fee breakdown derived from payment option data. Omitted when total fee data is unavailable.", + "type": "object", + "properties": { + "total": { + "anyOf": [ + { + "$ref": "#/components/schemas/MerchantPaymentFiatAmount" + }, + { + "$ref": "#/components/schemas/MerchantPaymentTokenAmount" + } + ], + "description": "Total fee amount." + }, + "fixed": { + "description": "Fixed fee component.", + "anyOf": [ + { + "$ref": "#/components/schemas/MerchantPaymentFiatAmount" + }, + { + "$ref": "#/components/schemas/MerchantPaymentTokenAmount" + } + ] + }, + "percentage": { + "description": "Percentage fee component as a decimal percentage string, not a ratio. For example, \"0.4\" means 0.4%.", + "type": "string" + } + }, + "required": [ + "total" + ] + }, + "settlement": { + "$ref": "#/components/schemas/MerchantPaymentSettlement" + }, + "exchangeRate": { + "$ref": "#/components/schemas/MerchantPaymentExchangeRate" + }, + "refund": { + "$ref": "#/components/schemas/MerchantPaymentRefund" + }, + "paymentUrl": { + "description": "Hosted payment page URL for this payment. The hosted page reflects the payment's current state.", + "type": "string", + "format": "uri" + }, + "createdAt": { + "type": "string", + "description": "ISO 8601 timestamp" + }, + "expiresAt": { + "description": "ISO 8601 timestamp of the payment deadline, present only when the payment has an expiration", + "type": "string" + }, + "lastUpdatedAt": { + "type": "string", + "description": "ISO 8601 timestamp" + }, + "settledAt": { + "description": "ISO 8601 timestamp, present only when `settlement.settled` is `true` and a timestamp is available", + "type": "string" + } + }, + "required": [ + "paymentId", + "merchant", + "referenceId", + "status", + "isTerminal", + "createdAt", + "lastUpdatedAt" + ] + } + }, + "nextCursor": { + "description": "Cursor for the next page, or null if no more results", + "type": [ + "string", + "null" + ] + }, + "stats": { + "type": "object", + "properties": { + "totalRevenue": { + "type": "array", + "items": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "description": "Revenue amount in currency's standard unit" + }, + "currency": { + "type": "string", + "description": "ISO 4217 currency code", + "examples": [ + "USD" + ] + } + }, + "required": [ + "amount", + "currency" + ] + }, + "description": "Total revenue over succeeded payments, converted to USD. Always exactly one element — a merchant with no volume gets a zero rather than an empty array. Kept as an array for backwards compatibility." + }, + "totalTransactions": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "description": "Total payments matching the query" + }, + "totalCustomers": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "description": "Unique buyers matching the query" + } + }, + "required": [ + "totalRevenue", + "totalTransactions", + "totalCustomers" + ], + "description": "Aggregate statistics for the query" + } + }, + "required": [ + "data", + "nextCursor", + "stats" + ] + }, + "MerchantPaymentFiatAmount": { + "type": "object", + "properties": { + "unit": { + "type": "string", + "pattern": "^iso4217\\/", + "description": "Fiat unit, for example \"iso4217/USD\"" + }, + "value": { + "type": "string", + "description": "Amount in minor units for the fiat currency" + }, + "display": { + "type": "object", + "properties": { + "assetSymbol": { + "type": "string" + }, + "assetName": { + "type": "string" + }, + "decimals": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + } + }, + "required": [ + "assetSymbol", + "assetName", + "decimals" + ], + "description": "Display metadata for fiat-denominated amounts" + } + }, + "required": [ + "unit", + "value", + "display" + ], + "description": "Fiat-denominated amount" + }, + "MerchantPaymentTokenAmount": { + "type": "object", + "properties": { + "unit": { + "type": "string", + "pattern": "^caip19\\/", + "description": "Token unit, for example \"caip19/...\"" + }, + "value": { + "type": "string", + "description": "Amount in minor units for the token asset" + }, + "display": { + "anyOf": [ + { + "type": "object", + "properties": { + "assetSymbol": { + "type": "string" + }, + "assetName": { + "type": "string" + }, + "decimals": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "iconUrl": { + "type": "string" + }, + "networkName": { + "type": "string" + }, + "networkIconUrl": { + "type": "string" + } + }, + "required": [ + "assetSymbol", + "assetName", + "decimals" + ], + "description": "Display metadata for token-denominated amounts" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "unit", + "value", + "display" + ], + "description": "Token-denominated amount" + }, + "MerchantPaymentSettlement": { + "description": "Settlement details. Omitted when settlement details cannot be reported yet. When present, `settled` is always included. When `settled` is `false`, no additional settlement fields are returned. When `settled` is `true`, `amount` is included and `txHash` is included when available.", + "type": "object", + "properties": { + "settled": { + "type": "boolean", + "description": "Whether settlement is complete." + }, + "amount": { + "description": "Net settlement amount after fees in the settlement unit. Present when `settled` is `true`.", + "anyOf": [ + { + "$ref": "#/components/schemas/MerchantPaymentFiatAmount" + }, + { + "$ref": "#/components/schemas/MerchantPaymentTokenAmount" + } + ] + }, + "txHash": { + "description": "Settlement transaction hash. Present when `settled` is `true` and an upstream settlement transaction hash is available.", + "type": "string" + } + }, + "required": [ + "settled" + ] + }, + "MerchantPaymentExchangeRate": { + "type": "object", + "properties": { + "from": { + "type": "string", + "description": "Unit the payment was priced in", + "examples": [ + "iso4217/EUR" + ] + }, + "fromSymbol": { + "type": "string", + "description": "Display symbol for `from`", + "examples": [ + "EUR" + ] + }, + "to": { + "type": "string", + "description": "Unit the payment settles in", + "examples": [ + "caip19/eip155:8453/erc20:0x833589fcd6edb6e08f4c7c32d4f71b54bda02913" + ] + }, + "toSymbol": { + "type": "string", + "description": "Display symbol for `to`", + "examples": [ + "USDC" + ] + }, + "rate": { + "type": "string", + "description": "How many whole `to` units one whole `from` unit converted into, as a decimal string", + "examples": [ + "1.085" + ] + } + }, + "required": [ + "from", + "fromSymbol", + "to", + "toSymbol", + "rate" + ], + "description": "Conversion applied between the payment unit and the settlement unit. Derived from the payment amount and the gross settlement amount (settlement plus fees), so it is the effective rate for this payment rather than a rate quoted independently. Omitted when the payment does not convert, or when the amounts needed to derive it are unavailable." + }, + "MerchantPaymentRefund": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Refund state. \"fully_refunded\" is the only value this API emits.", + "examples": [ + "fully_refunded" + ] + }, + "fullyRefundedAt": { + "description": "ISO 8601 timestamp when the payment was fully refunded. Present only for fully refunded payments.", + "type": "string" + } + }, + "required": [ + "status" + ], + "description": "Refund details. Not currently populated: refund state is not yet projected into the payment read model, so this field is always omitted today. Reserved for a future release." } }, "securitySchemes": { diff --git a/scripts/generate-specs.mjs b/scripts/generate-specs.mjs index 93743663..6de389a6 100644 --- a/scripts/generate-specs.mjs +++ b/scripts/generate-specs.mjs @@ -12,9 +12,13 @@ const NAVIGATION_PATH = join(ROOT, 'content', 'navigation.json'); const REDIRECTS_PATH = join(ROOT, 'redirects.json'); const VERSIONS_URL = 'https://api.pay.walletconnect.com/versions'; -// Only the Core API is documented. The merchant service (api.merchant.pay.walletconnect.com) is -// left out on purpose: its spec isn't part of the public API reference. -const SERVICES = [{ name: 'Core', baseUrl: 'https://api.pay.walletconnect.com' }]; +// The API reference documents the Core API only. The merchant service +// (api.merchant.pay.walletconnect.com) is left out on purpose: it isn't part of the public API. +const CORE_BASE_URL = 'https://api.pay.walletconnect.com'; +// `GET /v1/payments` (list payments) is served at api.pay.walletconnect.com, but the Core spec doesn't +// describe it yet, so its definition is kept here, one entry per API version. Update it by hand when +// the endpoint changes, and delete the file once the Core spec includes the operation. +const EXTRA_OPERATIONS_PATH = join(ROOT, 'scripts', 'payments-list-operation.json'); const VERSION_RE = /^\d{4}-\d{2}-\d{2}(\.preview)?$/; @@ -34,7 +38,7 @@ function mergeSpecs(specs, version) { const merged = { openapi: '3.1.0', info: { title: 'WalletConnect Pay API', version }, - servers: [{ url: SERVICES[0].baseUrl }], + servers: [{ url: CORE_BASE_URL }], paths: {}, tags: [], components: { schemas: {}, securitySchemes: {} }, @@ -79,6 +83,35 @@ function mergeSpecs(specs, version) { return merged; } +// Returns the operations from EXTRA_OPERATIONS_PATH for `version`, as a spec to merge after the Core +// one, leaving out any the Core spec now describes itself. +function extraOperations(extras, version, coreSpec) { + const extra = extras[version]; + // Fail rather than silently drop the page when a new API version ships. + if (!extra) throw new Error(`${EXTRA_OPERATIONS_PATH} has no entry for ${version}: add one`); + + const paths = {}; + for (const [path, methods] of Object.entries(extra.paths)) { + for (const [method, op] of Object.entries(methods)) { + if (coreSpec.paths?.[path]?.[method]) { + console.warn(`${method.toUpperCase()} ${path} is in the Core spec now: delete ${EXTRA_OPERATIONS_PATH}`); + continue; + } + paths[path] = { ...(paths[path] || {}), [method]: op }; + } + } + if (!Object.keys(paths).length) return { paths }; + + // A same-named Core schema would be overwritten in the merged spec, changing Core pages. + for (const [name, schema] of Object.entries(extra.components?.schemas || {})) { + const coreSchema = coreSpec.components?.schemas?.[name]; + if (coreSchema && JSON.stringify(coreSchema) !== JSON.stringify(schema)) { + throw new Error(`Schema ${name} differs between the Core spec and ${EXTRA_OPERATIONS_PATH}`); + } + } + return { paths, components: extra.components }; +} + function slugify(method, path) { return (method + path) .toLowerCase() @@ -135,8 +168,10 @@ async function generatePages(version, spec) { } async function generateSpec(version) { - const specs = await Promise.all(SERVICES.map(({ baseUrl }) => fetchJson(`${baseUrl}/spec/${version}/openapi.json`))); - const merged = mergeSpecs(specs, version); + const coreSpec = await fetchJson(`${CORE_BASE_URL}/spec/${version}/openapi.json`); + const extras = JSON.parse(await readFile(EXTRA_OPERATIONS_PATH, 'utf-8')); + // Core first: it sets the merged spec's top-level security and the sidebar order. + const merged = mergeSpecs([coreSpec, extraOperations(extras, version, coreSpec)], version); const outPath = join(ROOT, 'openapi', `${version}.json`); await mkdir(dirname(outPath), { recursive: true }); await writeFile(outPath, JSON.stringify(merged, null, 2) + '\n'); diff --git a/scripts/payments-list-operation.json b/scripts/payments-list-operation.json new file mode 100644 index 00000000..2a96380b --- /dev/null +++ b/scripts/payments-list-operation.json @@ -0,0 +1,1630 @@ +{ + "2026-02-18": { + "paths": { + "/v1/payments": { + "get": { + "operationId": "PartnerPayments_list", + "parameters": [ + { + "name": "WCP-Version", + "in": "header", + "required": false, + "description": "Optional WalletConnect Pay API version override. If omitted, the partner's pinned version is used.", + "schema": { + "type": "string", + "examples": ["2026-02-18", "2026-02-19.preview"] + } + }, + { + "in": "query", + "name": "startTs", + "schema": { + "examples": ["2026-01-06T00:00:00Z"], + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "description": "RFC3339 timestamp, inclusive" + }, + { + "in": "query", + "name": "endTs", + "schema": { + "examples": ["2026-01-07T00:00:00Z"], + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "description": "RFC3339 timestamp, exclusive" + }, + { + "in": "query", + "name": "token_symbol", + "schema": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "description": "Filter by token symbol (e.g. `USDC`). CAIP-19 identifiers are not supported. Accepts a single value or multiple repeated params:\n\n- Single: `?token_symbol=USDC`\n- Multiple: `?token_symbol=USDC&token_symbol=EURC`" + }, + { + "in": "query", + "name": "network", + "schema": { + "examples": ["eip155:8453", "eip155:8453,eip155:1"], + "type": "string" + }, + "description": "Filter by [CAIP-2](https://standards.chainagnostic.org/CAIPs/caip-2) chain ID. Comma-separated for multiple." + }, + { + "in": "query", + "name": "sortBy", + "schema": { + "type": "string", + "enum": ["date", "amount"] + }, + "description": "Field to sort by" + }, + { + "in": "query", + "name": "sortDir", + "schema": { + "type": "string", + "enum": ["asc", "desc"] + }, + "description": "Sort direction" + }, + { + "in": "query", + "name": "cursor", + "schema": { + "type": "string" + }, + "description": "Opaque pagination cursor — use the value from `nextCursor` in the previous response." + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 200 + }, + "description": "Page size (default 50, max 200)" + }, + { + "in": "query", + "name": "status", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": ["requires_action", "processing", "succeeded", "failed", "expired"] + } + }, + "description": "Filter by payment status. Accepts a single value or multiple repeated params:\n\n- Single: `?status=succeeded`\n- Multiple: `?status=succeeded&status=processing`" + }, + { + "in": "query", + "name": "referenceId", + "schema": { + "type": "string", + "minLength": 3, + "maxLength": 35, + "pattern": "^[A-Za-z0-9 /:.,+-]+$", + "examples": ["order-42"] + }, + "description": "Substring search on the merchant-provided reference ID. Between 3 and 35 characters. Allowed characters: ASCII letters, digits, and ` /-:.,+`." + }, + { + "in": "query", + "name": "merchantId", + "schema": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "examples": [["acme-store-1"], ["acme-store-1", "widget_co"]] + }, + "description": "Filter by merchant ID. Accepts a single value or multiple repeated params:\n\n- Single: `?merchantId=acme-store-1`\n- Multiple: `?merchantId=acme-store-1&merchantId=widget_co`" + } + ], + "responses": { + "200": { + "description": "Payments with statistics", + "headers": { + "WCP-Version": { + "description": "WalletConnect Pay API version resolved for this request.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MerchantPaymentsResponse" + }, + "example": { + "data": [ + { + "paymentId": "pay_a1a2ecc101KGF210FP7PN3BK08PZARS1CZ", + "merchant": { + "id": "acme-store-1", + "name": "Acme Store", + "iconUrl": "https://imagedelivery.net/example/icon.png" + }, + "referenceId": "a1b2cad4e5f2783012345678axcdea90", + "status": "succeeded", + "isTerminal": true, + "paymentUrl": "https://pay.walletconnect.com/?pid=pay_a1a2ecc101KGF210FP7PN3BK08PZARS1CZ", + "fiatAmount": { + "unit": "iso4217/USD", + "value": "500", + "display": { + "assetSymbol": "USD", + "assetName": "US Dollar", + "decimals": 2 + } + }, + "tokenAmount": { + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "5000000", + "display": { + "assetSymbol": "USDC", + "assetName": "USD Coin", + "decimals": 6, + "networkName": "Base", + "iconUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md", + "networkIconUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + }, + "buyer": { + "accountCaip10": "eip155:8453:0x0000000000000000000000000000000000000000", + "accountProviderName": "MetaMask", + "accountProviderIcon": "https://api.walletconnect.com/assets/v1/image/wallet/metamask/md" + }, + "transaction": { + "networkId": "8453", + "hash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "settlement": { + "amount": { + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "4840000", + "display": { + "assetSymbol": "USDC", + "assetName": "USD Coin", + "decimals": 6, + "iconUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md", + "networkName": "Base", + "networkIconUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + }, + "settled": true, + "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "fees": { + "total": { + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "160000", + "display": { + "assetSymbol": "USDC", + "assetName": "USD Coin", + "decimals": 6, + "iconUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md", + "networkName": "Base", + "networkIconUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + }, + "fixed": { + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "140000", + "display": { + "assetSymbol": "USDC", + "assetName": "USD Coin", + "decimals": 6, + "iconUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md", + "networkName": "Base", + "networkIconUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + }, + "percentage": "0.4" + }, + "refund": { + "status": "fully_refunded", + "fullyRefundedAt": "2024-01-02T08:30:00.000Z" + }, + "createdAt": "2024-01-01T12:00:00.000Z", + "expiresAt": "2024-01-01T12:15:00.000Z", + "lastUpdatedAt": "2024-01-01T12:00:00.000Z", + "settledAt": "2024-01-01T12:00:00.000Z" + } + ], + "nextCursor": null, + "stats": { + "totalRevenue": [ + { + "amount": 1000, + "currency": "USD" + } + ], + "totalTransactions": 100, + "totalCustomers": 25 + } + } + } + } + }, + "400": { + "description": "Bad request — invalid parameters or API version", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "invalid_params", + "params_validation", + "invalid_api_version", + "unknown_api_version", + "api_version_downgrade" + ], + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "issues": { + "description": "Field-level validation issues (present on validation errors)", + "type": "array", + "items": { + "type": "object", + "properties": { + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": ["field", "message"] + } + } + }, + "required": ["message", "code"] + }, + "examples": { + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + }, + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "invalid_api_version": { + "summary": "Invalid API version", + "value": { + "code": "invalid_api_version", + "message": "Invalid API version" + } + }, + "unknown_api_version": { + "summary": "Unknown API version", + "value": { + "code": "unknown_api_version", + "message": "Unknown API version" + } + }, + "api_version_downgrade": { + "summary": "Requested API version is older than the partner pin", + "value": { + "code": "api_version_downgrade", + "message": "Requested API version is older than the partner pin" + } + } + } + } + } + }, + "401": { + "description": "Unauthorized — missing or invalid partner API key", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": ["missing_api_key", "invalid_api_key"], + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": ["message", "code"] + }, + "examples": { + "missing_api_key": { + "summary": "Missing API key", + "value": { + "code": "missing_api_key", + "message": "Missing API key" + } + }, + "invalid_api_key": { + "summary": "Invalid API key", + "value": { + "code": "invalid_api_key", + "message": "Invalid API key" + } + } + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "internal_error", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": ["message", "code"] + }, + "examples": { + "internal_error": { + "summary": "Internal Server Error", + "value": { + "code": "internal_error", + "message": "Internal Server Error" + } + } + } + } + } + } + }, + "tags": ["Payments"], + "summary": "List payments", + "description": "Retrieve paginated payments with optional filters.", + "security": [ + { + "API Key": [] + } + ] + } + } + }, + "components": { + "schemas": { + "MerchantPaymentsResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "paymentId": { + "type": "string", + "description": "Unique payment identifier" + }, + "merchant": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Partner-provided merchant ID" + }, + "name": { + "description": "Merchant display name", + "type": "string" + }, + "iconUrl": { + "description": "Merchant logo URL", + "type": ["string", "null"] + } + }, + "required": ["id"] + }, + "referenceId": { + "type": "string", + "description": "Idempotency / reference ID provided at payment creation" + }, + "status": { + "type": "string", + "enum": ["requires_action", "processing", "succeeded", "failed", "expired"] + }, + "isTerminal": { + "type": "boolean", + "description": "Whether the payment has reached a final state" + }, + "fiatAmount": { + "$ref": "#/components/schemas/MerchantPaymentFiatAmount" + }, + "tokenAmount": { + "$ref": "#/components/schemas/MerchantPaymentTokenAmount" + }, + "buyer": { + "description": "Buyer wallet information", + "type": "object", + "properties": { + "accountCaip10": { + "type": "string", + "description": "Buyer address as a [CAIP-10](https://standards.chainagnostic.org/CAIPs/caip-10) account ID", + "examples": ["eip155:8453:0x1234567890abcdef1234567890abcdef12345678"] + }, + "accountProviderName": { + "description": "Wallet provider name", + "examples": ["MetaMask"], + "type": "string" + }, + "accountProviderIcon": { + "description": "Wallet provider logo URL", + "type": "string" + } + }, + "required": ["accountCaip10"] + }, + "transaction": { + "description": "On-chain transaction details", + "type": "object", + "properties": { + "networkId": { + "type": "string", + "description": "Numeric chain ID", + "examples": ["8453"] + }, + "hash": { + "description": "On-chain transaction hash", + "type": "string" + } + }, + "required": ["networkId"] + }, + "fees": { + "description": "Fee breakdown derived from payment option data. Omitted when total fee data is unavailable.", + "type": "object", + "properties": { + "total": { + "anyOf": [ + { + "$ref": "#/components/schemas/MerchantPaymentFiatAmount" + }, + { + "$ref": "#/components/schemas/MerchantPaymentTokenAmount" + } + ], + "description": "Total fee amount." + }, + "fixed": { + "description": "Fixed fee component.", + "anyOf": [ + { + "$ref": "#/components/schemas/MerchantPaymentFiatAmount" + }, + { + "$ref": "#/components/schemas/MerchantPaymentTokenAmount" + } + ] + }, + "percentage": { + "description": "Percentage fee component as a decimal percentage string, not a ratio. For example, \"0.4\" means 0.4%.", + "type": "string" + } + }, + "required": ["total"] + }, + "settlement": { + "$ref": "#/components/schemas/MerchantPaymentSettlement" + }, + "exchangeRate": { + "$ref": "#/components/schemas/MerchantPaymentExchangeRate" + }, + "refund": { + "$ref": "#/components/schemas/MerchantPaymentRefund" + }, + "paymentUrl": { + "description": "Hosted payment page URL for this payment. The hosted page reflects the payment's current state.", + "type": "string", + "format": "uri" + }, + "createdAt": { + "type": "string", + "description": "ISO 8601 timestamp" + }, + "expiresAt": { + "description": "ISO 8601 timestamp of the payment deadline, present only when the payment has an expiration", + "type": "string" + }, + "lastUpdatedAt": { + "type": "string", + "description": "ISO 8601 timestamp" + }, + "settledAt": { + "description": "ISO 8601 timestamp, present only when `settlement.settled` is `true` and a timestamp is available", + "type": "string" + } + }, + "required": [ + "paymentId", + "merchant", + "referenceId", + "status", + "isTerminal", + "createdAt", + "lastUpdatedAt" + ] + } + }, + "nextCursor": { + "description": "Cursor for the next page, or null if no more results", + "type": ["string", "null"] + }, + "stats": { + "type": "object", + "properties": { + "totalRevenue": { + "type": "array", + "items": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "description": "Revenue amount in currency's standard unit" + }, + "currency": { + "type": "string", + "description": "ISO 4217 currency code", + "examples": ["USD"] + } + }, + "required": ["amount", "currency"] + }, + "description": "Total revenue over succeeded payments, converted to USD. Always exactly one element — a merchant with no volume gets a zero rather than an empty array. Kept as an array for backwards compatibility." + }, + "totalTransactions": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "description": "Total payments matching the query" + }, + "totalCustomers": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "description": "Unique buyers matching the query" + } + }, + "required": ["totalRevenue", "totalTransactions", "totalCustomers"], + "description": "Aggregate statistics for the query" + } + }, + "required": ["data", "nextCursor", "stats"] + }, + "MerchantPaymentFiatAmount": { + "type": "object", + "properties": { + "unit": { + "type": "string", + "pattern": "^iso4217\\/", + "description": "Fiat unit, for example \"iso4217/USD\"" + }, + "value": { + "type": "string", + "description": "Amount in minor units for the fiat currency" + }, + "display": { + "type": "object", + "properties": { + "assetSymbol": { + "type": "string" + }, + "assetName": { + "type": "string" + }, + "decimals": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + } + }, + "required": ["assetSymbol", "assetName", "decimals"], + "description": "Display metadata for fiat-denominated amounts" + } + }, + "required": ["unit", "value", "display"], + "description": "Fiat-denominated amount" + }, + "MerchantPaymentTokenAmount": { + "type": "object", + "properties": { + "unit": { + "type": "string", + "pattern": "^caip19\\/", + "description": "Token unit, for example \"caip19/...\"" + }, + "value": { + "type": "string", + "description": "Amount in minor units for the token asset" + }, + "display": { + "anyOf": [ + { + "type": "object", + "properties": { + "assetSymbol": { + "type": "string" + }, + "assetName": { + "type": "string" + }, + "decimals": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "iconUrl": { + "type": "string" + }, + "networkName": { + "type": "string" + }, + "networkIconUrl": { + "type": "string" + } + }, + "required": ["assetSymbol", "assetName", "decimals"], + "description": "Display metadata for token-denominated amounts" + }, + { + "type": "null" + } + ] + } + }, + "required": ["unit", "value", "display"], + "description": "Token-denominated amount" + }, + "MerchantPaymentSettlement": { + "description": "Settlement details. Omitted when settlement details cannot be reported yet. When present, `settled` is always included. When `settled` is `false`, no additional settlement fields are returned. When `settled` is `true`, `amount` is included and `txHash` is included when available.", + "type": "object", + "properties": { + "settled": { + "type": "boolean", + "description": "Whether settlement is complete." + }, + "amount": { + "description": "Net settlement amount after fees in the settlement unit. Present when `settled` is `true`.", + "anyOf": [ + { + "$ref": "#/components/schemas/MerchantPaymentFiatAmount" + }, + { + "$ref": "#/components/schemas/MerchantPaymentTokenAmount" + } + ] + }, + "txHash": { + "description": "Settlement transaction hash. Present when `settled` is `true` and an upstream settlement transaction hash is available.", + "type": "string" + } + }, + "required": ["settled"] + }, + "MerchantPaymentExchangeRate": { + "type": "object", + "properties": { + "from": { + "type": "string", + "description": "Unit the payment was priced in", + "examples": ["iso4217/EUR"] + }, + "fromSymbol": { + "type": "string", + "description": "Display symbol for `from`", + "examples": ["EUR"] + }, + "to": { + "type": "string", + "description": "Unit the payment settles in", + "examples": ["caip19/eip155:8453/erc20:0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"] + }, + "toSymbol": { + "type": "string", + "description": "Display symbol for `to`", + "examples": ["USDC"] + }, + "rate": { + "type": "string", + "description": "How many whole `to` units one whole `from` unit converted into, as a decimal string", + "examples": ["1.085"] + } + }, + "required": ["from", "fromSymbol", "to", "toSymbol", "rate"], + "description": "Conversion applied between the payment unit and the settlement unit. Derived from the payment amount and the gross settlement amount (settlement plus fees), so it is the effective rate for this payment rather than a rate quoted independently. Omitted when the payment does not convert, or when the amounts needed to derive it are unavailable." + }, + "MerchantPaymentRefund": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Refund state. \"fully_refunded\" is the only value this API emits.", + "examples": ["fully_refunded"] + }, + "fullyRefundedAt": { + "description": "ISO 8601 timestamp when the payment was fully refunded. Present only for fully refunded payments.", + "type": "string" + } + }, + "required": ["status"], + "description": "Refund details. Not currently populated: refund state is not yet projected into the payment read model, so this field is always omitted today. Reserved for a future release." + } + } + } + }, + "2026-02-19.preview": { + "paths": { + "/v1/payments": { + "get": { + "operationId": "PartnerPayments_list", + "parameters": [ + { + "name": "WCP-Version", + "in": "header", + "required": false, + "description": "Optional WalletConnect Pay API version override. If omitted, the partner's pinned version is used.", + "schema": { + "type": "string", + "examples": ["2026-02-18", "2026-02-19.preview"] + } + }, + { + "in": "query", + "name": "startTs", + "schema": { + "examples": ["2026-01-06T00:00:00Z"], + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "description": "RFC3339 timestamp, inclusive" + }, + { + "in": "query", + "name": "endTs", + "schema": { + "examples": ["2026-01-07T00:00:00Z"], + "type": "string", + "format": "date-time", + "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" + }, + "description": "RFC3339 timestamp, exclusive" + }, + { + "in": "query", + "name": "token_symbol", + "schema": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "description": "Filter by token symbol (e.g. `USDC`). CAIP-19 identifiers are not supported. Accepts a single value or multiple repeated params:\n\n- Single: `?token_symbol=USDC`\n- Multiple: `?token_symbol=USDC&token_symbol=EURC`" + }, + { + "in": "query", + "name": "network", + "schema": { + "examples": ["eip155:8453", "eip155:8453,eip155:1"], + "type": "string" + }, + "description": "Filter by [CAIP-2](https://standards.chainagnostic.org/CAIPs/caip-2) chain ID. Comma-separated for multiple." + }, + { + "in": "query", + "name": "sortBy", + "schema": { + "type": "string", + "enum": ["date", "amount"] + }, + "description": "Field to sort by" + }, + { + "in": "query", + "name": "sortDir", + "schema": { + "type": "string", + "enum": ["asc", "desc"] + }, + "description": "Sort direction" + }, + { + "in": "query", + "name": "cursor", + "schema": { + "type": "string" + }, + "description": "Opaque pagination cursor — use the value from `nextCursor` in the previous response." + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 200 + }, + "description": "Page size (default 50, max 200)" + }, + { + "in": "query", + "name": "status", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": ["requires_action", "processing", "succeeded", "failed", "expired", "cancelled"] + } + }, + "description": "Filter by payment status. Accepts a single value or multiple repeated params:\n\n- Single: `?status=succeeded`\n- Multiple: `?status=succeeded&status=processing`" + }, + { + "in": "query", + "name": "referenceId", + "schema": { + "type": "string", + "minLength": 3, + "maxLength": 35, + "pattern": "^[A-Za-z0-9 /:.,+-]+$", + "examples": ["order-42"] + }, + "description": "Substring search on the merchant-provided reference ID. Between 3 and 35 characters. Allowed characters: ASCII letters, digits, and ` /-:.,+`." + }, + { + "in": "query", + "name": "merchantId", + "schema": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "examples": [["acme-store-1"], ["acme-store-1", "widget_co"]] + }, + "description": "Filter by merchant ID. Accepts a single value or multiple repeated params:\n\n- Single: `?merchantId=acme-store-1`\n- Multiple: `?merchantId=acme-store-1&merchantId=widget_co`" + } + ], + "responses": { + "200": { + "description": "Payments with statistics", + "headers": { + "WCP-Version": { + "description": "WalletConnect Pay API version resolved for this request.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MerchantPaymentsResponse" + }, + "example": { + "data": [ + { + "paymentId": "pay_a1a2ecc101KGF210FP7PN3BK08PZARS1CZ", + "merchant": { + "id": "acme-store-1", + "name": "Acme Store", + "iconUrl": "https://imagedelivery.net/example/icon.png" + }, + "referenceId": "a1b2cad4e5f2783012345678axcdea90", + "status": "succeeded", + "isTerminal": true, + "paymentUrl": "https://pay.walletconnect.com/?pid=pay_a1a2ecc101KGF210FP7PN3BK08PZARS1CZ", + "fiatAmount": { + "unit": "iso4217/USD", + "value": "500", + "display": { + "assetSymbol": "USD", + "assetName": "US Dollar", + "decimals": 2 + } + }, + "tokenAmount": { + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "5000000", + "display": { + "assetSymbol": "USDC", + "assetName": "USD Coin", + "decimals": 6, + "networkName": "Base", + "iconUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md", + "networkIconUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + }, + "buyer": { + "accountCaip10": "eip155:8453:0x0000000000000000000000000000000000000000", + "accountProviderName": "MetaMask", + "accountProviderIcon": "https://api.walletconnect.com/assets/v1/image/wallet/metamask/md" + }, + "transaction": { + "networkId": "8453", + "hash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "settlement": { + "amount": { + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "4840000", + "display": { + "assetSymbol": "USDC", + "assetName": "USD Coin", + "decimals": 6, + "iconUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md", + "networkName": "Base", + "networkIconUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + }, + "settled": true, + "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "fees": { + "total": { + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "160000", + "display": { + "assetSymbol": "USDC", + "assetName": "USD Coin", + "decimals": 6, + "iconUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md", + "networkName": "Base", + "networkIconUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + }, + "fixed": { + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "140000", + "display": { + "assetSymbol": "USDC", + "assetName": "USD Coin", + "decimals": 6, + "iconUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md", + "networkName": "Base", + "networkIconUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + }, + "percentage": "0.4" + }, + "refund": { + "status": "fully_refunded", + "fullyRefundedAt": "2024-01-02T08:30:00.000Z" + }, + "createdAt": "2024-01-01T12:00:00.000Z", + "expiresAt": "2024-01-01T12:15:00.000Z", + "lastUpdatedAt": "2024-01-01T12:00:00.000Z", + "settledAt": "2024-01-01T12:00:00.000Z" + } + ], + "nextCursor": null, + "stats": { + "totalRevenue": [ + { + "amount": 1000, + "currency": "USD" + } + ], + "totalTransactions": 100, + "totalCustomers": 25 + } + } + } + } + }, + "400": { + "description": "Bad request — invalid parameters or API version", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "invalid_params", + "params_validation", + "invalid_api_version", + "unknown_api_version", + "api_version_downgrade" + ], + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + }, + "issues": { + "description": "Field-level validation issues (present on validation errors)", + "type": "array", + "items": { + "type": "object", + "properties": { + "field": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": ["field", "message"] + } + } + }, + "required": ["message", "code"] + }, + "examples": { + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + }, + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "invalid_api_version": { + "summary": "Invalid API version", + "value": { + "code": "invalid_api_version", + "message": "Invalid API version" + } + }, + "unknown_api_version": { + "summary": "Unknown API version", + "value": { + "code": "unknown_api_version", + "message": "Unknown API version" + } + }, + "api_version_downgrade": { + "summary": "Requested API version is older than the partner pin", + "value": { + "code": "api_version_downgrade", + "message": "Requested API version is older than the partner pin" + } + } + } + } + } + }, + "401": { + "description": "Unauthorized — missing or invalid partner API key", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": ["missing_api_key", "invalid_api_key"], + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": ["message", "code"] + }, + "examples": { + "missing_api_key": { + "summary": "Missing API key", + "value": { + "code": "missing_api_key", + "message": "Missing API key" + } + }, + "invalid_api_key": { + "summary": "Invalid API key", + "value": { + "code": "invalid_api_key", + "message": "Invalid API key" + } + } + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "internal_error", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": ["message", "code"] + }, + "examples": { + "internal_error": { + "summary": "Internal Server Error", + "value": { + "code": "internal_error", + "message": "Internal Server Error" + } + } + } + } + } + } + }, + "tags": ["Payments"], + "summary": "List payments", + "description": "Retrieve paginated payments with optional filters.", + "security": [ + { + "API Key": [] + } + ] + } + } + }, + "components": { + "schemas": { + "MerchantPaymentsResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "paymentId": { + "type": "string", + "description": "Unique payment identifier" + }, + "merchant": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Partner-provided merchant ID" + }, + "name": { + "description": "Merchant display name", + "type": "string" + }, + "iconUrl": { + "description": "Merchant logo URL", + "type": ["string", "null"] + } + }, + "required": ["id"] + }, + "referenceId": { + "type": "string", + "description": "Idempotency / reference ID provided at payment creation" + }, + "status": { + "type": "string", + "enum": ["requires_action", "processing", "succeeded", "failed", "expired", "cancelled"] + }, + "isTerminal": { + "type": "boolean", + "description": "Whether the payment has reached a final state" + }, + "fiatAmount": { + "$ref": "#/components/schemas/MerchantPaymentFiatAmount" + }, + "tokenAmount": { + "$ref": "#/components/schemas/MerchantPaymentTokenAmount" + }, + "buyer": { + "description": "Buyer wallet information", + "type": "object", + "properties": { + "accountCaip10": { + "type": "string", + "description": "Buyer address as a [CAIP-10](https://standards.chainagnostic.org/CAIPs/caip-10) account ID", + "examples": ["eip155:8453:0x1234567890abcdef1234567890abcdef12345678"] + }, + "accountProviderName": { + "description": "Wallet provider name", + "examples": ["MetaMask"], + "type": "string" + }, + "accountProviderIcon": { + "description": "Wallet provider logo URL", + "type": "string" + } + }, + "required": ["accountCaip10"] + }, + "transaction": { + "description": "On-chain transaction details", + "type": "object", + "properties": { + "networkId": { + "type": "string", + "description": "Numeric chain ID", + "examples": ["8453"] + }, + "hash": { + "description": "On-chain transaction hash", + "type": "string" + } + }, + "required": ["networkId"] + }, + "fees": { + "description": "Fee breakdown derived from payment option data. Omitted when total fee data is unavailable.", + "type": "object", + "properties": { + "total": { + "anyOf": [ + { + "$ref": "#/components/schemas/MerchantPaymentFiatAmount" + }, + { + "$ref": "#/components/schemas/MerchantPaymentTokenAmount" + } + ], + "description": "Total fee amount." + }, + "fixed": { + "description": "Fixed fee component.", + "anyOf": [ + { + "$ref": "#/components/schemas/MerchantPaymentFiatAmount" + }, + { + "$ref": "#/components/schemas/MerchantPaymentTokenAmount" + } + ] + }, + "percentage": { + "description": "Percentage fee component as a decimal percentage string, not a ratio. For example, \"0.4\" means 0.4%.", + "type": "string" + } + }, + "required": ["total"] + }, + "settlement": { + "$ref": "#/components/schemas/MerchantPaymentSettlement" + }, + "exchangeRate": { + "$ref": "#/components/schemas/MerchantPaymentExchangeRate" + }, + "refund": { + "$ref": "#/components/schemas/MerchantPaymentRefund" + }, + "paymentUrl": { + "description": "Hosted payment page URL for this payment. The hosted page reflects the payment's current state.", + "type": "string", + "format": "uri" + }, + "createdAt": { + "type": "string", + "description": "ISO 8601 timestamp" + }, + "expiresAt": { + "description": "ISO 8601 timestamp of the payment deadline, present only when the payment has an expiration", + "type": "string" + }, + "lastUpdatedAt": { + "type": "string", + "description": "ISO 8601 timestamp" + }, + "settledAt": { + "description": "ISO 8601 timestamp, present only when `settlement.settled` is `true` and a timestamp is available", + "type": "string" + } + }, + "required": [ + "paymentId", + "merchant", + "referenceId", + "status", + "isTerminal", + "createdAt", + "lastUpdatedAt" + ] + } + }, + "nextCursor": { + "description": "Cursor for the next page, or null if no more results", + "type": ["string", "null"] + }, + "stats": { + "type": "object", + "properties": { + "totalRevenue": { + "type": "array", + "items": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "description": "Revenue amount in currency's standard unit" + }, + "currency": { + "type": "string", + "description": "ISO 4217 currency code", + "examples": ["USD"] + } + }, + "required": ["amount", "currency"] + }, + "description": "Total revenue over succeeded payments, converted to USD. Always exactly one element — a merchant with no volume gets a zero rather than an empty array. Kept as an array for backwards compatibility." + }, + "totalTransactions": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "description": "Total payments matching the query" + }, + "totalCustomers": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "description": "Unique buyers matching the query" + } + }, + "required": ["totalRevenue", "totalTransactions", "totalCustomers"], + "description": "Aggregate statistics for the query" + } + }, + "required": ["data", "nextCursor", "stats"] + }, + "MerchantPaymentFiatAmount": { + "type": "object", + "properties": { + "unit": { + "type": "string", + "pattern": "^iso4217\\/", + "description": "Fiat unit, for example \"iso4217/USD\"" + }, + "value": { + "type": "string", + "description": "Amount in minor units for the fiat currency" + }, + "display": { + "type": "object", + "properties": { + "assetSymbol": { + "type": "string" + }, + "assetName": { + "type": "string" + }, + "decimals": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + } + }, + "required": ["assetSymbol", "assetName", "decimals"], + "description": "Display metadata for fiat-denominated amounts" + } + }, + "required": ["unit", "value", "display"], + "description": "Fiat-denominated amount" + }, + "MerchantPaymentTokenAmount": { + "type": "object", + "properties": { + "unit": { + "type": "string", + "pattern": "^caip19\\/", + "description": "Token unit, for example \"caip19/...\"" + }, + "value": { + "type": "string", + "description": "Amount in minor units for the token asset" + }, + "display": { + "anyOf": [ + { + "type": "object", + "properties": { + "assetSymbol": { + "type": "string" + }, + "assetName": { + "type": "string" + }, + "decimals": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + "iconUrl": { + "type": "string" + }, + "networkName": { + "type": "string" + }, + "networkIconUrl": { + "type": "string" + } + }, + "required": ["assetSymbol", "assetName", "decimals"], + "description": "Display metadata for token-denominated amounts" + }, + { + "type": "null" + } + ] + } + }, + "required": ["unit", "value", "display"], + "description": "Token-denominated amount" + }, + "MerchantPaymentSettlement": { + "description": "Settlement details. Omitted when settlement details cannot be reported yet. When present, `settled` is always included. When `settled` is `false`, no additional settlement fields are returned. When `settled` is `true`, `amount` is included and `txHash` is included when available.", + "type": "object", + "properties": { + "settled": { + "type": "boolean", + "description": "Whether settlement is complete." + }, + "amount": { + "description": "Net settlement amount after fees in the settlement unit. Present when `settled` is `true`.", + "anyOf": [ + { + "$ref": "#/components/schemas/MerchantPaymentFiatAmount" + }, + { + "$ref": "#/components/schemas/MerchantPaymentTokenAmount" + } + ] + }, + "txHash": { + "description": "Settlement transaction hash. Present when `settled` is `true` and an upstream settlement transaction hash is available.", + "type": "string" + } + }, + "required": ["settled"] + }, + "MerchantPaymentExchangeRate": { + "type": "object", + "properties": { + "from": { + "type": "string", + "description": "Unit the payment was priced in", + "examples": ["iso4217/EUR"] + }, + "fromSymbol": { + "type": "string", + "description": "Display symbol for `from`", + "examples": ["EUR"] + }, + "to": { + "type": "string", + "description": "Unit the payment settles in", + "examples": ["caip19/eip155:8453/erc20:0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"] + }, + "toSymbol": { + "type": "string", + "description": "Display symbol for `to`", + "examples": ["USDC"] + }, + "rate": { + "type": "string", + "description": "How many whole `to` units one whole `from` unit converted into, as a decimal string", + "examples": ["1.085"] + } + }, + "required": ["from", "fromSymbol", "to", "toSymbol", "rate"], + "description": "Conversion applied between the payment unit and the settlement unit. Derived from the payment amount and the gross settlement amount (settlement plus fees), so it is the effective rate for this payment rather than a rate quoted independently. Omitted when the payment does not convert, or when the amounts needed to derive it are unavailable." + }, + "MerchantPaymentRefund": { + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Refund state. \"fully_refunded\" is the only value this API emits.", + "examples": ["fully_refunded"] + }, + "fullyRefundedAt": { + "description": "ISO 8601 timestamp when the payment was fully refunded. Present only for fully refunded payments.", + "type": "string" + } + }, + "required": ["status"], + "description": "Refund details. Not currently populated: refund state is not yet projected into the payment read model, so this field is always omitted today. Reserved for a future release." + } + } + } + } +}