diff --git a/AGENTS.md b/AGENTS.md index b13163a..70a8050 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -59,7 +59,7 @@ Before finishing a change, run `pnpm build` for content changes, and `pnpm lint` ## Navigation changes need sign-off - The navbar tabs are fixed: **Apps · Wallets · Payments · Compliance** (plus API Reference on the right, and Network, a hidden tab linked from the top-right of the navbar). Don't add a new tab. If a change adds one anyway, open the PR description with a warning that it adds a new navbar tab, and recommend posting the change in the `#project-docs` Slack channel before merging. -- A PR that adds a new page to the sidebar or the navbar (any new entry in `content/navigation.json` or `links` in `lib/layout.shared.tsx`) needs `@rtomas` and `@Jem-reown` as reviewers: `gh pr create --reviewer rtomas,Jem-reown`, or `gh pr edit --add-reviewer rtomas,Jem-reown` on an existing PR. +- A PR that adds a new page to the sidebar or the navbar (any new entry in `content/navigation.json` or `links` in `lib/layout.shared.tsx`) needs `@rtomas` and `@Jem-reown` as reviewers: `gh pr create --reviewer rtomas,Jem-reown`, or `gh pr edit --add-reviewer rtomas,Jem-reown` on an existing PR. API Reference pages generated by `pnpm generate` are the exception: they don't need these reviewers. ## Frontmatter diff --git a/content/docs/payments/api-reference/2026-02-18/delete-v1-merchants-merchantid-settlements-crypto-id.mdx b/content/docs/payments/api-reference/2026-02-18/delete-v1-merchants-merchantid-settlements-crypto-id.mdx new file mode 100644 index 0000000..6ed11a3 --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-18/delete-v1-merchants-merchantid-settlements-crypto-id.mdx @@ -0,0 +1,7 @@ +--- +title: "Delete a crypto settlement" +_openapi: + method: DELETE +--- + + diff --git a/content/docs/payments/api-reference/2026-02-18/delete-v1-merchants-merchantid-settlements-fiat-id.mdx b/content/docs/payments/api-reference/2026-02-18/delete-v1-merchants-merchantid-settlements-fiat-id.mdx new file mode 100644 index 0000000..34db8d7 --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-18/delete-v1-merchants-merchantid-settlements-fiat-id.mdx @@ -0,0 +1,7 @@ +--- +title: "Delete a fiat settlement" +_openapi: + method: DELETE +--- + + diff --git a/content/docs/payments/api-reference/2026-02-18/delete-v1-merchants-merchantid.mdx b/content/docs/payments/api-reference/2026-02-18/delete-v1-merchants-merchantid.mdx new file mode 100644 index 0000000..9fcae99 --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-18/delete-v1-merchants-merchantid.mdx @@ -0,0 +1,7 @@ +--- +title: "Delete a merchant" +_openapi: + method: DELETE +--- + + diff --git a/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-merchantid-settlements-tokens.mdx b/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-merchantid-settlements-tokens.mdx new file mode 100644 index 0000000..7836b74 --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-merchantid-settlements-tokens.mdx @@ -0,0 +1,7 @@ +--- +title: "List tokens available for settlement" +_openapi: + method: GET +--- + + diff --git a/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-merchantid-settlements.mdx b/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-merchantid-settlements.mdx new file mode 100644 index 0000000..2046ae6 --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-merchantid-settlements.mdx @@ -0,0 +1,7 @@ +--- +title: "List settlements" +_openapi: + method: GET +--- + + diff --git a/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-merchantid.mdx b/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-merchantid.mdx new file mode 100644 index 0000000..c74f571 --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-merchantid.mdx @@ -0,0 +1,7 @@ +--- +title: "Get a merchant" +_openapi: + method: GET +--- + + diff --git a/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-payments.mdx b/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-payments.mdx new file mode 100644 index 0000000..edba46b --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-18/get-v1-merchants-payments.mdx @@ -0,0 +1,7 @@ +--- +title: "List payments for a merchant" +_openapi: + method: GET +--- + + diff --git a/content/docs/payments/api-reference/2026-02-18/get-v1-merchants.mdx b/content/docs/payments/api-reference/2026-02-18/get-v1-merchants.mdx new file mode 100644 index 0000000..2e2272a --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-18/get-v1-merchants.mdx @@ -0,0 +1,7 @@ +--- +title: "List merchants" +_openapi: + method: GET +--- + + diff --git a/content/docs/payments/api-reference/2026-02-18/get-v1-payments.mdx b/content/docs/payments/api-reference/2026-02-18/get-v1-payments.mdx new file mode 100644 index 0000000..816857a --- /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-18/patch-v1-merchants-merchantid-settlements-fiat-id.mdx b/content/docs/payments/api-reference/2026-02-18/patch-v1-merchants-merchantid-settlements-fiat-id.mdx new file mode 100644 index 0000000..61f8fd7 --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-18/patch-v1-merchants-merchantid-settlements-fiat-id.mdx @@ -0,0 +1,7 @@ +--- +title: "Update a fiat settlement" +_openapi: + method: PATCH +--- + + diff --git a/content/docs/payments/api-reference/2026-02-18/patch-v1-merchants-merchantid.mdx b/content/docs/payments/api-reference/2026-02-18/patch-v1-merchants-merchantid.mdx new file mode 100644 index 0000000..30c8e80 --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-18/patch-v1-merchants-merchantid.mdx @@ -0,0 +1,7 @@ +--- +title: "Update a merchant" +_openapi: + method: PATCH +--- + + diff --git a/content/docs/payments/api-reference/2026-02-18/post-v1-merchants-merchantid-settlements-crypto.mdx b/content/docs/payments/api-reference/2026-02-18/post-v1-merchants-merchantid-settlements-crypto.mdx new file mode 100644 index 0000000..8030dbe --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-18/post-v1-merchants-merchantid-settlements-crypto.mdx @@ -0,0 +1,7 @@ +--- +title: "Create crypto settlements" +_openapi: + method: POST +--- + + diff --git a/content/docs/payments/api-reference/2026-02-18/post-v1-merchants-merchantid-settlements-fiat.mdx b/content/docs/payments/api-reference/2026-02-18/post-v1-merchants-merchantid-settlements-fiat.mdx new file mode 100644 index 0000000..ad67ebd --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-18/post-v1-merchants-merchantid-settlements-fiat.mdx @@ -0,0 +1,7 @@ +--- +title: "Create a fiat settlement" +_openapi: + method: POST +--- + + diff --git a/content/docs/payments/api-reference/2026-02-18/post-v1-merchants-payments-paymentid-receipt.mdx b/content/docs/payments/api-reference/2026-02-18/post-v1-merchants-payments-paymentid-receipt.mdx new file mode 100644 index 0000000..5865a04 --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-18/post-v1-merchants-payments-paymentid-receipt.mdx @@ -0,0 +1,7 @@ +--- +title: "Email a payment receipt" +_openapi: + method: POST +--- + + diff --git a/content/docs/payments/api-reference/2026-02-18/post-v1-merchants.mdx b/content/docs/payments/api-reference/2026-02-18/post-v1-merchants.mdx new file mode 100644 index 0000000..9bc69b5 --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-18/post-v1-merchants.mdx @@ -0,0 +1,7 @@ +--- +title: "Create a merchant" +_openapi: + method: POST +--- + + diff --git a/content/docs/payments/api-reference/2026-02-18/post-v1-refunds.mdx b/content/docs/payments/api-reference/2026-02-18/post-v1-refunds.mdx new file mode 100644 index 0000000..dcd452f --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-18/post-v1-refunds.mdx @@ -0,0 +1,7 @@ +--- +title: "Mark a payment as refunded" +_openapi: + method: POST +--- + + diff --git a/content/docs/payments/api-reference/2026-02-18/put-v1-merchants-merchantid-settlements-crypto-id.mdx b/content/docs/payments/api-reference/2026-02-18/put-v1-merchants-merchantid-settlements-crypto-id.mdx new file mode 100644 index 0000000..627b4ea --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-18/put-v1-merchants-merchantid-settlements-crypto-id.mdx @@ -0,0 +1,7 @@ +--- +title: "Update a crypto settlement destination" +_openapi: + method: PUT +--- + + diff --git a/content/docs/payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid-settlements-crypto-id.mdx b/content/docs/payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid-settlements-crypto-id.mdx new file mode 100644 index 0000000..2d0cb45 --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid-settlements-crypto-id.mdx @@ -0,0 +1,7 @@ +--- +title: "Delete a crypto settlement" +_openapi: + method: DELETE +--- + + diff --git a/content/docs/payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid-settlements-fiat-id.mdx b/content/docs/payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid-settlements-fiat-id.mdx new file mode 100644 index 0000000..d28c058 --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid-settlements-fiat-id.mdx @@ -0,0 +1,7 @@ +--- +title: "Delete a fiat settlement" +_openapi: + method: DELETE +--- + + diff --git a/content/docs/payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid.mdx b/content/docs/payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid.mdx new file mode 100644 index 0000000..81fd656 --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid.mdx @@ -0,0 +1,7 @@ +--- +title: "Delete a merchant" +_openapi: + method: DELETE +--- + + diff --git a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid-settlements-tokens.mdx b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid-settlements-tokens.mdx new file mode 100644 index 0000000..854281e --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid-settlements-tokens.mdx @@ -0,0 +1,7 @@ +--- +title: "List tokens available for settlement" +_openapi: + method: GET +--- + + diff --git a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid-settlements.mdx b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid-settlements.mdx new file mode 100644 index 0000000..24acecf --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid-settlements.mdx @@ -0,0 +1,7 @@ +--- +title: "List settlements" +_openapi: + method: GET +--- + + diff --git a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid.mdx b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid.mdx new file mode 100644 index 0000000..29ec420 --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid.mdx @@ -0,0 +1,7 @@ +--- +title: "Get a merchant" +_openapi: + method: GET +--- + + diff --git a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-payments.mdx b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-payments.mdx new file mode 100644 index 0000000..cdd95ea --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants-payments.mdx @@ -0,0 +1,7 @@ +--- +title: "List payments for a merchant" +_openapi: + method: GET +--- + + diff --git a/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants.mdx b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants.mdx new file mode 100644 index 0000000..8d7ab2c --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-19.preview/get-v1-merchants.mdx @@ -0,0 +1,7 @@ +--- +title: "List merchants" +_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 0000000..99a9128 --- /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/docs/payments/api-reference/2026-02-19.preview/patch-v1-merchants-merchantid-settlements-fiat-id.mdx b/content/docs/payments/api-reference/2026-02-19.preview/patch-v1-merchants-merchantid-settlements-fiat-id.mdx new file mode 100644 index 0000000..1b4a13b --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-19.preview/patch-v1-merchants-merchantid-settlements-fiat-id.mdx @@ -0,0 +1,7 @@ +--- +title: "Update a fiat settlement" +_openapi: + method: PATCH +--- + + diff --git a/content/docs/payments/api-reference/2026-02-19.preview/patch-v1-merchants-merchantid.mdx b/content/docs/payments/api-reference/2026-02-19.preview/patch-v1-merchants-merchantid.mdx new file mode 100644 index 0000000..c180537 --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-19.preview/patch-v1-merchants-merchantid.mdx @@ -0,0 +1,7 @@ +--- +title: "Update a merchant" +_openapi: + method: PATCH +--- + + diff --git a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-merchants-merchantid-settlements-crypto.mdx b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-merchants-merchantid-settlements-crypto.mdx new file mode 100644 index 0000000..bd4e3a6 --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-merchants-merchantid-settlements-crypto.mdx @@ -0,0 +1,7 @@ +--- +title: "Create crypto settlements" +_openapi: + method: POST +--- + + diff --git a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-merchants-merchantid-settlements-fiat.mdx b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-merchants-merchantid-settlements-fiat.mdx new file mode 100644 index 0000000..81381fb --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-merchants-merchantid-settlements-fiat.mdx @@ -0,0 +1,7 @@ +--- +title: "Create a fiat settlement" +_openapi: + method: POST +--- + + diff --git a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-merchants-payments-paymentid-receipt.mdx b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-merchants-payments-paymentid-receipt.mdx new file mode 100644 index 0000000..7c78e30 --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-merchants-payments-paymentid-receipt.mdx @@ -0,0 +1,7 @@ +--- +title: "Email a payment receipt" +_openapi: + method: POST +--- + + diff --git a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-merchants.mdx b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-merchants.mdx new file mode 100644 index 0000000..64175d2 --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-merchants.mdx @@ -0,0 +1,7 @@ +--- +title: "Create a merchant" +_openapi: + method: POST +--- + + diff --git a/content/docs/payments/api-reference/2026-02-19.preview/post-v1-refunds.mdx b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-refunds.mdx new file mode 100644 index 0000000..f60c345 --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-19.preview/post-v1-refunds.mdx @@ -0,0 +1,7 @@ +--- +title: "Mark a payment as refunded" +_openapi: + method: POST +--- + + diff --git a/content/docs/payments/api-reference/2026-02-19.preview/put-v1-merchants-merchantid-settlements-crypto-id.mdx b/content/docs/payments/api-reference/2026-02-19.preview/put-v1-merchants-merchantid-settlements-crypto-id.mdx new file mode 100644 index 0000000..19990c2 --- /dev/null +++ b/content/docs/payments/api-reference/2026-02-19.preview/put-v1-merchants-merchantid-settlements-crypto-id.mdx @@ -0,0 +1,7 @@ +--- +title: "Update a crypto settlement destination" +_openapi: + method: PUT +--- + + diff --git a/content/navigation.json b/content/navigation.json index 8c1786d..a8b3683 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", @@ -535,6 +536,32 @@ "payments/api-reference/2026-02-18/post-v1-webhooks-bybit-pay", "payments/api-reference/2026-02-18/post-v1-webhooks-crypto-com-pay" ] + }, + { + "group": "Refunds", + "pages": [ + "payments/api-reference/2026-02-18/post-v1-refunds" + ] + }, + { + "group": "Merchants", + "pages": [ + "payments/api-reference/2026-02-18/get-v1-merchants-payments", + "payments/api-reference/2026-02-18/post-v1-merchants-payments-paymentid-receipt", + "payments/api-reference/2026-02-18/post-v1-merchants", + "payments/api-reference/2026-02-18/get-v1-merchants", + "payments/api-reference/2026-02-18/get-v1-merchants-merchantid", + "payments/api-reference/2026-02-18/patch-v1-merchants-merchantid", + "payments/api-reference/2026-02-18/delete-v1-merchants-merchantid", + "payments/api-reference/2026-02-18/get-v1-merchants-merchantid-settlements", + "payments/api-reference/2026-02-18/get-v1-merchants-merchantid-settlements-tokens", + "payments/api-reference/2026-02-18/post-v1-merchants-merchantid-settlements-crypto", + "payments/api-reference/2026-02-18/put-v1-merchants-merchantid-settlements-crypto-id", + "payments/api-reference/2026-02-18/delete-v1-merchants-merchantid-settlements-crypto-id", + "payments/api-reference/2026-02-18/post-v1-merchants-merchantid-settlements-fiat", + "payments/api-reference/2026-02-18/patch-v1-merchants-merchantid-settlements-fiat-id", + "payments/api-reference/2026-02-18/delete-v1-merchants-merchantid-settlements-fiat-id" + ] } ] }, @@ -562,6 +589,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", @@ -576,6 +604,32 @@ "payments/api-reference/2026-02-19.preview/post-v1-webhooks-bybit-pay", "payments/api-reference/2026-02-19.preview/post-v1-webhooks-crypto-com-pay" ] + }, + { + "group": "Refunds", + "pages": [ + "payments/api-reference/2026-02-19.preview/post-v1-refunds" + ] + }, + { + "group": "Merchants", + "pages": [ + "payments/api-reference/2026-02-19.preview/get-v1-merchants-payments", + "payments/api-reference/2026-02-19.preview/post-v1-merchants-payments-paymentid-receipt", + "payments/api-reference/2026-02-19.preview/post-v1-merchants", + "payments/api-reference/2026-02-19.preview/get-v1-merchants", + "payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid", + "payments/api-reference/2026-02-19.preview/patch-v1-merchants-merchantid", + "payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid", + "payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid-settlements", + "payments/api-reference/2026-02-19.preview/get-v1-merchants-merchantid-settlements-tokens", + "payments/api-reference/2026-02-19.preview/post-v1-merchants-merchantid-settlements-crypto", + "payments/api-reference/2026-02-19.preview/put-v1-merchants-merchantid-settlements-crypto-id", + "payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid-settlements-crypto-id", + "payments/api-reference/2026-02-19.preview/post-v1-merchants-merchantid-settlements-fiat", + "payments/api-reference/2026-02-19.preview/patch-v1-merchants-merchantid-settlements-fiat-id", + "payments/api-reference/2026-02-19.preview/delete-v1-merchants-merchantid-settlements-fiat-id" + ] } ] } diff --git a/openapi/2026-02-18.json b/openapi/2026-02-18.json index 2fd9b5c..ee112c7 100644 --- a/openapi/2026-02-18.json +++ b/openapi/2026-02-18.json @@ -157,7 +157,18 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/gateway/payment/{id}/cancel": { @@ -304,7 +315,18 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/gateway/payment/{id}/confirm": { @@ -488,7 +510,18 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/gateway/payment/{id}/fetch": { @@ -647,7 +680,18 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/gateway/payment/{id}/options": { @@ -819,7 +863,18 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/gateway/payment/{id}/status": { @@ -983,7 +1038,18 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/gateway/payment/{id}/transition": { @@ -1141,7 +1207,18 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/payments": { @@ -1276,7 +1353,508 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] + }, + "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": [ + { + "apiKey": [] + } + ] } }, "/v1/payments/{id}": { @@ -1420,12 +1998,23 @@ } } } - } - } - }, - "/v1/payments/{id}/cancel": { - "post": { - "tags": [ + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] + } + }, + "/v1/payments/{id}/cancel": { + "post": { + "tags": [ "Payments" ], "operationId": "paymentsCancelPayment", @@ -1561,7 +2150,18 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/payments/{id}/status": { @@ -1719,7 +2319,18 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/payments/{id}/transition": { @@ -1871,7 +2482,18 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/webhooks/binance_pay": { @@ -1908,7 +2530,18 @@ "500": { "description": "Internal error (Binance retries)" } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/webhooks/binance_pay_onchain": { @@ -1948,7 +2581,18 @@ "503": { "description": "Webhook verification is not configured (Binance redelivers)" } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/webhooks/bybit_pay": { @@ -1988,7 +2632,18 @@ "503": { "description": "Webhook verification or the Bybit client is not configured, or the configured key is unusable (Bybit redelivers)" } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/webhooks/crypto_com_pay": { @@ -2031,123 +2686,6289 @@ "503": { "description": "Crypto.com Pay is not configured (Crypto.com redelivers)" } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } - } - }, - "tags": [ - { - "name": "Gateway" - }, - { - "name": "Payments" }, - { - "name": "Webhooks" - } - ], - "components": { - "schemas": { - "Action": { - "oneOf": [ + "/v1/refunds": { + "post": { + "operationId": "Refunds_create", + "parameters": [ { - "type": "object", - "description": "An action that requires a wallet RPC call to complete", - "required": [ - "data", - "type" - ], - "properties": { - "data": { - "$ref": "#/components/schemas/WalletRpcAction", - "description": "An action that requires a wallet RPC call to complete" - }, - "type": { - "type": "string", - "enum": [ - "walletRpc" - ] - } + "name": "Merchant-Id", + "in": "header", + "required": true, + "description": "Merchant identifier.", + "schema": { + "type": "string", + "examples": [ + "acme-store-1" + ] } }, { - "type": "object", - "description": "An action that requires building to complete", - "required": [ - "data", - "type" - ], - "properties": { - "data": { - "$ref": "#/components/schemas/Build", - "description": "An action that requires building to complete" - }, - "type": { - "type": "string", - "enum": [ - "build" - ] + "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" + ] + } + } + ], + "responses": { + "200": { + "description": "Payment marked as refunded", + "headers": { + "WCP-Version": { + "description": "WalletConnect Pay API version resolved for this request.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "paymentId": { + "type": "string", + "description": "Payment ID that was marked as refunded" + } + }, + "required": [ + "paymentId" + ] + }, + "example": { + "paymentId": "pay_a1a2ecc101KGF210FP7PN3BK08PZARS1CZ" + } } } }, - { - "type": "object", - "description": "Send an amount to an account. The whole action, with no transaction to\nbuild or sign.", - "required": [ - "data", - "type" - ], - "properties": { - "data": { - "$ref": "#/components/schemas/TransferAction", - "description": "Send an amount to an account. The whole action, with no transaction to\nbuild or sign." - }, - "type": { - "type": "string", - "enum": [ - "transfer" - ] + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "params_validation", + "payment_not_succeeded", + "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": { + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "payment_not_succeeded": { + "summary": "Payment is not in a refundable state", + "value": { + "code": "payment_not_succeeded", + "message": "Payment is not in a refundable state" + } + }, + "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" + } + } + } } } - } - ], - "example": { - "data": { - "chain_id": "eip155:8453", - "method": "eth_signTypedData_v4", - "params": [ - "0x0000000000000000000000000000000000000000", - "{\"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\"}}" - ] }, - "type": "walletRpc" - } - }, - "Amount": { - "type": "object", - "required": [ - "unit", - "value", - "display" - ], - "properties": { - "display": { - "$ref": "#/components/schemas/AmountDisplay", - "description": "Display information for the amount" - }, - "unit": { - "type": "string", - "description": "Currency unit, prefixed with either \"iso4217/\" or \"caip19/\"", - "example": "iso4217/USD" + "401": { + "description": "Unauthorized — missing or invalid API key, or missing merchant id", + "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", + "missing_merchant_id" + ], + "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" + } + }, + "missing_merchant_id": { + "summary": "Missing Merchant ID", + "value": { + "code": "missing_merchant_id", + "message": "Missing Merchant ID" + } + } + } + } + } }, - "value": { - "type": "string", - "description": "Amount value, in the currency unit's minor units" - } - }, - "example": { - "display": { - "assetName": "USD Coin", + "404": { + "description": "Payment not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + }, + "409": { + "description": "Payment is already refunded", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "already_refunded", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "already_refunded": { + "summary": "Payment is already refunded", + "value": { + "code": "already_refunded", + "message": "Payment is already refunded" + } + } + } + } + } + }, + "500": { + "description": "Internal 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" + } + } + } + } + } + }, + "502": { + "description": "Bad gateway", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "bad_gateway", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "bad_gateway": { + "summary": "Bad Gateway", + "value": { + "code": "bad_gateway", + "message": "Bad Gateway" + } + } + } + } + } + } + }, + "tags": [ + "Refunds" + ], + "summary": "Mark a payment as refunded", + "description": "Request a full refund for a payment. Calling a second time on the same payment returns 409.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "paymentId": { + "type": "string", + "minLength": 1, + "maxLength": 64, + "pattern": "^pay_[A-Za-z0-9]+$", + "description": "Payment ID to refund", + "examples": [ + "pay_a1a2ecc101KGF210FP7PN3BK08PZARS1CZ" + ] + } + }, + "required": [ + "paymentId" + ] + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/v1/merchants/payments": { + "get": { + "operationId": "MerchantPayments_list", + "parameters": [ + { + "name": "Merchant-Id", + "in": "header", + "required": true, + "description": "Merchant identifier.", + "schema": { + "type": "string", + "examples": [ + "acme-store-1" + ] + } + }, + { + "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 ` /-:.,+`." + } + ], + "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 API key, or missing merchant id", + "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", + "missing_merchant_id" + ], + "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" + } + }, + "missing_merchant_id": { + "summary": "Missing Merchant ID", + "value": { + "code": "missing_merchant_id", + "message": "Missing Merchant ID" + } + } + } + } + } + }, + "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 for a merchant", + "description": "Retrieve paginated payments with optional filters.", + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/v1/merchants/payments/{paymentId}/receipt": { + "post": { + "operationId": "PaymentReceipts_send", + "parameters": [ + { + "name": "Merchant-Id", + "in": "header", + "required": true, + "description": "Merchant identifier.", + "schema": { + "type": "string", + "examples": [ + "acme-store-1" + ] + } + }, + { + "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": "path", + "name": "paymentId", + "schema": { + "type": "string", + "minLength": 1, + "maxLength": 64, + "pattern": "^pay_[A-Za-z0-9]+$", + "examples": [ + "pay_a1a2ecc101KGF210FP7PN3BK08PZARS1CZ" + ] + }, + "required": true, + "description": "Payment ID to send the receipt for" + } + ], + "responses": { + "200": { + "description": "Receipt sent, or already sent before", + "headers": { + "WCP-Version": { + "description": "WalletConnect Pay API version resolved for this request.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "paymentId": { + "type": "string", + "description": "Payment ID the receipt is for" + }, + "status": { + "type": "string", + "enum": [ + "sent", + "already_sent" + ], + "description": "`sent`: the receipt is on its way. `already_sent`: a receipt for this payment was already sent, so no new email was sent." + } + }, + "required": [ + "paymentId", + "status" + ] + }, + "example": { + "paymentId": "pay_a1a2ecc101KGF210FP7PN3BK08PZARS1CZ", + "status": "sent" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "params_validation", + "payment_not_succeeded", + "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": { + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "payment_not_succeeded": { + "summary": "Payment is not in a refundable state", + "value": { + "code": "payment_not_succeeded", + "message": "Payment is not in a refundable state" + } + }, + "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 API key, or missing merchant id", + "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", + "missing_merchant_id" + ], + "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" + } + }, + "missing_merchant_id": { + "summary": "Missing Merchant ID", + "value": { + "code": "missing_merchant_id", + "message": "Missing Merchant ID" + } + } + } + } + } + }, + "404": { + "description": "Payment not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + }, + "409": { + "description": "The payment has no on-chain transaction to put on a receipt", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "receipt_unavailable", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "receipt_unavailable": { + "summary": "This payment has no on-chain transaction to put on a receipt", + "value": { + "code": "receipt_unavailable", + "message": "This payment has no on-chain transaction to put on a receipt" + } + } + } + } + } + }, + "429": { + "description": "Too many receipt requests", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "rate_limited", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "rate_limited": { + "summary": "Too Many Requests", + "value": { + "code": "rate_limited", + "message": "Too Many Requests" + } + } + } + } + } + }, + "500": { + "description": "Internal 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" + } + } + } + } + } + }, + "502": { + "description": "Receipt service unavailable", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "receipt_service_unavailable", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "receipt_service_unavailable": { + "summary": "The receipt service is unavailable", + "value": { + "code": "receipt_service_unavailable", + "message": "The receipt service is unavailable" + } + } + } + } + } + } + }, + "tags": [ + "Payments" + ], + "summary": "Email a payment receipt", + "description": "Email the receipt for a succeeded payment to the customer. A payment gets at most one receipt: if the customer already received one, no new email is sent and the response status is `already_sent`.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "maxLength": 320, + "format": "email", + "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + "description": "Customer email address to send the receipt to", + "examples": [ + "customer@example.com" + ] + } + }, + "required": [ + "email" + ] + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/v1/merchants": { + "post": { + "operationId": "MerchantManagement_create", + "tags": [ + "Merchant Management" + ], + "summary": "Create a merchant", + "description": "Create a new merchant under the authenticated partner. Requires an `Idempotency-Key` header so retries safely return the originally-created merchant rather than creating duplicates.", + "parameters": [ + { + "name": "Idempotency-Key", + "in": "header", + "required": true, + "description": "Unique key to ensure idempotent request processing. Max 255 characters.", + "schema": { + "type": "string", + "maxLength": 255 + } + } + ], + "responses": { + "201": { + "description": "Merchant created", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "merchant": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Merchant ID", + "examples": [ + "mrch_7kBz2qR9xPvLmN4Yw" + ] + }, + "name": { + "type": "string", + "description": "Merchant display name" + }, + "email": { + "description": "Contact email", + "examples": [ + "billing@acme.store" + ], + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string", + "enum": [ + "active", + "inactive", + "suspended" + ], + "description": "Current merchant status", + "examples": [ + "active" + ] + }, + "mcc": { + "anyOf": [ + { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + { + "type": "null" + } + ], + "description": "ISO 18245 merchant category code, or null if not set", + "examples": [ + 5812 + ] + }, + "createdAt": { + "type": "string", + "description": "ISO 8601 creation timestamp", + "examples": [ + "2025-06-15T10:30:00.000Z" + ] + } + }, + "required": [ + "id", + "name", + "email", + "status", + "mcc", + "createdAt" + ] + } + }, + "required": [ + "merchant" + ] + }, + "example": { + "merchant": { + "id": "mrch_7kBz2qR9xPvLmN4Yw", + "name": "Acme Store", + "email": "billing@acme.store", + "status": "active", + "mcc": 5812, + "createdAt": "2025-06-15T10:30:00.000Z" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "params_validation", + "invalid_params", + "missing_idempotency_key", + "logo_too_small", + "logo_too_large", + "logo_not_square", + "logo_file_too_big", + "logo_invalid_mime", + "logo_invalid_dimensions" + ], + "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": { + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + }, + "missing_idempotency_key": { + "summary": "Missing Idempotency-Key header", + "value": { + "code": "missing_idempotency_key", + "message": "Missing Idempotency-Key header" + } + }, + "logo_too_small": { + "summary": "Logo is too small", + "value": { + "code": "logo_too_small", + "message": "Logo is too small" + } + }, + "logo_too_large": { + "summary": "Logo is too large", + "value": { + "code": "logo_too_large", + "message": "Logo is too large" + } + }, + "logo_not_square": { + "summary": "Logo must be square", + "value": { + "code": "logo_not_square", + "message": "Logo must be square" + } + }, + "logo_file_too_big": { + "summary": "Logo file is too large", + "value": { + "code": "logo_file_too_big", + "message": "Logo file is too large" + } + }, + "logo_invalid_mime": { + "summary": "Logo file type is not supported", + "value": { + "code": "logo_invalid_mime", + "message": "Logo file type is not supported" + } + }, + "logo_invalid_dimensions": { + "summary": "Logo dimensions could not be read", + "value": { + "code": "logo_invalid_dimensions", + "message": "Logo dimensions could not be read" + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + }, + "409": { + "description": "Idempotency conflict", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "idempotency_conflict", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "idempotency_conflict": { + "summary": "Idempotency key conflict: same key was used with a different request body", + "value": { + "code": "idempotency_conflict", + "message": "Idempotency key conflict: same key was used with a different request body" + } + } + } + } + } + }, + "500": { + "description": "Internal 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" + } + } + } + } + } + }, + "502": { + "description": "Bad gateway", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "bad_gateway", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "bad_gateway": { + "summary": "Bad Gateway", + "value": { + "code": "bad_gateway", + "message": "Bad Gateway" + } + } + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "merchantName": { + "type": "string", + "minLength": 2, + "maxLength": 64, + "description": "Display name for the merchant", + "examples": [ + "Acme Store" + ] + }, + "merchantEmail": { + "type": "string", + "format": "email", + "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + "description": "Contact email for the merchant", + "examples": [ + "billing@acme.store" + ] + }, + "iconUrl": { + "default": null, + "description": "Merchant logo URL (HTTPS only), or null to unset. Logo should be square (1:1, ±5%), 500×500px minimum (1024×1024px recommended, 4096×4096px maximum), JPEG/PNG/WebP, up to 2 MB.", + "examples": [ + "https://example.com/logo.png" + ], + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "alwaysCollectData": { + "description": "When true, every checkout forces the buyer to provide compliance data, even repeat buyers whose data is already on file.", + "examples": [ + true + ], + "type": "boolean" + }, + "mcc": { + "default": null, + "description": "ISO 18245 merchant category code describing the merchant's line of business.", + "examples": [ + 5812 + ], + "anyOf": [ + { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "merchantName", + "merchantEmail" + ], + "examples": [ + { + "merchantName": "Acme Store", + "merchantEmail": "billing@acme.store", + "iconUrl": "https://example.com/logo.png" + } + ] + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "get": { + "operationId": "MerchantManagement_list", + "tags": [ + "Merchant Management" + ], + "summary": "List merchants", + "description": "List the partner's merchants. Supports filtering by `status`, free-text `search` over name and ID, and cursor-based pagination via `cursor` and `limit`.", + "responses": { + "200": { + "description": "Merchants list", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "merchants": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Merchant ID", + "examples": [ + "mrch_7kBz2qR9xPvLmN4Yw" + ] + }, + "name": { + "type": "string", + "description": "Merchant display name" + }, + "email": { + "description": "Contact email", + "examples": [ + "billing@acme.store" + ], + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string", + "enum": [ + "active", + "inactive", + "suspended" + ], + "description": "Current merchant status", + "examples": [ + "active" + ] + }, + "iconUrl": { + "description": "Merchant logo URL, or null if not set", + "examples": [ + "https://imagedelivery.net/example/acme-icon.png" + ], + "type": [ + "string", + "null" + ] + }, + "mcc": { + "anyOf": [ + { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + { + "type": "null" + } + ], + "description": "ISO 18245 merchant category code, or null if not set", + "examples": [ + 5812 + ] + }, + "createdAt": { + "type": "string", + "description": "ISO 8601 creation timestamp", + "examples": [ + "2025-06-15T10:30:00.000Z" + ] + } + }, + "required": [ + "id", + "name", + "email", + "status", + "iconUrl", + "mcc", + "createdAt" + ] + } + }, + "totalCount": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "description": "Total number of merchants matching the query (ignoring pagination)" + }, + "nextCursor": { + "description": "Cursor for the next page, or null if no more results", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "merchants", + "totalCount", + "nextCursor" + ] + }, + "example": { + "merchants": [ + { + "id": "mrch_7kBz2qR9xPvLmN4Yw", + "name": "Acme Store", + "email": "billing@acme.store", + "status": "active", + "iconUrl": "https://imagedelivery.net/example/acme-icon.png", + "mcc": 5812, + "createdAt": "2025-06-15T10:30:00.000Z" + }, + { + "id": "mrch_Qx8fTp3YwKjR5vNm2", + "name": "Widget Co", + "email": null, + "status": "active", + "iconUrl": null, + "mcc": null, + "createdAt": "2025-07-01T08:00:00.000Z" + } + ], + "totalCount": 2, + "nextCursor": null + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "params_validation", + "invalid_params" + ], + "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": { + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + } + }, + "parameters": [ + { + "in": "query", + "name": "status", + "schema": { + "type": "string", + "enum": [ + "active", + "inactive", + "suspended" + ] + }, + "description": "Filter by merchant status" + }, + { + "in": "query", + "name": "search", + "schema": { + "examples": [ + "Acme" + ], + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "description": "Search by merchant name or ID (case-insensitive)" + }, + { + "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": { + "default": 20, + "type": "integer", + "minimum": 1, + "maximum": 100 + }, + "description": "Page size (default 20, max 100)" + } + ], + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/v1/merchants/{merchantId}": { + "get": { + "operationId": "MerchantManagement_get", + "tags": [ + "Merchant Management" + ], + "summary": "Get a merchant", + "description": "Fetch a merchant's profile along with its configured `settlements` (crypto and fiat). Crypto settlements use [CAIP-19](https://chainagnostic.org/CAIPs/caip-19) asset IDs and [CAIP-10](https://chainagnostic.org/CAIPs/caip-10) destination accounts.", + "responses": { + "200": { + "description": "Merchant details", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "merchant": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Merchant ID", + "examples": [ + "mrch_7kBz2qR9xPvLmN4Yw" + ] + }, + "name": { + "type": "string", + "description": "Merchant display name" + }, + "email": { + "description": "Contact email", + "examples": [ + "billing@acme.store" + ], + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string", + "enum": [ + "active", + "inactive", + "suspended" + ], + "description": "Current merchant status", + "examples": [ + "active" + ] + }, + "iconUrl": { + "description": "Merchant logo URL, or null if not set", + "examples": [ + "https://imagedelivery.net/example/acme-icon.png" + ], + "type": [ + "string", + "null" + ] + }, + "mcc": { + "anyOf": [ + { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + { + "type": "null" + } + ], + "description": "ISO 18245 merchant category code, or null if not set", + "examples": [ + 5812 + ] + }, + "createdAt": { + "type": "string", + "description": "ISO 8601 creation timestamp", + "examples": [ + "2025-06-15T10:30:00.000Z" + ] + }, + "alwaysCollectData": { + "type": "boolean", + "description": "When true, every checkout forces the buyer to provide compliance data — even repeat buyers whose data is already on file.", + "examples": [ + false + ] + }, + "mtaAddresses": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Transit account addresses, where payments arrive before they settle, as [CAIP-10](https://standards.chainagnostic.org/CAIPs/caip-10) account IDs. One entry per provisioned chain, and chains in a namespace share an address, so entries repeat. Empty when there is no transit account. May be shared across all of a partner's merchants, so they cannot be used to attribute a payment to a single merchant.", + "examples": [ + [ + "eip155:8453:0x1234567890abcdef1234567890abcdef12345678", + "eip155:10:0x1234567890abcdef1234567890abcdef12345678" + ] + ] + }, + "settlements": { + "type": "object", + "properties": { + "crypto": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Crypto settlement ID" + }, + "asset": { + "type": "string", + "description": "[CAIP-19](https://standards.chainagnostic.org/CAIPs/caip-19) asset ID", + "examples": [ + "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" + ] + }, + "destination": { + "type": "string", + "description": "[CAIP-10](https://standards.chainagnostic.org/CAIPs/caip-10) settlement destination", + "examples": [ + "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + ] + }, + "networkName": { + "description": "Display name of the settlement network, or null if the chain is not recognized", + "examples": [ + "Base" + ], + "type": [ + "string", + "null" + ] + }, + "networkLogoUrl": { + "description": "Logo URL for the settlement network (an admin-uploaded logo when set, otherwise the assets-registry fallback), or null if the chain is not recognized", + "examples": [ + "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + ], + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "asset", + "destination", + "networkName", + "networkLogoUrl" + ] + } + }, + "fiat": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Settlement config ID" + }, + "status": { + "type": "string", + "description": "Fiat settlement status" + }, + "bankType": { + "type": "string", + "description": "Bank account type" + } + }, + "required": [ + "id", + "status", + "bankType" + ] + } + }, + "hasSettlementPath": { + "type": "boolean", + "description": "True when the merchant has somewhere for a live payment to settle: a crypto settlement, a fiat settlement config (including one still in setup, and so absent from `fiat` above), or an enabled funding source. Use this rather than the arrays above to decide whether the merchant is payable — they list only what is active. Advisory: pay-core is the authority and rejects a payment it cannot settle with `no_settlement_configuration`." + } + }, + "required": [ + "crypto", + "fiat", + "hasSettlementPath" + ] + } + }, + "required": [ + "id", + "name", + "email", + "status", + "iconUrl", + "mcc", + "createdAt", + "alwaysCollectData", + "mtaAddresses", + "settlements" + ] + } + }, + "required": [ + "merchant" + ] + }, + "example": { + "merchant": { + "id": "mrch_7kBz2qR9xPvLmN4Yw", + "name": "Acme Store", + "email": "billing@acme.store", + "status": "active", + "iconUrl": "https://imagedelivery.net/example/acme-icon.png", + "mcc": 5812, + "createdAt": "2025-06-15T10:30:00.000Z", + "mtaAddresses": [ + "eip155:8453:0x1234567890abcdef1234567890abcdef12345678", + "eip155:10:0x1234567890abcdef1234567890abcdef12345678" + ], + "settlements": { + "crypto": [ + { + "id": "crypto_Xk7nWp8XmQj2YrTv6", + "asset": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "destination": "eip155:8453:0x1234567890abcdef1234567890abcdef12345678", + "networkName": "Base", + "networkLogoUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + ], + "fiat": [ + { + "id": "fiat_Bk4nWp8XmQj2YrTv6", + "status": "active", + "bankType": "ACH" + } + ] + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "security": [ + { + "apiKey": [] + } + ] + }, + "patch": { + "operationId": "MerchantManagement_update", + "tags": [ + "Merchant Management" + ], + "summary": "Update a merchant", + "description": "Update a merchant's profile. At least one of `merchantName`, `merchantEmail`, `iconUrl`, `alwaysCollectData`, or `mcc` must be provided. Pass `iconUrl: null` to unset the existing logo, and `mcc: null` to unset the merchant category code.", + "responses": { + "200": { + "description": "Merchant updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "merchant": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Merchant ID", + "examples": [ + "mrch_7kBz2qR9xPvLmN4Yw" + ] + }, + "name": { + "type": "string", + "description": "Merchant display name" + }, + "email": { + "description": "Contact email", + "examples": [ + "billing@acme.store" + ], + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string", + "enum": [ + "active", + "inactive", + "suspended" + ], + "description": "Current merchant status", + "examples": [ + "active" + ] + }, + "iconUrl": { + "description": "Merchant logo URL, or null if not set", + "examples": [ + "https://imagedelivery.net/example/acme-icon.png" + ], + "type": [ + "string", + "null" + ] + }, + "mcc": { + "anyOf": [ + { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + { + "type": "null" + } + ], + "description": "ISO 18245 merchant category code, or null if not set", + "examples": [ + 5812 + ] + }, + "createdAt": { + "type": "string", + "description": "ISO 8601 creation timestamp", + "examples": [ + "2025-06-15T10:30:00.000Z" + ] + } + }, + "required": [ + "id", + "name", + "email", + "status", + "iconUrl", + "mcc", + "createdAt" + ] + } + }, + "required": [ + "merchant" + ] + }, + "example": { + "merchant": { + "id": "mrch_7kBz2qR9xPvLmN4Yw", + "name": "Acme Store v2", + "email": "billing@acme.store", + "status": "active", + "iconUrl": "https://imagedelivery.net/example/acme-icon.png", + "mcc": 5812, + "createdAt": "2025-06-15T10:30:00.000Z" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "params_validation", + "invalid_params", + "logo_too_small", + "logo_too_large", + "logo_not_square", + "logo_file_too_big", + "logo_invalid_mime", + "logo_invalid_dimensions" + ], + "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": { + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + }, + "logo_too_small": { + "summary": "Logo is too small", + "value": { + "code": "logo_too_small", + "message": "Logo is too small" + } + }, + "logo_too_large": { + "summary": "Logo is too large", + "value": { + "code": "logo_too_large", + "message": "Logo is too large" + } + }, + "logo_not_square": { + "summary": "Logo must be square", + "value": { + "code": "logo_not_square", + "message": "Logo must be square" + } + }, + "logo_file_too_big": { + "summary": "Logo file is too large", + "value": { + "code": "logo_file_too_big", + "message": "Logo file is too large" + } + }, + "logo_invalid_mime": { + "summary": "Logo file type is not supported", + "value": { + "code": "logo_invalid_mime", + "message": "Logo file type is not supported" + } + }, + "logo_invalid_dimensions": { + "summary": "Logo dimensions could not be read", + "value": { + "code": "logo_invalid_dimensions", + "message": "Logo dimensions could not be read" + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "merchantName": { + "description": "Updated display name", + "examples": [ + "Acme Store v2" + ], + "type": "string", + "minLength": 2, + "maxLength": 64 + }, + "merchantEmail": { + "description": "Updated contact email", + "examples": [ + "new-billing@acme.store" + ], + "type": "string", + "format": "email", + "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" + }, + "iconUrl": { + "description": "Updated logo URL (HTTPS only), or null to unset. Logo should be square (1:1, ±5%), 500×500px minimum (1024×1024px recommended, 4096×4096px maximum), JPEG/PNG/WebP, up to 2 MB.", + "examples": [ + "https://example.com/new-logo.png" + ], + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "alwaysCollectData": { + "description": "When true, every checkout forces the buyer to provide compliance data, even repeat buyers whose data is already on file.", + "examples": [ + true + ], + "type": "boolean" + }, + "mcc": { + "description": "Updated ISO 18245 merchant category code, or null to unset.", + "examples": [ + 5812 + ], + "anyOf": [ + { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + { + "type": "null" + } + ] + } + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "operationId": "MerchantManagement_delete", + "tags": [ + "Merchant Management" + ], + "summary": "Delete a merchant", + "description": "Soft-delete a merchant. The merchant is hidden from listings and can no longer accept new payments. Already-deleted merchants return `deleted: true` so the call is idempotent.", + "responses": { + "200": { + "description": "Merchant deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Merchant ID" + }, + "deleted": { + "type": "boolean", + "description": "Whether the merchant was successfully deleted" + } + }, + "required": [ + "id", + "deleted" + ] + }, + "example": { + "id": "mrch_7kBz2qR9xPvLmN4Yw", + "deleted": true + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/v1/merchants/{merchantId}/settlements": { + "get": { + "operationId": "Settlements_list", + "tags": [ + "Settlements" + ], + "summary": "List settlements", + "description": "List the merchant's configured fiat and crypto settlement destinations.", + "responses": { + "200": { + "description": "Settlements list", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "fiat": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Fiat settlement ID", + "examples": [ + "fiat_Bk4nWp8XmQj2YrTv6" + ] + }, + "status": { + "type": "string", + "description": "Fiat settlement status. Collapses the KYB lifecycle into broad partner-facing states (`pending_kyb`, `action_required`, `active`, `rejected`). See `kybStatus` for the raw KYB state.", + "examples": [ + "active" + ] + }, + "kybStatus": { + "description": "Raw KYB lifecycle state from the verification provider. Distinguishes `collecting_info` (waiting on merchant to start) from `pending` (verification in flight) — both collapse to `pending_kyb` under `status`. `null` when no KYB case is linked.", + "examples": [ + "pending" + ], + "type": [ + "string", + "null" + ] + }, + "kybUrl": { + "description": "URL the merchant must visit to continue verification: Iron's hosted identity flow during KYB, or our hosted token-gated signing page once Iron requires document signatures. `null` when no merchant action is pending.", + "examples": [ + "https://kyb.iron.io/verify/abc123" + ], + "type": [ + "string", + "null" + ] + }, + "bankType": { + "type": "string", + "const": "SEPA", + "description": "Bank account type" + }, + "bankName": { + "type": "string", + "description": "Display name of the bank.", + "examples": [ + "BNP Paribas" + ] + }, + "bankCountry": { + "type": "string", + "description": "ISO 3166-1 alpha-2 country code of the bank.", + "examples": [ + "FR" + ] + }, + "accountHolderName": { + "description": "Account holder name as recorded on the bank account.", + "examples": [ + "Acme Corp SAS" + ], + "type": [ + "string", + "null" + ] + }, + "ibanLast4": { + "type": "string", + "description": "Last 4 characters of the IBAN. The full IBAN is never returned over the API.", + "examples": [ + "0189" + ] + } + }, + "required": [ + "id", + "status", + "kybStatus", + "kybUrl", + "bankType", + "bankName", + "bankCountry", + "accountHolderName", + "ibanLast4" + ] + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Fiat settlement ID", + "examples": [ + "fiat_Bk4nWp8XmQj2YrTv6" + ] + }, + "status": { + "type": "string", + "description": "Fiat settlement status. Collapses the KYB lifecycle into broad partner-facing states (`pending_kyb`, `action_required`, `active`, `rejected`). See `kybStatus` for the raw KYB state.", + "examples": [ + "active" + ] + }, + "kybStatus": { + "description": "Raw KYB lifecycle state from the verification provider. Distinguishes `collecting_info` (waiting on merchant to start) from `pending` (verification in flight) — both collapse to `pending_kyb` under `status`. `null` when no KYB case is linked.", + "examples": [ + "pending" + ], + "type": [ + "string", + "null" + ] + }, + "kybUrl": { + "description": "URL the merchant must visit to continue verification: Iron's hosted identity flow during KYB, or our hosted token-gated signing page once Iron requires document signatures. `null` when no merchant action is pending.", + "examples": [ + "https://kyb.iron.io/verify/abc123" + ], + "type": [ + "string", + "null" + ] + }, + "bankType": { + "type": "string", + "const": "ACH", + "description": "Bank account type" + }, + "bankName": { + "type": "string", + "description": "Display name of the bank.", + "examples": [ + "Chase" + ] + }, + "bankCountry": { + "type": "string", + "description": "ISO 3166-1 alpha-2 country code of the bank.", + "examples": [ + "US" + ] + }, + "accountHolderName": { + "description": "Account holder name as recorded on the bank account.", + "examples": [ + "Acme Corp Inc" + ], + "type": [ + "string", + "null" + ] + }, + "routingNumber": { + "type": "string", + "description": "ABA routing number. Returned in full — it identifies the bank, not the account.", + "examples": [ + "021000021" + ] + }, + "accountLast4": { + "type": "string", + "description": "Last 4 characters of the bank account number. The full account number is never returned over the API.", + "examples": [ + "6789" + ] + } + }, + "required": [ + "id", + "status", + "kybStatus", + "kybUrl", + "bankType", + "bankName", + "bankCountry", + "accountHolderName", + "routingNumber", + "accountLast4" + ] + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Fiat settlement ID", + "examples": [ + "fiat_Bk4nWp8XmQj2YrTv6" + ] + }, + "status": { + "type": "string", + "description": "Fiat settlement status. Collapses the KYB lifecycle into broad partner-facing states (`pending_kyb`, `action_required`, `active`, `rejected`). See `kybStatus` for the raw KYB state.", + "examples": [ + "active" + ] + }, + "kybStatus": { + "description": "Raw KYB lifecycle state from the verification provider. Distinguishes `collecting_info` (waiting on merchant to start) from `pending` (verification in flight) — both collapse to `pending_kyb` under `status`. `null` when no KYB case is linked.", + "examples": [ + "pending" + ], + "type": [ + "string", + "null" + ] + }, + "kybUrl": { + "description": "URL the merchant must visit to continue verification: Iron's hosted identity flow during KYB, or our hosted token-gated signing page once Iron requires document signatures. `null` when no merchant action is pending.", + "examples": [ + "https://kyb.iron.io/verify/abc123" + ], + "type": [ + "string", + "null" + ] + }, + "bankType": { + "type": "string", + "const": "unknown", + "description": "Bank account type. `unknown` when no bank account is linked yet." + } + }, + "required": [ + "id", + "status", + "kybStatus", + "kybUrl", + "bankType" + ] + } + ] + }, + "description": "Fiat settlement configurations attached to the merchant." + }, + "crypto": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Crypto settlement ID", + "examples": [ + "crypto_Xk7nWp8XmQj2YrTv6" + ] + }, + "asset": { + "type": "string", + "description": "[CAIP-19](https://chainagnostic.org/CAIPs/caip-19) asset identifier", + "examples": [ + "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" + ] + }, + "destination": { + "type": "string", + "description": "[CAIP-10](https://chainagnostic.org/CAIPs/caip-10) destination wallet", + "examples": [ + "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + ] + }, + "networkName": { + "description": "Display name of the settlement network, or null if the chain is not recognized", + "examples": [ + "Base" + ], + "type": [ + "string", + "null" + ] + }, + "networkLogoUrl": { + "description": "Logo URL for the settlement network (an admin-uploaded logo when set, otherwise the assets-registry fallback), or null if the chain is not recognized", + "examples": [ + "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + ], + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "asset", + "destination", + "networkName", + "networkLogoUrl" + ] + }, + "description": "Crypto settlement destinations attached to the merchant." + } + }, + "required": [ + "fiat", + "crypto" + ] + }, + "example": { + "fiat": [ + { + "id": "fiat_Bk4nWp8XmQj2YrTv6", + "status": "active", + "kybStatus": "approved", + "kybUrl": null, + "bankType": "ACH", + "bankName": "Chase", + "bankCountry": "US", + "accountHolderName": "Acme Corp Inc", + "routingNumber": "021000021", + "accountLast4": "6789" + } + ], + "crypto": [ + { + "id": "crypto_Xk7nWp8XmQj2YrTv6", + "asset": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "destination": "eip155:8453:0x1234567890abcdef1234567890abcdef12345678", + "networkName": "Base", + "networkLogoUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/v1/merchants/{merchantId}/settlements/tokens": { + "get": { + "operationId": "Settlements_listAvailableTokens", + "tags": [ + "Settlements" + ], + "summary": "List tokens available for settlement", + "description": "List the tokens this merchant may currently settle in, freshly resolved per request: every asset returned passes the `token_not_enabled` gate on the crypto settlement write endpoints. Derive settlement requests from this list rather than from a platform-wide catalogue. Tokens on a chain where payments are not rolled out for this merchant yet are left out, and the create endpoint rejects them with `token_not_enabled`. This part can lag a rollout change by up to a minute. An asset that already has a settlement pair, in any status, still returns `settlement_asset_conflict` on create. `internal_error` means enablement could not be resolved — retry shortly.", + "responses": { + "200": { + "description": "Tokens available for settlement", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tokens": { + "type": "array", + "items": { + "type": "object", + "properties": { + "asset": { + "type": "string", + "description": "[CAIP-19](https://chainagnostic.org/CAIPs/caip-19) asset identifier", + "examples": [ + "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" + ] + }, + "caip2ChainId": { + "type": "string", + "description": "[CAIP-2](https://chainagnostic.org/CAIPs/caip-2) chain the token settles on", + "examples": [ + "eip155:8453" + ] + }, + "symbol": { + "type": "string", + "description": "Token symbol", + "examples": [ + "USDC" + ] + }, + "name": { + "type": "string", + "description": "Token display name", + "examples": [ + "USD Coin" + ] + }, + "decimals": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "description": "Token decimals", + "examples": [ + 6 + ] + }, + "logoUrl": { + "description": "Token logo URL, or null when none is registered", + "examples": [ + "https://api.walletconnect.com/assets/v1/image/token/USDC/md" + ], + "type": [ + "string", + "null" + ] + }, + "networkName": { + "description": "Display name of the settlement network, or null if the chain is not recognized", + "examples": [ + "Base" + ], + "type": [ + "string", + "null" + ] + }, + "networkLogoUrl": { + "description": "Logo URL for the settlement network (an admin-uploaded logo when set, otherwise the assets-registry fallback), or null if the chain is not recognized", + "examples": [ + "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + ], + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "asset", + "caip2ChainId", + "symbol", + "name", + "decimals", + "logoUrl", + "networkName", + "networkLogoUrl" + ] + }, + "description": "Tokens the merchant may settle in. Empty when no tokens are currently enabled for this merchant." + } + }, + "required": [ + "tokens" + ] + }, + "example": { + "tokens": [ + { + "asset": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "caip2ChainId": "eip155:8453", + "symbol": "USDC", + "name": "USD Coin", + "decimals": 6, + "logoUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md", + "networkName": "Base", + "networkLogoUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + ] + } + } + } + }, + "400": { + "description": "Settlement management is not available for test partners", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "invalid_params", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + }, + "404": { + "description": "Merchant not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + }, + "500": { + "description": "Token enablement could not be resolved", + "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" + } + } + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/v1/merchants/{merchantId}/settlements/crypto": { + "post": { + "operationId": "CryptoSettlement_create", + "tags": [ + "Crypto Settlement" + ], + "summary": "Create crypto settlements", + "description": "Register one or more crypto settlement destinations for the merchant. Each entry pairs a [CAIP-19](https://chainagnostic.org/CAIPs/caip-19) `asset` with a [CAIP-10](https://chainagnostic.org/CAIPs/caip-10) `destination` wallet on the same chain. Each `(merchant, asset)` pair must be unique — registering the same asset twice returns `settlement_asset_conflict`. Crypto and fiat settlements can coexist on the same merchant. Assets must be enabled for the merchant; if any is not, the whole request is rejected with `token_not_enabled` naming every offending asset. An asset on a chain where payments are not rolled out for this merchant yet is rejected the same way. Stellar destinations must be ready to receive their asset — the account must exist on the ledger and hold a trustline for the asset's issuer — otherwise the request is rejected with `settlement_destination_not_ready`.", + "parameters": [ + { + "name": "Idempotency-Key", + "in": "header", + "required": true, + "description": "Unique key to ensure idempotent request processing. Max 255 characters.", + "schema": { + "type": "string", + "maxLength": 255 + } + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "responses": { + "201": { + "description": "Crypto settlements created", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "settlements": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Crypto settlement ID", + "examples": [ + "crypto_Xk7nWp8XmQj2YrTv6" + ] + }, + "asset": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "pattern": "^[-a-zA-Z0-9]{3,8}:[-a-zA-Z0-9]{1,32}\\/[-a-zA-Z0-9]{3,8}:[-a-zA-Z0-9]{1,128}$", + "description": "[CAIP-19](https://chainagnostic.org/CAIPs/caip-19) asset identifier for the token to settle in. Format: `:/:`. For example, USDC on Base is `eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`.", + "examples": [ + "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" + ] + }, + "destination": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "pattern": "^[-a-zA-Z0-9]{3,8}:[-a-zA-Z0-9]{1,32}:[-a-zA-Z0-9]{1,128}$", + "description": "[CAIP-10](https://chainagnostic.org/CAIPs/caip-10) account identifier for the wallet that should receive the settled funds. Format: `::
`. The chain (`:`) must match the chain of the corresponding `asset`.", + "examples": [ + "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + ] + } + }, + "required": [ + "id", + "asset", + "destination" + ] + } + } + }, + "required": [ + "settlements" + ] + }, + "example": { + "settlements": [ + { + "id": "crypto_Xk7nWp8XmQj2YrTv6", + "asset": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "destination": "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + } + ] + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "params_validation", + "invalid_params", + "missing_idempotency_key", + "token_not_enabled" + ], + "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": { + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + }, + "missing_idempotency_key": { + "summary": "Missing Idempotency-Key header", + "value": { + "code": "missing_idempotency_key", + "message": "Missing Idempotency-Key header" + } + }, + "token_not_enabled": { + "summary": "This token is not enabled for this merchant yet", + "value": { + "code": "token_not_enabled", + "message": "This token is not enabled for this merchant yet" + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + }, + "404": { + "description": "Merchant not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "idempotency_conflict", + "settlement_asset_conflict", + "settlement_destination_not_ready" + ], + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "idempotency_conflict": { + "summary": "Idempotency key conflict: same key was used with a different request body", + "value": { + "code": "idempotency_conflict", + "message": "Idempotency key conflict: same key was used with a different request body" + } + }, + "settlement_asset_conflict": { + "summary": "A settlement already exists for this asset", + "value": { + "code": "settlement_asset_conflict", + "message": "A settlement already exists for this asset" + } + }, + "settlement_destination_not_ready": { + "summary": "The settlement destination is not ready to receive this asset on its network", + "value": { + "code": "settlement_destination_not_ready", + "message": "The settlement destination is not ready to receive this asset on its network" + } + } + } + } + } + }, + "502": { + "description": "Stellar destination check or transit account provisioning failed; retry shortly", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "bad_gateway", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "bad_gateway": { + "summary": "Bad Gateway", + "value": { + "code": "bad_gateway", + "message": "Bad Gateway" + } + } + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "settlements": { + "minItems": 1, + "maxItems": 50, + "type": "array", + "items": { + "type": "object", + "properties": { + "asset": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "pattern": "^[-a-zA-Z0-9]{3,8}:[-a-zA-Z0-9]{1,32}\\/[-a-zA-Z0-9]{3,8}:[-a-zA-Z0-9]{1,128}$", + "description": "[CAIP-19](https://chainagnostic.org/CAIPs/caip-19) asset identifier for the token to settle in. Format: `:/:`. For example, USDC on Base is `eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`.", + "examples": [ + "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" + ] + }, + "destination": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "pattern": "^[-a-zA-Z0-9]{3,8}:[-a-zA-Z0-9]{1,32}:[-a-zA-Z0-9]{1,128}$", + "description": "[CAIP-10](https://chainagnostic.org/CAIPs/caip-10) account identifier for the wallet that should receive the settled funds. Format: `::
`. The chain (`:`) must match the chain of the corresponding `asset`.", + "examples": [ + "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + ] + } + }, + "required": [ + "asset", + "destination" + ] + }, + "description": "List of asset/destination pairs to register. Up to 50 entries per request." + } + }, + "required": [ + "settlements" + ], + "examples": [ + { + "settlements": [ + { + "asset": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "destination": "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + }, + { + "asset": "eip155:1/erc20:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "destination": "eip155:1:0x1234567890abcdef1234567890abcdef12345678" + } + ] + } + ] + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/v1/merchants/{merchantId}/settlements/crypto/{id}": { + "put": { + "operationId": "CryptoSettlement_update", + "tags": [ + "Crypto Settlement" + ], + "summary": "Update a crypto settlement destination", + "description": "Change the destination wallet for an existing crypto settlement. The new `destination` must be a [CAIP-10](https://chainagnostic.org/CAIPs/caip-10) account on the same chain as the settlement's `asset`.", + "responses": { + "200": { + "description": "Settlement updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Crypto settlement ID", + "examples": [ + "crypto_Xk7nWp8XmQj2YrTv6" + ] + }, + "asset": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "pattern": "^[-a-zA-Z0-9]{3,8}:[-a-zA-Z0-9]{1,32}\\/[-a-zA-Z0-9]{3,8}:[-a-zA-Z0-9]{1,128}$", + "description": "[CAIP-19](https://chainagnostic.org/CAIPs/caip-19) asset identifier for the token to settle in. Format: `:/:`. For example, USDC on Base is `eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`.", + "examples": [ + "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" + ] + }, + "destination": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "pattern": "^[-a-zA-Z0-9]{3,8}:[-a-zA-Z0-9]{1,32}:[-a-zA-Z0-9]{1,128}$", + "description": "[CAIP-10](https://chainagnostic.org/CAIPs/caip-10) account identifier for the wallet that should receive the settled funds. Format: `::
`. The chain (`:`) must match the chain of the corresponding `asset`.", + "examples": [ + "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + ] + } + }, + "required": [ + "id", + "asset", + "destination" + ] + }, + "example": { + "id": "crypto_Xk7nWp8XmQj2YrTv6", + "asset": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "destination": "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "params_validation", + "invalid_params" + ], + "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": { + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + } + } + } + } + }, + "404": { + "description": "Settlement not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + }, + "409": { + "description": "Destination not ready to receive the asset", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "settlement_destination_not_ready", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "settlement_destination_not_ready": { + "summary": "The settlement destination is not ready to receive this asset on its network", + "value": { + "code": "settlement_destination_not_ready", + "message": "The settlement destination is not ready to receive this asset on its network" + } + } + } + } + } + }, + "502": { + "description": "Stellar destination check or transit account provisioning failed; retry shortly", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "bad_gateway", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "bad_gateway": { + "summary": "Bad Gateway", + "value": { + "code": "bad_gateway", + "message": "Bad Gateway" + } + } + } + } + } + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "examples": [ + "crypto_Xk7nWp8XmQj2YrTv6" + ] + }, + "required": true, + "description": "Crypto settlement ID" + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "destination": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "pattern": "^[-a-zA-Z0-9]{3,8}:[-a-zA-Z0-9]{1,32}:[-a-zA-Z0-9]{1,128}$", + "description": "[CAIP-10](https://chainagnostic.org/CAIPs/caip-10) account identifier for the wallet that should receive the settled funds. Format: `::
`. The chain (`:`) must match the chain of the corresponding `asset`.", + "examples": [ + "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + ] + } + }, + "required": [ + "destination" + ], + "examples": [ + { + "destination": "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + } + ] + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "operationId": "CryptoSettlement_delete", + "tags": [ + "Crypto Settlement" + ], + "summary": "Delete a crypto settlement", + "description": "Remove a crypto settlement. Future payments in the deleted asset will no longer be auto-settled.", + "responses": { + "200": { + "description": "Settlement deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Crypto settlement ID" + }, + "deleted": { + "type": "boolean", + "description": "Whether the settlement was successfully deleted" + } + }, + "required": [ + "id", + "deleted" + ] + }, + "example": { + "id": "crypto_Xk7nWp8XmQj2YrTv6", + "deleted": true + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "invalid_params", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + } + } + } + } + }, + "404": { + "description": "Settlement not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "examples": [ + "crypto_Xk7nWp8XmQj2YrTv6" + ] + }, + "required": true, + "description": "Crypto settlement ID" + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/v1/merchants/{merchantId}/settlements/fiat": { + "post": { + "operationId": "FiatSettlement_create", + "tags": [ + "Fiat Settlement" + ], + "summary": "Create a fiat settlement", + "description": "Register a fiat settlement route for the merchant and kick off KYB verification. The response includes a `kybUrl` that the partner must surface to their merchant — fiat routing is only fully activated once KYB is approved. Currency is determined by `bankType`: SEPA settles in EUR, ACH in USD. ACH additionally requires a US business address and a valid US state code. Re-submitting with the same `Idempotency-Key` returns the original result; submitting a different payload under the same key returns `idempotency_conflict`. Attempting to register a bank account that already exists for the merchant returns `settlement_conflict` — delete the existing settlement first or update it via PATCH.", + "parameters": [ + { + "name": "Idempotency-Key", + "in": "header", + "required": true, + "description": "Unique key to ensure idempotent request processing. Max 255 characters.", + "schema": { + "type": "string", + "maxLength": 255 + } + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "responses": { + "201": { + "description": "Fiat settlement created. The merchant must complete KYB at `kybUrl` to activate routing.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Fiat settlement ID. Stable identifier — safe to persist on the partner side.", + "examples": [ + "fiat_Bk4nWp8XmQj2YrTv6" + ] + }, + "status": { + "type": "string", + "description": "Fiat settlement status. `pending_kyb` immediately after creation — the merchant must complete KYB at `kybUrl` before payments can route to this account. Transitions to `active` on KYB approval; `rejected` if KYB fails.", + "examples": [ + "pending_kyb" + ] + }, + "kybUrl": { + "description": "URL the merchant must visit to complete KYB verification. Returned at creation; treat as short-lived (hours to days). `null` only when no merchant action is pending.", + "examples": [ + "https://kyb.iron.io/verify/abc123" + ], + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "status", + "kybUrl" + ] + }, + "example": { + "id": "fiat_Bk4nWp8XmQj2YrTv6", + "status": "pending_kyb", + "kybUrl": "https://kyb.iron.io/verify/abc123" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "params_validation", + "invalid_params", + "missing_idempotency_key" + ], + "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": { + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + }, + "missing_idempotency_key": { + "summary": "Missing Idempotency-Key header", + "value": { + "code": "missing_idempotency_key", + "message": "Missing Idempotency-Key header" + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + }, + "404": { + "description": "Merchant not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "idempotency_conflict", + "settlement_conflict" + ], + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "idempotency_conflict": { + "summary": "Idempotency key conflict: same key was used with a different request body", + "value": { + "code": "idempotency_conflict", + "message": "Idempotency key conflict: same key was used with a different request body" + } + }, + "settlement_conflict": { + "summary": "A settlement with conflicting details already exists for this merchant", + "value": { + "code": "settlement_conflict", + "message": "A settlement with conflicting details already exists for this merchant" + } + } + } + } + } + }, + "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" + } + } + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "bankDetails": { + "oneOf": [ + { + "type": "object", + "properties": { + "accountHolderName": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "Account holder name as it appears on the bank account. Usually matches the legal business name.", + "examples": [ + "Acme Corp Inc" + ] + }, + "bankName": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "Display name of the bank that holds the account.", + "examples": [ + "Chase" + ] + }, + "bankCountry": { + "description": "ISO 3166-1 alpha-2 country code of the bank.", + "type": "string", + "minLength": 2, + "maxLength": 2 + }, + "bankType": { + "type": "string", + "const": "SEPA", + "description": "Bank account type. `SEPA` settles in EUR via the SEPA network." + }, + "iban": { + "type": "string", + "minLength": 15, + "maxLength": 34, + "pattern": "^[A-Z]{2}[0-9]{2}[A-Z0-9]+$", + "description": "International Bank Account Number (ISO 13616). Uppercase alphanumeric with no spaces. Validated for format and mod-97 checksum.", + "examples": [ + "FR1420041010050500013M02606" + ] + } + }, + "required": [ + "accountHolderName", + "bankName", + "bankCountry", + "bankType", + "iban" + ], + "description": "SEPA bank account details. Settles in EUR." + }, + { + "type": "object", + "properties": { + "accountHolderName": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "Account holder name as it appears on the bank account. Usually matches the legal business name.", + "examples": [ + "Acme Corp Inc" + ] + }, + "bankName": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "Display name of the bank that holds the account.", + "examples": [ + "Chase" + ] + }, + "bankCountry": { + "description": "ISO 3166-1 alpha-2 country code of the bank.", + "type": "string", + "minLength": 2, + "maxLength": 2 + }, + "bankType": { + "type": "string", + "const": "ACH", + "description": "Bank account type. `ACH` settles in USD via the US ACH network." + }, + "accountNumber": { + "type": "string", + "minLength": 1, + "pattern": "^[0-9A-Z]{4,17}$", + "description": "US bank account number. 4–17 uppercase letters or digits.", + "examples": [ + "000123456789" + ] + }, + "routingNumber": { + "type": "string", + "minLength": 1, + "pattern": "^[0-9]{9}$", + "description": "9-digit ABA routing number identifying the US bank. Validated for ABA checksum.", + "examples": [ + "021000021" + ] + }, + "phoneNumber": { + "type": "string", + "pattern": "^\\+1[2-9]\\d{2}[2-9]\\d{6}$", + "description": "Business phone number in E.164 format. Required by Iron for ACH onboarding compliance.", + "examples": [ + "+14155551234" + ] + } + }, + "required": [ + "accountHolderName", + "bankName", + "bankCountry", + "bankType", + "accountNumber", + "routingNumber", + "phoneNumber" + ], + "description": "ACH bank account details. Settles in USD. Requires a US business address." + } + ], + "description": "Bank account that will receive fiat settlements. `bankType` discriminates the schema: SEPA requires `iban`; ACH requires `accountNumber`, `routingNumber`, and `phoneNumber`. Currency is implicit — SEPA settles in EUR, ACH in USD." + }, + "businessDetails": { + "type": "object", + "properties": { + "businessName": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "Legal name of the business that operates the merchant account.", + "examples": [ + "Acme Corp Inc" + ] + }, + "address": { + "type": "object", + "properties": { + "line1": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "Street address line 1.", + "examples": [ + "350 Fifth Avenue" + ] + }, + "line2": { + "description": "Optional second address line (suite, apartment, building, etc.). Empty strings are treated as omitted.", + "type": "string", + "maxLength": 255 + }, + "city": { + "type": "string", + "minLength": 2, + "maxLength": 255, + "description": "City or locality.", + "examples": [ + "New York" + ] + }, + "state": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "State, province, or region. For ACH this must be a valid US state or territory 2-letter code (e.g. `NY`).", + "examples": [ + "NY" + ] + }, + "country": { + "description": "ISO 3166-1 alpha-2 country code of the business address. Must be `US` when `bankType` is `ACH`.", + "type": "string", + "minLength": 2, + "maxLength": 2 + }, + "zip": { + "type": "string", + "minLength": 1, + "maxLength": 20, + "description": "Postal or ZIP code.", + "examples": [ + "10118" + ] + } + }, + "required": [ + "line1", + "city", + "state", + "country", + "zip" + ], + "description": "Registered business address used for KYB verification." + } + }, + "required": [ + "businessName", + "address" + ], + "description": "Business identity details collected for KYB verification." + } + }, + "required": [ + "bankDetails", + "businessDetails" + ] + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/v1/merchants/{merchantId}/settlements/fiat/{id}": { + "patch": { + "operationId": "FiatSettlement_update", + "tags": [ + "Fiat Settlement" + ], + "summary": "Update a fiat settlement", + "description": "Partially update the bank or business details on an existing fiat settlement. At least one of `bankDetails` or `businessDetails` must be provided. Only cosmetic fields are mutable here — `iban`, `accountNumber`, and `routingNumber` cannot be changed in place; delete the settlement and re-create it to switch accounts. Iron's `customers.update` API only accepts `email` and `external_id`, so edits to the bank/business name, address, or account-holder name do not flow back to Iron and the merchant does not need to re-verify.", + "responses": { + "200": { + "description": "Settlement updated.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Fiat settlement ID that was updated.", + "examples": [ + "fiat_Bk4nWp8XmQj2YrTv6" + ] + } + }, + "required": [ + "id" + ] + }, + "example": { + "id": "fiat_Bk4nWp8XmQj2YrTv6" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "params_validation", + "invalid_params" + ], + "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": { + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + }, + "404": { + "description": "Settlement not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + }, + "409": { + "description": "Settlement is managed through a partner KYB case attachment", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "settlement_conflict", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "settlement_conflict": { + "summary": "A settlement with conflicting details already exists for this merchant", + "value": { + "code": "settlement_conflict", + "message": "A settlement with conflicting details already exists for this merchant" + } + } + } + } + } + }, + "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" + } + } + } + } + } + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "examples": [ + "fiat_Bk4nWp8XmQj2YrTv6" + ] + }, + "required": true, + "description": "Fiat settlement ID returned at creation time." + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "bankDetails": { + "description": "Cosmetic bank-account updates. Account/routing numbers and IBAN cannot be changed in place — delete the settlement and re-create it to switch accounts.", + "type": "object", + "properties": { + "accountHolderName": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "Account holder name as it appears on the bank account. Usually matches the legal business name.", + "examples": [ + "Acme Corp Inc" + ] + }, + "bankName": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "Display name of the bank that holds the account.", + "examples": [ + "Chase" + ] + }, + "bankCountry": { + "description": "ISO 3166-1 alpha-2 country code of the bank.", + "type": "string", + "minLength": 2, + "maxLength": 2 + } + } + }, + "businessDetails": { + "description": "Business identity updates. Iron does not re-verify on cosmetic edits — KYB status is preserved.", + "type": "object", + "properties": { + "businessName": { + "description": "Legal name of the business.", + "examples": [ + "Acme Corp Inc" + ], + "type": "string", + "minLength": 1, + "maxLength": 255 + }, + "address": { + "description": "Subset of business address fields to update. Partial updates are merged with the existing record.", + "type": "object", + "properties": { + "line1": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "Street address line 1.", + "examples": [ + "350 Fifth Avenue" + ] + }, + "line2": { + "description": "Optional second address line (suite, apartment, building, etc.). Empty strings are treated as omitted.", + "type": "string", + "maxLength": 255 + }, + "city": { + "type": "string", + "minLength": 2, + "maxLength": 255, + "description": "City or locality.", + "examples": [ + "New York" + ] + }, + "state": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "State, province, or region. For ACH this must be a valid US state or territory 2-letter code (e.g. `NY`).", + "examples": [ + "NY" + ] + }, + "country": { + "description": "ISO 3166-1 alpha-2 country code of the business address. Must be `US` when `bankType` is `ACH`.", + "type": "string", + "minLength": 2, + "maxLength": 2 + }, + "zip": { + "type": "string", + "minLength": 1, + "maxLength": 20, + "description": "Postal or ZIP code.", + "examples": [ + "10118" + ] + } + } + } + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "operationId": "FiatSettlement_delete", + "tags": [ + "Fiat Settlement" + ], + "summary": "Delete a fiat settlement", + "description": "Soft-delete a fiat settlement route. Future payments will no longer auto-settle to this fiat account. MX notifies the Core API, which handles async deactivation of the underlying autoramps.", + "responses": { + "200": { + "description": "Settlement deleted.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Fiat settlement ID that was deleted.", + "examples": [ + "fiat_Bk4nWp8XmQj2YrTv6" + ] + }, + "deleted": { + "type": "boolean", + "description": "Always `true` on success. Future payments will no longer route to this fiat account.", + "examples": [ + true + ] + } + }, + "required": [ + "id", + "deleted" + ] + }, + "example": { + "id": "fiat_Bk4nWp8XmQj2YrTv6", + "deleted": true + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "invalid_params", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + }, + "404": { + "description": "Settlement not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + }, + "409": { + "description": "Settlement is managed through a partner KYB case attachment", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "settlement_conflict", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "settlement_conflict": { + "summary": "A settlement with conflicting details already exists for this merchant", + "value": { + "code": "settlement_conflict", + "message": "A settlement with conflicting details already exists for this merchant" + } + } + } + } + } + }, + "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" + } + } + } + } + } + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "examples": [ + "fiat_Bk4nWp8XmQj2YrTv6" + ] + }, + "required": true, + "description": "Fiat settlement ID returned at creation time." + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "security": [ + { + "apiKey": [] + } + ] + } + } + }, + "tags": [ + { + "name": "Gateway" + }, + { + "name": "Payments" + }, + { + "name": "Webhooks" + }, + { + "name": "Refunds" + }, + { + "name": "Merchant Management" + }, + { + "name": "Settlements" + }, + { + "name": "Crypto Settlement" + }, + { + "name": "Fiat Settlement" + } + ], + "components": { + "schemas": { + "Action": { + "oneOf": [ + { + "type": "object", + "description": "An action that requires a wallet RPC call to complete", + "required": [ + "data", + "type" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/WalletRpcAction", + "description": "An action that requires a wallet RPC call to complete" + }, + "type": { + "type": "string", + "enum": [ + "walletRpc" + ] + } + } + }, + { + "type": "object", + "description": "An action that requires building to complete", + "required": [ + "data", + "type" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/Build", + "description": "An action that requires building to complete" + }, + "type": { + "type": "string", + "enum": [ + "build" + ] + } + } + }, + { + "type": "object", + "description": "Send an amount to an account. The whole action, with no transaction to\nbuild or sign.", + "required": [ + "data", + "type" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/TransferAction", + "description": "Send an amount to an account. The whole action, with no transaction to\nbuild or sign." + }, + "type": { + "type": "string", + "enum": [ + "transfer" + ] + } + } + } + ], + "example": { + "data": { + "chain_id": "eip155:8453", + "method": "eth_signTypedData_v4", + "params": [ + "0x0000000000000000000000000000000000000000", + "{\"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\"}}" + ] + }, + "type": "walletRpc" + } + }, + "Amount": { + "type": "object", + "required": [ + "unit", + "value", + "display" + ], + "properties": { + "display": { + "$ref": "#/components/schemas/AmountDisplay", + "description": "Display information for the amount" + }, + "unit": { + "type": "string", + "description": "Currency unit, prefixed with either \"iso4217/\" or \"caip19/\"", + "example": "iso4217/USD" + }, + "value": { + "type": "string", + "description": "Amount value, in the currency unit's minor units" + } + }, + "example": { + "display": { + "assetName": "USD Coin", "assetSymbol": "USDC", "decimals": 6, "iconUrl": "https://assets.walletconnect.com/usdc.png", @@ -2667,7 +9488,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 +9635,7 @@ "example": { "cancelledAt": "2025-01-14T10:30:00Z", "cancelledReason": "cancelled_by_user", - "paymentId": "pay_34a2ecc101M7W4JSEP1H78P1HT49GMNMTT", + "paymentId": "pay_8ba2ecc101M7WG10HDS0VAKCFANFZ6TKXD", "status": "cancelled" } }, @@ -3714,7 +10535,7 @@ "example": { "cancelledAt": "2025-01-14T10:30:00Z", "cancelledReason": "cancelled_by_merchant", - "paymentId": "pay_88a2ecc101M7W4JSEMEY9C69PYKACFTAXB", + "paymentId": "pay_eda2ecc101M7WG10HC6HE6NF47W5XY9JSG", "status": "cancelled" } }, @@ -4193,72 +11014,591 @@ "description": "The canonical (fee-bump) hash, hex." } } - }, - "namespace": { - "type": "string", - "enum": [ - "stellar" - ] + }, + "namespace": { + "type": "string", + "enum": [ + "stellar" + ] + } + } + }, + { + "type": "object", + "required": [ + "data", + "namespace" + ], + "properties": { + "data": { + "type": "object", + "required": [ + "tx_hash" + ], + "properties": { + "tx_hash": { + "type": "string", + "description": "The canonical txID (`sha256(raw_data)`), hex." + } + } + }, + "namespace": { + "type": "string", + "enum": [ + "tron" + ] + } + } + } + ], + "description": "Chain-agnostic confirmed-transaction identifier. Used only as the lifted id on\n`CryptoTransferActionState::Confirmed` and in API responses — never an\nin-flight state." + }, + "WalletRpcAction": { + "type": "object", + "required": [ + "chain_id", + "method", + "params" + ], + "properties": { + "chain_id": { + "type": "string" + }, + "method": { + "type": "string" + }, + "params": { + "type": "array", + "items": {} + } + }, + "example": { + "chain_id": "eip155:8453", + "method": "eth_signTypedData_v4", + "params": [ + "0x0000000000000000000000000000000000000000", + "{\"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\"}}" + ] + } + }, + "MerchantApiErrorCode": { + "type": "string", + "enum": [ + "invalid_params", + "params_validation", + "not_found", + "internal_error", + "bad_gateway", + "rate_limited", + "payment_transition_conflict", + "payment_transition_unavailable", + "settlement_asset_conflict", + "settlement_conflict", + "settlement_destination_not_ready", + "token_not_enabled", + "version_conflict", + "payouts_unavailable", + "payout_not_cancellable", + "logo_too_small", + "logo_too_large", + "logo_not_square", + "logo_file_too_big", + "logo_invalid_mime", + "logo_invalid_dimensions", + "missing_api_key", + "invalid_api_key", + "missing_merchant_id", + "invalid_api_version", + "unknown_api_version", + "api_version_downgrade", + "idempotency_conflict", + "missing_idempotency_key", + "payment_not_succeeded", + "already_refunded", + "receipt_unavailable", + "receipt_service_unavailable", + "payouts_disabled", + "unsupported_asset", + "payout_account_unavailable", + "payout_account_busy", + "screening_unavailable" + ], + "description": "Machine-readable error code" + }, + "MerchantApiErrorResponse": { + "type": "object", + "required": [ + "message", + "code" + ], + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "$ref": "#/components/schemas/MerchantApiErrorCode" + }, + "issues": { + "type": "array", + "description": "Field-level validation issues (present on validation errors)", + "items": { + "type": "object", + "required": [ + "field", + "message" + ], + "properties": { + "field": { + "type": "string" + }, + "message": { + "type": "string" + } } } + } + } + }, + "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": [ - "data", - "namespace" + "assetSymbol", + "assetName", + "decimals" ], - "properties": { - "data": { + "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", - "required": [ - "tx_hash" - ], "properties": { - "tx_hash": { - "type": "string", - "description": "The canonical txID (`sha256(raw_data)`), hex." + "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" }, - "namespace": { - "type": "string", - "enum": [ - "tron" - ] + { + "type": "null" } - } + ] } + }, + "required": [ + "unit", + "value", + "display" ], - "description": "Chain-agnostic confirmed-transaction identifier. Used only as the lifted id on\n`CryptoTransferActionState::Confirmed` and in API responses — never an\nin-flight state." + "description": "Token-denominated amount" }, - "WalletRpcAction": { + "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": [ - "chain_id", - "method", - "params" + "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": { - "chain_id": { - "type": "string" + "status": { + "type": "string", + "description": "Refund state. \"fully_refunded\" is the only value this API emits.", + "examples": [ + "fully_refunded" + ] }, - "method": { + "fullyRefundedAt": { + "description": "ISO 8601 timestamp when the payment was fully refunded. Present only for fully refunded payments.", "type": "string" - }, - "params": { + } + }, + "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." + }, + "MerchantPaymentsResponse": { + "type": "object", + "properties": { + "data": { "type": "array", - "items": {} + "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" } }, - "example": { - "chain_id": "eip155:8453", - "method": "eth_signTypedData_v4", - "params": [ - "0x0000000000000000000000000000000000000000", - "{\"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\"}}" - ] - } + "required": [ + "data", + "nextCursor", + "stats" + ] } }, "securitySchemes": { @@ -4278,6 +11618,12 @@ "in": "header", "name": "App-Id", "description": "Public App ID for wallet authentication. When using this auth mode, the Client-Id header is also required." + }, + "apiKey": { + "type": "apiKey", + "in": "header", + "name": "Api-Key", + "description": "Partner API key." } } }, diff --git a/openapi/2026-02-19.preview.json b/openapi/2026-02-19.preview.json index 1dd0100..c15f433 100644 --- a/openapi/2026-02-19.preview.json +++ b/openapi/2026-02-19.preview.json @@ -157,7 +157,18 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/gateway/payment/{id}/cancel": { @@ -304,7 +315,18 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/gateway/payment/{id}/confirm": { @@ -488,7 +510,18 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/gateway/payment/{id}/fetch": { @@ -647,7 +680,18 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/gateway/payment/{id}/options": { @@ -819,7 +863,18 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/gateway/payment/{id}/status": { @@ -983,7 +1038,18 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/gateway/payment/{id}/transition": { @@ -1141,7 +1207,18 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/payments": { @@ -1276,7 +1353,509 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] + }, + "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": [ + { + "apiKey": [] + } + ] } }, "/v1/payments/{id}": { @@ -1420,12 +1999,23 @@ } } } - } - } - }, - "/v1/payments/{id}/cancel": { - "post": { - "tags": [ + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] + } + }, + "/v1/payments/{id}/cancel": { + "post": { + "tags": [ "Payments" ], "operationId": "paymentsCancelPayment", @@ -1561,7 +2151,18 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/payments/{id}/status": { @@ -1719,7 +2320,18 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/payments/{id}/transition": { @@ -1871,7 +2483,18 @@ } } } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/webhooks/binance_pay": { @@ -1908,7 +2531,18 @@ "500": { "description": "Internal error (Binance retries)" } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/webhooks/binance_pay_onchain": { @@ -1948,7 +2582,18 @@ "503": { "description": "Webhook verification is not configured (Binance redelivers)" } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/webhooks/bybit_pay": { @@ -1988,7 +2633,18 @@ "503": { "description": "Webhook verification or the Bybit client is not configured, or the configured key is unusable (Bybit redelivers)" } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } }, "/v1/webhooks/crypto_com_pay": { @@ -2031,123 +2687,6290 @@ "503": { "description": "Crypto.com Pay is not configured (Crypto.com redelivers)" } - } + }, + "security": [ + { + "API Key": [] + }, + { + "ApiKey": [] + }, + { + "AppId": [] + } + ] } - } - }, - "tags": [ - { - "name": "Gateway" - }, - { - "name": "Payments" }, - { - "name": "Webhooks" - } - ], - "components": { - "schemas": { - "Action": { - "oneOf": [ + "/v1/refunds": { + "post": { + "operationId": "Refunds_create", + "parameters": [ { - "type": "object", - "description": "An action that requires a wallet RPC call to complete", - "required": [ - "data", - "type" - ], - "properties": { - "data": { - "$ref": "#/components/schemas/WalletRpcAction", - "description": "An action that requires a wallet RPC call to complete" - }, - "type": { - "type": "string", - "enum": [ - "walletRpc" - ] - } + "name": "Merchant-Id", + "in": "header", + "required": true, + "description": "Merchant identifier.", + "schema": { + "type": "string", + "examples": [ + "acme-store-1" + ] } }, { - "type": "object", - "description": "An action that requires building to complete", - "required": [ - "data", - "type" - ], - "properties": { - "data": { - "$ref": "#/components/schemas/Build", - "description": "An action that requires building to complete" - }, - "type": { - "type": "string", - "enum": [ - "build" - ] + "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" + ] + } + } + ], + "responses": { + "200": { + "description": "Payment marked as refunded", + "headers": { + "WCP-Version": { + "description": "WalletConnect Pay API version resolved for this request.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "paymentId": { + "type": "string", + "description": "Payment ID that was marked as refunded" + } + }, + "required": [ + "paymentId" + ] + }, + "example": { + "paymentId": "pay_a1a2ecc101KGF210FP7PN3BK08PZARS1CZ" + } } } }, - { - "type": "object", - "description": "Send an amount to an account. The whole action, with no transaction to\nbuild or sign.", - "required": [ - "data", - "type" - ], - "properties": { - "data": { - "$ref": "#/components/schemas/TransferAction", - "description": "Send an amount to an account. The whole action, with no transaction to\nbuild or sign." - }, - "type": { - "type": "string", - "enum": [ - "transfer" - ] + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "params_validation", + "payment_not_succeeded", + "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": { + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "payment_not_succeeded": { + "summary": "Payment is not in a refundable state", + "value": { + "code": "payment_not_succeeded", + "message": "Payment is not in a refundable state" + } + }, + "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" + } + } + } } } - } - ], - "example": { - "data": { - "chain_id": "eip155:8453", - "method": "eth_signTypedData_v4", - "params": [ - "0x0000000000000000000000000000000000000000", - "{\"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\"}}" - ] }, - "type": "walletRpc" - } - }, - "Amount": { - "type": "object", - "required": [ - "unit", - "value", - "display" - ], - "properties": { - "display": { - "$ref": "#/components/schemas/AmountDisplay", - "description": "Display information for the amount" - }, - "unit": { - "type": "string", - "description": "Currency unit, prefixed with either \"iso4217/\" or \"caip19/\"", - "example": "iso4217/USD" + "401": { + "description": "Unauthorized — missing or invalid API key, or missing merchant id", + "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", + "missing_merchant_id" + ], + "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" + } + }, + "missing_merchant_id": { + "summary": "Missing Merchant ID", + "value": { + "code": "missing_merchant_id", + "message": "Missing Merchant ID" + } + } + } + } + } }, - "value": { - "type": "string", - "description": "Amount value, in the currency unit's minor units" - } - }, - "example": { - "display": { - "assetName": "USD Coin", + "404": { + "description": "Payment not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + }, + "409": { + "description": "Payment is already refunded", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "already_refunded", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "already_refunded": { + "summary": "Payment is already refunded", + "value": { + "code": "already_refunded", + "message": "Payment is already refunded" + } + } + } + } + } + }, + "500": { + "description": "Internal 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" + } + } + } + } + } + }, + "502": { + "description": "Bad gateway", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "bad_gateway", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "bad_gateway": { + "summary": "Bad Gateway", + "value": { + "code": "bad_gateway", + "message": "Bad Gateway" + } + } + } + } + } + } + }, + "tags": [ + "Refunds" + ], + "summary": "Mark a payment as refunded", + "description": "Request a full refund for a payment. Calling a second time on the same payment returns 409.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "paymentId": { + "type": "string", + "minLength": 1, + "maxLength": 64, + "pattern": "^pay_[A-Za-z0-9]+$", + "description": "Payment ID to refund", + "examples": [ + "pay_a1a2ecc101KGF210FP7PN3BK08PZARS1CZ" + ] + } + }, + "required": [ + "paymentId" + ] + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/v1/merchants/payments": { + "get": { + "operationId": "MerchantPayments_list", + "parameters": [ + { + "name": "Merchant-Id", + "in": "header", + "required": true, + "description": "Merchant identifier.", + "schema": { + "type": "string", + "examples": [ + "acme-store-1" + ] + } + }, + { + "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 ` /-:.,+`." + } + ], + "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 API key, or missing merchant id", + "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", + "missing_merchant_id" + ], + "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" + } + }, + "missing_merchant_id": { + "summary": "Missing Merchant ID", + "value": { + "code": "missing_merchant_id", + "message": "Missing Merchant ID" + } + } + } + } + } + }, + "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 for a merchant", + "description": "Retrieve paginated payments with optional filters.", + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/v1/merchants/payments/{paymentId}/receipt": { + "post": { + "operationId": "PaymentReceipts_send", + "parameters": [ + { + "name": "Merchant-Id", + "in": "header", + "required": true, + "description": "Merchant identifier.", + "schema": { + "type": "string", + "examples": [ + "acme-store-1" + ] + } + }, + { + "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": "path", + "name": "paymentId", + "schema": { + "type": "string", + "minLength": 1, + "maxLength": 64, + "pattern": "^pay_[A-Za-z0-9]+$", + "examples": [ + "pay_a1a2ecc101KGF210FP7PN3BK08PZARS1CZ" + ] + }, + "required": true, + "description": "Payment ID to send the receipt for" + } + ], + "responses": { + "200": { + "description": "Receipt sent, or already sent before", + "headers": { + "WCP-Version": { + "description": "WalletConnect Pay API version resolved for this request.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "paymentId": { + "type": "string", + "description": "Payment ID the receipt is for" + }, + "status": { + "type": "string", + "enum": [ + "sent", + "already_sent" + ], + "description": "`sent`: the receipt is on its way. `already_sent`: a receipt for this payment was already sent, so no new email was sent." + } + }, + "required": [ + "paymentId", + "status" + ] + }, + "example": { + "paymentId": "pay_a1a2ecc101KGF210FP7PN3BK08PZARS1CZ", + "status": "sent" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "params_validation", + "payment_not_succeeded", + "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": { + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "payment_not_succeeded": { + "summary": "Payment is not in a refundable state", + "value": { + "code": "payment_not_succeeded", + "message": "Payment is not in a refundable state" + } + }, + "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 API key, or missing merchant id", + "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", + "missing_merchant_id" + ], + "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" + } + }, + "missing_merchant_id": { + "summary": "Missing Merchant ID", + "value": { + "code": "missing_merchant_id", + "message": "Missing Merchant ID" + } + } + } + } + } + }, + "404": { + "description": "Payment not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + }, + "409": { + "description": "The payment has no on-chain transaction to put on a receipt", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "receipt_unavailable", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "receipt_unavailable": { + "summary": "This payment has no on-chain transaction to put on a receipt", + "value": { + "code": "receipt_unavailable", + "message": "This payment has no on-chain transaction to put on a receipt" + } + } + } + } + } + }, + "429": { + "description": "Too many receipt requests", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "rate_limited", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "rate_limited": { + "summary": "Too Many Requests", + "value": { + "code": "rate_limited", + "message": "Too Many Requests" + } + } + } + } + } + }, + "500": { + "description": "Internal 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" + } + } + } + } + } + }, + "502": { + "description": "Receipt service unavailable", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "receipt_service_unavailable", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "receipt_service_unavailable": { + "summary": "The receipt service is unavailable", + "value": { + "code": "receipt_service_unavailable", + "message": "The receipt service is unavailable" + } + } + } + } + } + } + }, + "tags": [ + "Payments" + ], + "summary": "Email a payment receipt", + "description": "Email the receipt for a succeeded payment to the customer. A payment gets at most one receipt: if the customer already received one, no new email is sent and the response status is `already_sent`.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "maxLength": 320, + "format": "email", + "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + "description": "Customer email address to send the receipt to", + "examples": [ + "customer@example.com" + ] + } + }, + "required": [ + "email" + ] + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/v1/merchants": { + "post": { + "operationId": "MerchantManagement_create", + "tags": [ + "Merchant Management" + ], + "summary": "Create a merchant", + "description": "Create a new merchant under the authenticated partner. Requires an `Idempotency-Key` header so retries safely return the originally-created merchant rather than creating duplicates.", + "parameters": [ + { + "name": "Idempotency-Key", + "in": "header", + "required": true, + "description": "Unique key to ensure idempotent request processing. Max 255 characters.", + "schema": { + "type": "string", + "maxLength": 255 + } + } + ], + "responses": { + "201": { + "description": "Merchant created", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "merchant": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Merchant ID", + "examples": [ + "mrch_7kBz2qR9xPvLmN4Yw" + ] + }, + "name": { + "type": "string", + "description": "Merchant display name" + }, + "email": { + "description": "Contact email", + "examples": [ + "billing@acme.store" + ], + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string", + "enum": [ + "active", + "inactive", + "suspended" + ], + "description": "Current merchant status", + "examples": [ + "active" + ] + }, + "mcc": { + "anyOf": [ + { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + { + "type": "null" + } + ], + "description": "ISO 18245 merchant category code, or null if not set", + "examples": [ + 5812 + ] + }, + "createdAt": { + "type": "string", + "description": "ISO 8601 creation timestamp", + "examples": [ + "2025-06-15T10:30:00.000Z" + ] + } + }, + "required": [ + "id", + "name", + "email", + "status", + "mcc", + "createdAt" + ] + } + }, + "required": [ + "merchant" + ] + }, + "example": { + "merchant": { + "id": "mrch_7kBz2qR9xPvLmN4Yw", + "name": "Acme Store", + "email": "billing@acme.store", + "status": "active", + "mcc": 5812, + "createdAt": "2025-06-15T10:30:00.000Z" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "params_validation", + "invalid_params", + "missing_idempotency_key", + "logo_too_small", + "logo_too_large", + "logo_not_square", + "logo_file_too_big", + "logo_invalid_mime", + "logo_invalid_dimensions" + ], + "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": { + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + }, + "missing_idempotency_key": { + "summary": "Missing Idempotency-Key header", + "value": { + "code": "missing_idempotency_key", + "message": "Missing Idempotency-Key header" + } + }, + "logo_too_small": { + "summary": "Logo is too small", + "value": { + "code": "logo_too_small", + "message": "Logo is too small" + } + }, + "logo_too_large": { + "summary": "Logo is too large", + "value": { + "code": "logo_too_large", + "message": "Logo is too large" + } + }, + "logo_not_square": { + "summary": "Logo must be square", + "value": { + "code": "logo_not_square", + "message": "Logo must be square" + } + }, + "logo_file_too_big": { + "summary": "Logo file is too large", + "value": { + "code": "logo_file_too_big", + "message": "Logo file is too large" + } + }, + "logo_invalid_mime": { + "summary": "Logo file type is not supported", + "value": { + "code": "logo_invalid_mime", + "message": "Logo file type is not supported" + } + }, + "logo_invalid_dimensions": { + "summary": "Logo dimensions could not be read", + "value": { + "code": "logo_invalid_dimensions", + "message": "Logo dimensions could not be read" + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + }, + "409": { + "description": "Idempotency conflict", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "idempotency_conflict", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "idempotency_conflict": { + "summary": "Idempotency key conflict: same key was used with a different request body", + "value": { + "code": "idempotency_conflict", + "message": "Idempotency key conflict: same key was used with a different request body" + } + } + } + } + } + }, + "500": { + "description": "Internal 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" + } + } + } + } + } + }, + "502": { + "description": "Bad gateway", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "bad_gateway", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "bad_gateway": { + "summary": "Bad Gateway", + "value": { + "code": "bad_gateway", + "message": "Bad Gateway" + } + } + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "merchantName": { + "type": "string", + "minLength": 2, + "maxLength": 64, + "description": "Display name for the merchant", + "examples": [ + "Acme Store" + ] + }, + "merchantEmail": { + "type": "string", + "format": "email", + "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + "description": "Contact email for the merchant", + "examples": [ + "billing@acme.store" + ] + }, + "iconUrl": { + "default": null, + "description": "Merchant logo URL (HTTPS only), or null to unset. Logo should be square (1:1, ±5%), 500×500px minimum (1024×1024px recommended, 4096×4096px maximum), JPEG/PNG/WebP, up to 2 MB.", + "examples": [ + "https://example.com/logo.png" + ], + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "alwaysCollectData": { + "description": "When true, every checkout forces the buyer to provide compliance data, even repeat buyers whose data is already on file.", + "examples": [ + true + ], + "type": "boolean" + }, + "mcc": { + "default": null, + "description": "ISO 18245 merchant category code describing the merchant's line of business.", + "examples": [ + 5812 + ], + "anyOf": [ + { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "merchantName", + "merchantEmail" + ], + "examples": [ + { + "merchantName": "Acme Store", + "merchantEmail": "billing@acme.store", + "iconUrl": "https://example.com/logo.png" + } + ] + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "get": { + "operationId": "MerchantManagement_list", + "tags": [ + "Merchant Management" + ], + "summary": "List merchants", + "description": "List the partner's merchants. Supports filtering by `status`, free-text `search` over name and ID, and cursor-based pagination via `cursor` and `limit`.", + "responses": { + "200": { + "description": "Merchants list", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "merchants": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Merchant ID", + "examples": [ + "mrch_7kBz2qR9xPvLmN4Yw" + ] + }, + "name": { + "type": "string", + "description": "Merchant display name" + }, + "email": { + "description": "Contact email", + "examples": [ + "billing@acme.store" + ], + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string", + "enum": [ + "active", + "inactive", + "suspended" + ], + "description": "Current merchant status", + "examples": [ + "active" + ] + }, + "iconUrl": { + "description": "Merchant logo URL, or null if not set", + "examples": [ + "https://imagedelivery.net/example/acme-icon.png" + ], + "type": [ + "string", + "null" + ] + }, + "mcc": { + "anyOf": [ + { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + { + "type": "null" + } + ], + "description": "ISO 18245 merchant category code, or null if not set", + "examples": [ + 5812 + ] + }, + "createdAt": { + "type": "string", + "description": "ISO 8601 creation timestamp", + "examples": [ + "2025-06-15T10:30:00.000Z" + ] + } + }, + "required": [ + "id", + "name", + "email", + "status", + "iconUrl", + "mcc", + "createdAt" + ] + } + }, + "totalCount": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "description": "Total number of merchants matching the query (ignoring pagination)" + }, + "nextCursor": { + "description": "Cursor for the next page, or null if no more results", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "merchants", + "totalCount", + "nextCursor" + ] + }, + "example": { + "merchants": [ + { + "id": "mrch_7kBz2qR9xPvLmN4Yw", + "name": "Acme Store", + "email": "billing@acme.store", + "status": "active", + "iconUrl": "https://imagedelivery.net/example/acme-icon.png", + "mcc": 5812, + "createdAt": "2025-06-15T10:30:00.000Z" + }, + { + "id": "mrch_Qx8fTp3YwKjR5vNm2", + "name": "Widget Co", + "email": null, + "status": "active", + "iconUrl": null, + "mcc": null, + "createdAt": "2025-07-01T08:00:00.000Z" + } + ], + "totalCount": 2, + "nextCursor": null + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "params_validation", + "invalid_params" + ], + "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": { + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + } + }, + "parameters": [ + { + "in": "query", + "name": "status", + "schema": { + "type": "string", + "enum": [ + "active", + "inactive", + "suspended" + ] + }, + "description": "Filter by merchant status" + }, + { + "in": "query", + "name": "search", + "schema": { + "examples": [ + "Acme" + ], + "type": "string", + "minLength": 1, + "maxLength": 256 + }, + "description": "Search by merchant name or ID (case-insensitive)" + }, + { + "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": { + "default": 20, + "type": "integer", + "minimum": 1, + "maximum": 100 + }, + "description": "Page size (default 20, max 100)" + } + ], + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/v1/merchants/{merchantId}": { + "get": { + "operationId": "MerchantManagement_get", + "tags": [ + "Merchant Management" + ], + "summary": "Get a merchant", + "description": "Fetch a merchant's profile along with its configured `settlements` (crypto and fiat). Crypto settlements use [CAIP-19](https://chainagnostic.org/CAIPs/caip-19) asset IDs and [CAIP-10](https://chainagnostic.org/CAIPs/caip-10) destination accounts.", + "responses": { + "200": { + "description": "Merchant details", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "merchant": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Merchant ID", + "examples": [ + "mrch_7kBz2qR9xPvLmN4Yw" + ] + }, + "name": { + "type": "string", + "description": "Merchant display name" + }, + "email": { + "description": "Contact email", + "examples": [ + "billing@acme.store" + ], + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string", + "enum": [ + "active", + "inactive", + "suspended" + ], + "description": "Current merchant status", + "examples": [ + "active" + ] + }, + "iconUrl": { + "description": "Merchant logo URL, or null if not set", + "examples": [ + "https://imagedelivery.net/example/acme-icon.png" + ], + "type": [ + "string", + "null" + ] + }, + "mcc": { + "anyOf": [ + { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + { + "type": "null" + } + ], + "description": "ISO 18245 merchant category code, or null if not set", + "examples": [ + 5812 + ] + }, + "createdAt": { + "type": "string", + "description": "ISO 8601 creation timestamp", + "examples": [ + "2025-06-15T10:30:00.000Z" + ] + }, + "alwaysCollectData": { + "type": "boolean", + "description": "When true, every checkout forces the buyer to provide compliance data — even repeat buyers whose data is already on file.", + "examples": [ + false + ] + }, + "mtaAddresses": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Transit account addresses, where payments arrive before they settle, as [CAIP-10](https://standards.chainagnostic.org/CAIPs/caip-10) account IDs. One entry per provisioned chain, and chains in a namespace share an address, so entries repeat. Empty when there is no transit account. May be shared across all of a partner's merchants, so they cannot be used to attribute a payment to a single merchant.", + "examples": [ + [ + "eip155:8453:0x1234567890abcdef1234567890abcdef12345678", + "eip155:10:0x1234567890abcdef1234567890abcdef12345678" + ] + ] + }, + "settlements": { + "type": "object", + "properties": { + "crypto": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Crypto settlement ID" + }, + "asset": { + "type": "string", + "description": "[CAIP-19](https://standards.chainagnostic.org/CAIPs/caip-19) asset ID", + "examples": [ + "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" + ] + }, + "destination": { + "type": "string", + "description": "[CAIP-10](https://standards.chainagnostic.org/CAIPs/caip-10) settlement destination", + "examples": [ + "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + ] + }, + "networkName": { + "description": "Display name of the settlement network, or null if the chain is not recognized", + "examples": [ + "Base" + ], + "type": [ + "string", + "null" + ] + }, + "networkLogoUrl": { + "description": "Logo URL for the settlement network (an admin-uploaded logo when set, otherwise the assets-registry fallback), or null if the chain is not recognized", + "examples": [ + "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + ], + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "asset", + "destination", + "networkName", + "networkLogoUrl" + ] + } + }, + "fiat": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Settlement config ID" + }, + "status": { + "type": "string", + "description": "Fiat settlement status" + }, + "bankType": { + "type": "string", + "description": "Bank account type" + } + }, + "required": [ + "id", + "status", + "bankType" + ] + } + }, + "hasSettlementPath": { + "type": "boolean", + "description": "True when the merchant has somewhere for a live payment to settle: a crypto settlement, a fiat settlement config (including one still in setup, and so absent from `fiat` above), or an enabled funding source. Use this rather than the arrays above to decide whether the merchant is payable — they list only what is active. Advisory: pay-core is the authority and rejects a payment it cannot settle with `no_settlement_configuration`." + } + }, + "required": [ + "crypto", + "fiat", + "hasSettlementPath" + ] + } + }, + "required": [ + "id", + "name", + "email", + "status", + "iconUrl", + "mcc", + "createdAt", + "alwaysCollectData", + "mtaAddresses", + "settlements" + ] + } + }, + "required": [ + "merchant" + ] + }, + "example": { + "merchant": { + "id": "mrch_7kBz2qR9xPvLmN4Yw", + "name": "Acme Store", + "email": "billing@acme.store", + "status": "active", + "iconUrl": "https://imagedelivery.net/example/acme-icon.png", + "mcc": 5812, + "createdAt": "2025-06-15T10:30:00.000Z", + "mtaAddresses": [ + "eip155:8453:0x1234567890abcdef1234567890abcdef12345678", + "eip155:10:0x1234567890abcdef1234567890abcdef12345678" + ], + "settlements": { + "crypto": [ + { + "id": "crypto_Xk7nWp8XmQj2YrTv6", + "asset": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "destination": "eip155:8453:0x1234567890abcdef1234567890abcdef12345678", + "networkName": "Base", + "networkLogoUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + ], + "fiat": [ + { + "id": "fiat_Bk4nWp8XmQj2YrTv6", + "status": "active", + "bankType": "ACH" + } + ] + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "security": [ + { + "apiKey": [] + } + ] + }, + "patch": { + "operationId": "MerchantManagement_update", + "tags": [ + "Merchant Management" + ], + "summary": "Update a merchant", + "description": "Update a merchant's profile. At least one of `merchantName`, `merchantEmail`, `iconUrl`, `alwaysCollectData`, or `mcc` must be provided. Pass `iconUrl: null` to unset the existing logo, and `mcc: null` to unset the merchant category code.", + "responses": { + "200": { + "description": "Merchant updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "merchant": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Merchant ID", + "examples": [ + "mrch_7kBz2qR9xPvLmN4Yw" + ] + }, + "name": { + "type": "string", + "description": "Merchant display name" + }, + "email": { + "description": "Contact email", + "examples": [ + "billing@acme.store" + ], + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string", + "enum": [ + "active", + "inactive", + "suspended" + ], + "description": "Current merchant status", + "examples": [ + "active" + ] + }, + "iconUrl": { + "description": "Merchant logo URL, or null if not set", + "examples": [ + "https://imagedelivery.net/example/acme-icon.png" + ], + "type": [ + "string", + "null" + ] + }, + "mcc": { + "anyOf": [ + { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + { + "type": "null" + } + ], + "description": "ISO 18245 merchant category code, or null if not set", + "examples": [ + 5812 + ] + }, + "createdAt": { + "type": "string", + "description": "ISO 8601 creation timestamp", + "examples": [ + "2025-06-15T10:30:00.000Z" + ] + } + }, + "required": [ + "id", + "name", + "email", + "status", + "iconUrl", + "mcc", + "createdAt" + ] + } + }, + "required": [ + "merchant" + ] + }, + "example": { + "merchant": { + "id": "mrch_7kBz2qR9xPvLmN4Yw", + "name": "Acme Store v2", + "email": "billing@acme.store", + "status": "active", + "iconUrl": "https://imagedelivery.net/example/acme-icon.png", + "mcc": 5812, + "createdAt": "2025-06-15T10:30:00.000Z" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "params_validation", + "invalid_params", + "logo_too_small", + "logo_too_large", + "logo_not_square", + "logo_file_too_big", + "logo_invalid_mime", + "logo_invalid_dimensions" + ], + "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": { + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + }, + "logo_too_small": { + "summary": "Logo is too small", + "value": { + "code": "logo_too_small", + "message": "Logo is too small" + } + }, + "logo_too_large": { + "summary": "Logo is too large", + "value": { + "code": "logo_too_large", + "message": "Logo is too large" + } + }, + "logo_not_square": { + "summary": "Logo must be square", + "value": { + "code": "logo_not_square", + "message": "Logo must be square" + } + }, + "logo_file_too_big": { + "summary": "Logo file is too large", + "value": { + "code": "logo_file_too_big", + "message": "Logo file is too large" + } + }, + "logo_invalid_mime": { + "summary": "Logo file type is not supported", + "value": { + "code": "logo_invalid_mime", + "message": "Logo file type is not supported" + } + }, + "logo_invalid_dimensions": { + "summary": "Logo dimensions could not be read", + "value": { + "code": "logo_invalid_dimensions", + "message": "Logo dimensions could not be read" + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "merchantName": { + "description": "Updated display name", + "examples": [ + "Acme Store v2" + ], + "type": "string", + "minLength": 2, + "maxLength": 64 + }, + "merchantEmail": { + "description": "Updated contact email", + "examples": [ + "new-billing@acme.store" + ], + "type": "string", + "format": "email", + "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" + }, + "iconUrl": { + "description": "Updated logo URL (HTTPS only), or null to unset. Logo should be square (1:1, ±5%), 500×500px minimum (1024×1024px recommended, 4096×4096px maximum), JPEG/PNG/WebP, up to 2 MB.", + "examples": [ + "https://example.com/new-logo.png" + ], + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "alwaysCollectData": { + "description": "When true, every checkout forces the buyer to provide compliance data, even repeat buyers whose data is already on file.", + "examples": [ + true + ], + "type": "boolean" + }, + "mcc": { + "description": "Updated ISO 18245 merchant category code, or null to unset.", + "examples": [ + 5812 + ], + "anyOf": [ + { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991 + }, + { + "type": "null" + } + ] + } + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "operationId": "MerchantManagement_delete", + "tags": [ + "Merchant Management" + ], + "summary": "Delete a merchant", + "description": "Soft-delete a merchant. The merchant is hidden from listings and can no longer accept new payments. Already-deleted merchants return `deleted: true` so the call is idempotent.", + "responses": { + "200": { + "description": "Merchant deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Merchant ID" + }, + "deleted": { + "type": "boolean", + "description": "Whether the merchant was successfully deleted" + } + }, + "required": [ + "id", + "deleted" + ] + }, + "example": { + "id": "mrch_7kBz2qR9xPvLmN4Yw", + "deleted": true + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/v1/merchants/{merchantId}/settlements": { + "get": { + "operationId": "Settlements_list", + "tags": [ + "Settlements" + ], + "summary": "List settlements", + "description": "List the merchant's configured fiat and crypto settlement destinations.", + "responses": { + "200": { + "description": "Settlements list", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "fiat": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Fiat settlement ID", + "examples": [ + "fiat_Bk4nWp8XmQj2YrTv6" + ] + }, + "status": { + "type": "string", + "description": "Fiat settlement status. Collapses the KYB lifecycle into broad partner-facing states (`pending_kyb`, `action_required`, `active`, `rejected`). See `kybStatus` for the raw KYB state.", + "examples": [ + "active" + ] + }, + "kybStatus": { + "description": "Raw KYB lifecycle state from the verification provider. Distinguishes `collecting_info` (waiting on merchant to start) from `pending` (verification in flight) — both collapse to `pending_kyb` under `status`. `null` when no KYB case is linked.", + "examples": [ + "pending" + ], + "type": [ + "string", + "null" + ] + }, + "kybUrl": { + "description": "URL the merchant must visit to continue verification: Iron's hosted identity flow during KYB, or our hosted token-gated signing page once Iron requires document signatures. `null` when no merchant action is pending.", + "examples": [ + "https://kyb.iron.io/verify/abc123" + ], + "type": [ + "string", + "null" + ] + }, + "bankType": { + "type": "string", + "const": "SEPA", + "description": "Bank account type" + }, + "bankName": { + "type": "string", + "description": "Display name of the bank.", + "examples": [ + "BNP Paribas" + ] + }, + "bankCountry": { + "type": "string", + "description": "ISO 3166-1 alpha-2 country code of the bank.", + "examples": [ + "FR" + ] + }, + "accountHolderName": { + "description": "Account holder name as recorded on the bank account.", + "examples": [ + "Acme Corp SAS" + ], + "type": [ + "string", + "null" + ] + }, + "ibanLast4": { + "type": "string", + "description": "Last 4 characters of the IBAN. The full IBAN is never returned over the API.", + "examples": [ + "0189" + ] + } + }, + "required": [ + "id", + "status", + "kybStatus", + "kybUrl", + "bankType", + "bankName", + "bankCountry", + "accountHolderName", + "ibanLast4" + ] + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Fiat settlement ID", + "examples": [ + "fiat_Bk4nWp8XmQj2YrTv6" + ] + }, + "status": { + "type": "string", + "description": "Fiat settlement status. Collapses the KYB lifecycle into broad partner-facing states (`pending_kyb`, `action_required`, `active`, `rejected`). See `kybStatus` for the raw KYB state.", + "examples": [ + "active" + ] + }, + "kybStatus": { + "description": "Raw KYB lifecycle state from the verification provider. Distinguishes `collecting_info` (waiting on merchant to start) from `pending` (verification in flight) — both collapse to `pending_kyb` under `status`. `null` when no KYB case is linked.", + "examples": [ + "pending" + ], + "type": [ + "string", + "null" + ] + }, + "kybUrl": { + "description": "URL the merchant must visit to continue verification: Iron's hosted identity flow during KYB, or our hosted token-gated signing page once Iron requires document signatures. `null` when no merchant action is pending.", + "examples": [ + "https://kyb.iron.io/verify/abc123" + ], + "type": [ + "string", + "null" + ] + }, + "bankType": { + "type": "string", + "const": "ACH", + "description": "Bank account type" + }, + "bankName": { + "type": "string", + "description": "Display name of the bank.", + "examples": [ + "Chase" + ] + }, + "bankCountry": { + "type": "string", + "description": "ISO 3166-1 alpha-2 country code of the bank.", + "examples": [ + "US" + ] + }, + "accountHolderName": { + "description": "Account holder name as recorded on the bank account.", + "examples": [ + "Acme Corp Inc" + ], + "type": [ + "string", + "null" + ] + }, + "routingNumber": { + "type": "string", + "description": "ABA routing number. Returned in full — it identifies the bank, not the account.", + "examples": [ + "021000021" + ] + }, + "accountLast4": { + "type": "string", + "description": "Last 4 characters of the bank account number. The full account number is never returned over the API.", + "examples": [ + "6789" + ] + } + }, + "required": [ + "id", + "status", + "kybStatus", + "kybUrl", + "bankType", + "bankName", + "bankCountry", + "accountHolderName", + "routingNumber", + "accountLast4" + ] + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Fiat settlement ID", + "examples": [ + "fiat_Bk4nWp8XmQj2YrTv6" + ] + }, + "status": { + "type": "string", + "description": "Fiat settlement status. Collapses the KYB lifecycle into broad partner-facing states (`pending_kyb`, `action_required`, `active`, `rejected`). See `kybStatus` for the raw KYB state.", + "examples": [ + "active" + ] + }, + "kybStatus": { + "description": "Raw KYB lifecycle state from the verification provider. Distinguishes `collecting_info` (waiting on merchant to start) from `pending` (verification in flight) — both collapse to `pending_kyb` under `status`. `null` when no KYB case is linked.", + "examples": [ + "pending" + ], + "type": [ + "string", + "null" + ] + }, + "kybUrl": { + "description": "URL the merchant must visit to continue verification: Iron's hosted identity flow during KYB, or our hosted token-gated signing page once Iron requires document signatures. `null` when no merchant action is pending.", + "examples": [ + "https://kyb.iron.io/verify/abc123" + ], + "type": [ + "string", + "null" + ] + }, + "bankType": { + "type": "string", + "const": "unknown", + "description": "Bank account type. `unknown` when no bank account is linked yet." + } + }, + "required": [ + "id", + "status", + "kybStatus", + "kybUrl", + "bankType" + ] + } + ] + }, + "description": "Fiat settlement configurations attached to the merchant." + }, + "crypto": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Crypto settlement ID", + "examples": [ + "crypto_Xk7nWp8XmQj2YrTv6" + ] + }, + "asset": { + "type": "string", + "description": "[CAIP-19](https://chainagnostic.org/CAIPs/caip-19) asset identifier", + "examples": [ + "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" + ] + }, + "destination": { + "type": "string", + "description": "[CAIP-10](https://chainagnostic.org/CAIPs/caip-10) destination wallet", + "examples": [ + "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + ] + }, + "networkName": { + "description": "Display name of the settlement network, or null if the chain is not recognized", + "examples": [ + "Base" + ], + "type": [ + "string", + "null" + ] + }, + "networkLogoUrl": { + "description": "Logo URL for the settlement network (an admin-uploaded logo when set, otherwise the assets-registry fallback), or null if the chain is not recognized", + "examples": [ + "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + ], + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "asset", + "destination", + "networkName", + "networkLogoUrl" + ] + }, + "description": "Crypto settlement destinations attached to the merchant." + } + }, + "required": [ + "fiat", + "crypto" + ] + }, + "example": { + "fiat": [ + { + "id": "fiat_Bk4nWp8XmQj2YrTv6", + "status": "active", + "kybStatus": "approved", + "kybUrl": null, + "bankType": "ACH", + "bankName": "Chase", + "bankCountry": "US", + "accountHolderName": "Acme Corp Inc", + "routingNumber": "021000021", + "accountLast4": "6789" + } + ], + "crypto": [ + { + "id": "crypto_Xk7nWp8XmQj2YrTv6", + "asset": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "destination": "eip155:8453:0x1234567890abcdef1234567890abcdef12345678", + "networkName": "Base", + "networkLogoUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/v1/merchants/{merchantId}/settlements/tokens": { + "get": { + "operationId": "Settlements_listAvailableTokens", + "tags": [ + "Settlements" + ], + "summary": "List tokens available for settlement", + "description": "List the tokens this merchant may currently settle in, freshly resolved per request: every asset returned passes the `token_not_enabled` gate on the crypto settlement write endpoints. Derive settlement requests from this list rather than from a platform-wide catalogue. Tokens on a chain where payments are not rolled out for this merchant yet are left out, and the create endpoint rejects them with `token_not_enabled`. This part can lag a rollout change by up to a minute. An asset that already has a settlement pair, in any status, still returns `settlement_asset_conflict` on create. `internal_error` means enablement could not be resolved — retry shortly.", + "responses": { + "200": { + "description": "Tokens available for settlement", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "tokens": { + "type": "array", + "items": { + "type": "object", + "properties": { + "asset": { + "type": "string", + "description": "[CAIP-19](https://chainagnostic.org/CAIPs/caip-19) asset identifier", + "examples": [ + "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" + ] + }, + "caip2ChainId": { + "type": "string", + "description": "[CAIP-2](https://chainagnostic.org/CAIPs/caip-2) chain the token settles on", + "examples": [ + "eip155:8453" + ] + }, + "symbol": { + "type": "string", + "description": "Token symbol", + "examples": [ + "USDC" + ] + }, + "name": { + "type": "string", + "description": "Token display name", + "examples": [ + "USD Coin" + ] + }, + "decimals": { + "type": "integer", + "minimum": -9007199254740991, + "maximum": 9007199254740991, + "description": "Token decimals", + "examples": [ + 6 + ] + }, + "logoUrl": { + "description": "Token logo URL, or null when none is registered", + "examples": [ + "https://api.walletconnect.com/assets/v1/image/token/USDC/md" + ], + "type": [ + "string", + "null" + ] + }, + "networkName": { + "description": "Display name of the settlement network, or null if the chain is not recognized", + "examples": [ + "Base" + ], + "type": [ + "string", + "null" + ] + }, + "networkLogoUrl": { + "description": "Logo URL for the settlement network (an admin-uploaded logo when set, otherwise the assets-registry fallback), or null if the chain is not recognized", + "examples": [ + "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + ], + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "asset", + "caip2ChainId", + "symbol", + "name", + "decimals", + "logoUrl", + "networkName", + "networkLogoUrl" + ] + }, + "description": "Tokens the merchant may settle in. Empty when no tokens are currently enabled for this merchant." + } + }, + "required": [ + "tokens" + ] + }, + "example": { + "tokens": [ + { + "asset": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "caip2ChainId": "eip155:8453", + "symbol": "USDC", + "name": "USD Coin", + "decimals": 6, + "logoUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md", + "networkName": "Base", + "networkLogoUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md" + } + ] + } + } + } + }, + "400": { + "description": "Settlement management is not available for test partners", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "invalid_params", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + }, + "404": { + "description": "Merchant not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + }, + "500": { + "description": "Token enablement could not be resolved", + "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" + } + } + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/v1/merchants/{merchantId}/settlements/crypto": { + "post": { + "operationId": "CryptoSettlement_create", + "tags": [ + "Crypto Settlement" + ], + "summary": "Create crypto settlements", + "description": "Register one or more crypto settlement destinations for the merchant. Each entry pairs a [CAIP-19](https://chainagnostic.org/CAIPs/caip-19) `asset` with a [CAIP-10](https://chainagnostic.org/CAIPs/caip-10) `destination` wallet on the same chain. Each `(merchant, asset)` pair must be unique — registering the same asset twice returns `settlement_asset_conflict`. Crypto and fiat settlements can coexist on the same merchant. Assets must be enabled for the merchant; if any is not, the whole request is rejected with `token_not_enabled` naming every offending asset. An asset on a chain where payments are not rolled out for this merchant yet is rejected the same way. Stellar destinations must be ready to receive their asset — the account must exist on the ledger and hold a trustline for the asset's issuer — otherwise the request is rejected with `settlement_destination_not_ready`.", + "parameters": [ + { + "name": "Idempotency-Key", + "in": "header", + "required": true, + "description": "Unique key to ensure idempotent request processing. Max 255 characters.", + "schema": { + "type": "string", + "maxLength": 255 + } + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "responses": { + "201": { + "description": "Crypto settlements created", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "settlements": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Crypto settlement ID", + "examples": [ + "crypto_Xk7nWp8XmQj2YrTv6" + ] + }, + "asset": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "pattern": "^[-a-zA-Z0-9]{3,8}:[-a-zA-Z0-9]{1,32}\\/[-a-zA-Z0-9]{3,8}:[-a-zA-Z0-9]{1,128}$", + "description": "[CAIP-19](https://chainagnostic.org/CAIPs/caip-19) asset identifier for the token to settle in. Format: `:/:`. For example, USDC on Base is `eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`.", + "examples": [ + "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" + ] + }, + "destination": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "pattern": "^[-a-zA-Z0-9]{3,8}:[-a-zA-Z0-9]{1,32}:[-a-zA-Z0-9]{1,128}$", + "description": "[CAIP-10](https://chainagnostic.org/CAIPs/caip-10) account identifier for the wallet that should receive the settled funds. Format: `::
`. The chain (`:`) must match the chain of the corresponding `asset`.", + "examples": [ + "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + ] + } + }, + "required": [ + "id", + "asset", + "destination" + ] + } + } + }, + "required": [ + "settlements" + ] + }, + "example": { + "settlements": [ + { + "id": "crypto_Xk7nWp8XmQj2YrTv6", + "asset": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "destination": "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + } + ] + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "params_validation", + "invalid_params", + "missing_idempotency_key", + "token_not_enabled" + ], + "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": { + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + }, + "missing_idempotency_key": { + "summary": "Missing Idempotency-Key header", + "value": { + "code": "missing_idempotency_key", + "message": "Missing Idempotency-Key header" + } + }, + "token_not_enabled": { + "summary": "This token is not enabled for this merchant yet", + "value": { + "code": "token_not_enabled", + "message": "This token is not enabled for this merchant yet" + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + }, + "404": { + "description": "Merchant not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "idempotency_conflict", + "settlement_asset_conflict", + "settlement_destination_not_ready" + ], + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "idempotency_conflict": { + "summary": "Idempotency key conflict: same key was used with a different request body", + "value": { + "code": "idempotency_conflict", + "message": "Idempotency key conflict: same key was used with a different request body" + } + }, + "settlement_asset_conflict": { + "summary": "A settlement already exists for this asset", + "value": { + "code": "settlement_asset_conflict", + "message": "A settlement already exists for this asset" + } + }, + "settlement_destination_not_ready": { + "summary": "The settlement destination is not ready to receive this asset on its network", + "value": { + "code": "settlement_destination_not_ready", + "message": "The settlement destination is not ready to receive this asset on its network" + } + } + } + } + } + }, + "502": { + "description": "Stellar destination check or transit account provisioning failed; retry shortly", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "bad_gateway", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "bad_gateway": { + "summary": "Bad Gateway", + "value": { + "code": "bad_gateway", + "message": "Bad Gateway" + } + } + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "settlements": { + "minItems": 1, + "maxItems": 50, + "type": "array", + "items": { + "type": "object", + "properties": { + "asset": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "pattern": "^[-a-zA-Z0-9]{3,8}:[-a-zA-Z0-9]{1,32}\\/[-a-zA-Z0-9]{3,8}:[-a-zA-Z0-9]{1,128}$", + "description": "[CAIP-19](https://chainagnostic.org/CAIPs/caip-19) asset identifier for the token to settle in. Format: `:/:`. For example, USDC on Base is `eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`.", + "examples": [ + "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" + ] + }, + "destination": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "pattern": "^[-a-zA-Z0-9]{3,8}:[-a-zA-Z0-9]{1,32}:[-a-zA-Z0-9]{1,128}$", + "description": "[CAIP-10](https://chainagnostic.org/CAIPs/caip-10) account identifier for the wallet that should receive the settled funds. Format: `::
`. The chain (`:`) must match the chain of the corresponding `asset`.", + "examples": [ + "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + ] + } + }, + "required": [ + "asset", + "destination" + ] + }, + "description": "List of asset/destination pairs to register. Up to 50 entries per request." + } + }, + "required": [ + "settlements" + ], + "examples": [ + { + "settlements": [ + { + "asset": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "destination": "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + }, + { + "asset": "eip155:1/erc20:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", + "destination": "eip155:1:0x1234567890abcdef1234567890abcdef12345678" + } + ] + } + ] + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/v1/merchants/{merchantId}/settlements/crypto/{id}": { + "put": { + "operationId": "CryptoSettlement_update", + "tags": [ + "Crypto Settlement" + ], + "summary": "Update a crypto settlement destination", + "description": "Change the destination wallet for an existing crypto settlement. The new `destination` must be a [CAIP-10](https://chainagnostic.org/CAIPs/caip-10) account on the same chain as the settlement's `asset`.", + "responses": { + "200": { + "description": "Settlement updated", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Crypto settlement ID", + "examples": [ + "crypto_Xk7nWp8XmQj2YrTv6" + ] + }, + "asset": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "pattern": "^[-a-zA-Z0-9]{3,8}:[-a-zA-Z0-9]{1,32}\\/[-a-zA-Z0-9]{3,8}:[-a-zA-Z0-9]{1,128}$", + "description": "[CAIP-19](https://chainagnostic.org/CAIPs/caip-19) asset identifier for the token to settle in. Format: `:/:`. For example, USDC on Base is `eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`.", + "examples": [ + "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" + ] + }, + "destination": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "pattern": "^[-a-zA-Z0-9]{3,8}:[-a-zA-Z0-9]{1,32}:[-a-zA-Z0-9]{1,128}$", + "description": "[CAIP-10](https://chainagnostic.org/CAIPs/caip-10) account identifier for the wallet that should receive the settled funds. Format: `::
`. The chain (`:`) must match the chain of the corresponding `asset`.", + "examples": [ + "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + ] + } + }, + "required": [ + "id", + "asset", + "destination" + ] + }, + "example": { + "id": "crypto_Xk7nWp8XmQj2YrTv6", + "asset": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + "destination": "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "params_validation", + "invalid_params" + ], + "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": { + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + } + } + } + } + }, + "404": { + "description": "Settlement not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + }, + "409": { + "description": "Destination not ready to receive the asset", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "settlement_destination_not_ready", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "settlement_destination_not_ready": { + "summary": "The settlement destination is not ready to receive this asset on its network", + "value": { + "code": "settlement_destination_not_ready", + "message": "The settlement destination is not ready to receive this asset on its network" + } + } + } + } + } + }, + "502": { + "description": "Stellar destination check or transit account provisioning failed; retry shortly", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "bad_gateway", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "bad_gateway": { + "summary": "Bad Gateway", + "value": { + "code": "bad_gateway", + "message": "Bad Gateway" + } + } + } + } + } + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "examples": [ + "crypto_Xk7nWp8XmQj2YrTv6" + ] + }, + "required": true, + "description": "Crypto settlement ID" + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "destination": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "pattern": "^[-a-zA-Z0-9]{3,8}:[-a-zA-Z0-9]{1,32}:[-a-zA-Z0-9]{1,128}$", + "description": "[CAIP-10](https://chainagnostic.org/CAIPs/caip-10) account identifier for the wallet that should receive the settled funds. Format: `::
`. The chain (`:`) must match the chain of the corresponding `asset`.", + "examples": [ + "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + ] + } + }, + "required": [ + "destination" + ], + "examples": [ + { + "destination": "eip155:8453:0x1234567890abcdef1234567890abcdef12345678" + } + ] + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "operationId": "CryptoSettlement_delete", + "tags": [ + "Crypto Settlement" + ], + "summary": "Delete a crypto settlement", + "description": "Remove a crypto settlement. Future payments in the deleted asset will no longer be auto-settled.", + "responses": { + "200": { + "description": "Settlement deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Crypto settlement ID" + }, + "deleted": { + "type": "boolean", + "description": "Whether the settlement was successfully deleted" + } + }, + "required": [ + "id", + "deleted" + ] + }, + "example": { + "id": "crypto_Xk7nWp8XmQj2YrTv6", + "deleted": true + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "invalid_params", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + } + } + } + } + }, + "404": { + "description": "Settlement not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "examples": [ + "crypto_Xk7nWp8XmQj2YrTv6" + ] + }, + "required": true, + "description": "Crypto settlement ID" + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/v1/merchants/{merchantId}/settlements/fiat": { + "post": { + "operationId": "FiatSettlement_create", + "tags": [ + "Fiat Settlement" + ], + "summary": "Create a fiat settlement", + "description": "Register a fiat settlement route for the merchant and kick off KYB verification. The response includes a `kybUrl` that the partner must surface to their merchant — fiat routing is only fully activated once KYB is approved. Currency is determined by `bankType`: SEPA settles in EUR, ACH in USD. ACH additionally requires a US business address and a valid US state code. Re-submitting with the same `Idempotency-Key` returns the original result; submitting a different payload under the same key returns `idempotency_conflict`. Attempting to register a bank account that already exists for the merchant returns `settlement_conflict` — delete the existing settlement first or update it via PATCH.", + "parameters": [ + { + "name": "Idempotency-Key", + "in": "header", + "required": true, + "description": "Unique key to ensure idempotent request processing. Max 255 characters.", + "schema": { + "type": "string", + "maxLength": 255 + } + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "responses": { + "201": { + "description": "Fiat settlement created. The merchant must complete KYB at `kybUrl` to activate routing.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Fiat settlement ID. Stable identifier — safe to persist on the partner side.", + "examples": [ + "fiat_Bk4nWp8XmQj2YrTv6" + ] + }, + "status": { + "type": "string", + "description": "Fiat settlement status. `pending_kyb` immediately after creation — the merchant must complete KYB at `kybUrl` before payments can route to this account. Transitions to `active` on KYB approval; `rejected` if KYB fails.", + "examples": [ + "pending_kyb" + ] + }, + "kybUrl": { + "description": "URL the merchant must visit to complete KYB verification. Returned at creation; treat as short-lived (hours to days). `null` only when no merchant action is pending.", + "examples": [ + "https://kyb.iron.io/verify/abc123" + ], + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "status", + "kybUrl" + ] + }, + "example": { + "id": "fiat_Bk4nWp8XmQj2YrTv6", + "status": "pending_kyb", + "kybUrl": "https://kyb.iron.io/verify/abc123" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "params_validation", + "invalid_params", + "missing_idempotency_key" + ], + "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": { + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + }, + "missing_idempotency_key": { + "summary": "Missing Idempotency-Key header", + "value": { + "code": "missing_idempotency_key", + "message": "Missing Idempotency-Key header" + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + }, + "404": { + "description": "Merchant not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + }, + "409": { + "description": "Conflict", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "idempotency_conflict", + "settlement_conflict" + ], + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "idempotency_conflict": { + "summary": "Idempotency key conflict: same key was used with a different request body", + "value": { + "code": "idempotency_conflict", + "message": "Idempotency key conflict: same key was used with a different request body" + } + }, + "settlement_conflict": { + "summary": "A settlement with conflicting details already exists for this merchant", + "value": { + "code": "settlement_conflict", + "message": "A settlement with conflicting details already exists for this merchant" + } + } + } + } + } + }, + "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" + } + } + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "bankDetails": { + "oneOf": [ + { + "type": "object", + "properties": { + "accountHolderName": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "Account holder name as it appears on the bank account. Usually matches the legal business name.", + "examples": [ + "Acme Corp Inc" + ] + }, + "bankName": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "Display name of the bank that holds the account.", + "examples": [ + "Chase" + ] + }, + "bankCountry": { + "description": "ISO 3166-1 alpha-2 country code of the bank.", + "type": "string", + "minLength": 2, + "maxLength": 2 + }, + "bankType": { + "type": "string", + "const": "SEPA", + "description": "Bank account type. `SEPA` settles in EUR via the SEPA network." + }, + "iban": { + "type": "string", + "minLength": 15, + "maxLength": 34, + "pattern": "^[A-Z]{2}[0-9]{2}[A-Z0-9]+$", + "description": "International Bank Account Number (ISO 13616). Uppercase alphanumeric with no spaces. Validated for format and mod-97 checksum.", + "examples": [ + "FR1420041010050500013M02606" + ] + } + }, + "required": [ + "accountHolderName", + "bankName", + "bankCountry", + "bankType", + "iban" + ], + "description": "SEPA bank account details. Settles in EUR." + }, + { + "type": "object", + "properties": { + "accountHolderName": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "Account holder name as it appears on the bank account. Usually matches the legal business name.", + "examples": [ + "Acme Corp Inc" + ] + }, + "bankName": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "Display name of the bank that holds the account.", + "examples": [ + "Chase" + ] + }, + "bankCountry": { + "description": "ISO 3166-1 alpha-2 country code of the bank.", + "type": "string", + "minLength": 2, + "maxLength": 2 + }, + "bankType": { + "type": "string", + "const": "ACH", + "description": "Bank account type. `ACH` settles in USD via the US ACH network." + }, + "accountNumber": { + "type": "string", + "minLength": 1, + "pattern": "^[0-9A-Z]{4,17}$", + "description": "US bank account number. 4–17 uppercase letters or digits.", + "examples": [ + "000123456789" + ] + }, + "routingNumber": { + "type": "string", + "minLength": 1, + "pattern": "^[0-9]{9}$", + "description": "9-digit ABA routing number identifying the US bank. Validated for ABA checksum.", + "examples": [ + "021000021" + ] + }, + "phoneNumber": { + "type": "string", + "pattern": "^\\+1[2-9]\\d{2}[2-9]\\d{6}$", + "description": "Business phone number in E.164 format. Required by Iron for ACH onboarding compliance.", + "examples": [ + "+14155551234" + ] + } + }, + "required": [ + "accountHolderName", + "bankName", + "bankCountry", + "bankType", + "accountNumber", + "routingNumber", + "phoneNumber" + ], + "description": "ACH bank account details. Settles in USD. Requires a US business address." + } + ], + "description": "Bank account that will receive fiat settlements. `bankType` discriminates the schema: SEPA requires `iban`; ACH requires `accountNumber`, `routingNumber`, and `phoneNumber`. Currency is implicit — SEPA settles in EUR, ACH in USD." + }, + "businessDetails": { + "type": "object", + "properties": { + "businessName": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "Legal name of the business that operates the merchant account.", + "examples": [ + "Acme Corp Inc" + ] + }, + "address": { + "type": "object", + "properties": { + "line1": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "Street address line 1.", + "examples": [ + "350 Fifth Avenue" + ] + }, + "line2": { + "description": "Optional second address line (suite, apartment, building, etc.). Empty strings are treated as omitted.", + "type": "string", + "maxLength": 255 + }, + "city": { + "type": "string", + "minLength": 2, + "maxLength": 255, + "description": "City or locality.", + "examples": [ + "New York" + ] + }, + "state": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "State, province, or region. For ACH this must be a valid US state or territory 2-letter code (e.g. `NY`).", + "examples": [ + "NY" + ] + }, + "country": { + "description": "ISO 3166-1 alpha-2 country code of the business address. Must be `US` when `bankType` is `ACH`.", + "type": "string", + "minLength": 2, + "maxLength": 2 + }, + "zip": { + "type": "string", + "minLength": 1, + "maxLength": 20, + "description": "Postal or ZIP code.", + "examples": [ + "10118" + ] + } + }, + "required": [ + "line1", + "city", + "state", + "country", + "zip" + ], + "description": "Registered business address used for KYB verification." + } + }, + "required": [ + "businessName", + "address" + ], + "description": "Business identity details collected for KYB verification." + } + }, + "required": [ + "bankDetails", + "businessDetails" + ] + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/v1/merchants/{merchantId}/settlements/fiat/{id}": { + "patch": { + "operationId": "FiatSettlement_update", + "tags": [ + "Fiat Settlement" + ], + "summary": "Update a fiat settlement", + "description": "Partially update the bank or business details on an existing fiat settlement. At least one of `bankDetails` or `businessDetails` must be provided. Only cosmetic fields are mutable here — `iban`, `accountNumber`, and `routingNumber` cannot be changed in place; delete the settlement and re-create it to switch accounts. Iron's `customers.update` API only accepts `email` and `external_id`, so edits to the bank/business name, address, or account-holder name do not flow back to Iron and the merchant does not need to re-verify.", + "responses": { + "200": { + "description": "Settlement updated.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Fiat settlement ID that was updated.", + "examples": [ + "fiat_Bk4nWp8XmQj2YrTv6" + ] + } + }, + "required": [ + "id" + ] + }, + "example": { + "id": "fiat_Bk4nWp8XmQj2YrTv6" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "enum": [ + "params_validation", + "invalid_params" + ], + "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": { + "params_validation": { + "summary": "Validation failed", + "value": { + "code": "params_validation", + "message": "Validation failed" + } + }, + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + }, + "404": { + "description": "Settlement not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + }, + "409": { + "description": "Settlement is managed through a partner KYB case attachment", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "settlement_conflict", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "settlement_conflict": { + "summary": "A settlement with conflicting details already exists for this merchant", + "value": { + "code": "settlement_conflict", + "message": "A settlement with conflicting details already exists for this merchant" + } + } + } + } + } + }, + "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" + } + } + } + } + } + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "examples": [ + "fiat_Bk4nWp8XmQj2YrTv6" + ] + }, + "required": true, + "description": "Fiat settlement ID returned at creation time." + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "bankDetails": { + "description": "Cosmetic bank-account updates. Account/routing numbers and IBAN cannot be changed in place — delete the settlement and re-create it to switch accounts.", + "type": "object", + "properties": { + "accountHolderName": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "Account holder name as it appears on the bank account. Usually matches the legal business name.", + "examples": [ + "Acme Corp Inc" + ] + }, + "bankName": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "Display name of the bank that holds the account.", + "examples": [ + "Chase" + ] + }, + "bankCountry": { + "description": "ISO 3166-1 alpha-2 country code of the bank.", + "type": "string", + "minLength": 2, + "maxLength": 2 + } + } + }, + "businessDetails": { + "description": "Business identity updates. Iron does not re-verify on cosmetic edits — KYB status is preserved.", + "type": "object", + "properties": { + "businessName": { + "description": "Legal name of the business.", + "examples": [ + "Acme Corp Inc" + ], + "type": "string", + "minLength": 1, + "maxLength": 255 + }, + "address": { + "description": "Subset of business address fields to update. Partial updates are merged with the existing record.", + "type": "object", + "properties": { + "line1": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "Street address line 1.", + "examples": [ + "350 Fifth Avenue" + ] + }, + "line2": { + "description": "Optional second address line (suite, apartment, building, etc.). Empty strings are treated as omitted.", + "type": "string", + "maxLength": 255 + }, + "city": { + "type": "string", + "minLength": 2, + "maxLength": 255, + "description": "City or locality.", + "examples": [ + "New York" + ] + }, + "state": { + "type": "string", + "minLength": 1, + "maxLength": 255, + "description": "State, province, or region. For ACH this must be a valid US state or territory 2-letter code (e.g. `NY`).", + "examples": [ + "NY" + ] + }, + "country": { + "description": "ISO 3166-1 alpha-2 country code of the business address. Must be `US` when `bankType` is `ACH`.", + "type": "string", + "minLength": 2, + "maxLength": 2 + }, + "zip": { + "type": "string", + "minLength": 1, + "maxLength": 20, + "description": "Postal or ZIP code.", + "examples": [ + "10118" + ] + } + } + } + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "operationId": "FiatSettlement_delete", + "tags": [ + "Fiat Settlement" + ], + "summary": "Delete a fiat settlement", + "description": "Soft-delete a fiat settlement route. Future payments will no longer auto-settle to this fiat account. MX notifies the Core API, which handles async deactivation of the underlying autoramps.", + "responses": { + "200": { + "description": "Settlement deleted.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Fiat settlement ID that was deleted.", + "examples": [ + "fiat_Bk4nWp8XmQj2YrTv6" + ] + }, + "deleted": { + "type": "boolean", + "description": "Always `true` on success. Future payments will no longer route to this fiat account.", + "examples": [ + true + ] + } + }, + "required": [ + "id", + "deleted" + ] + }, + "example": { + "id": "fiat_Bk4nWp8XmQj2YrTv6", + "deleted": true + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "invalid_params", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "invalid_params": { + "summary": "Invalid request parameters", + "value": { + "code": "invalid_params", + "message": "Invalid request parameters" + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "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" + } + } + } + } + } + }, + "404": { + "description": "Settlement not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "not_found", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "not_found": { + "summary": "Not Found", + "value": { + "code": "not_found", + "message": "Not Found" + } + } + } + } + } + }, + "409": { + "description": "Settlement is managed through a partner KYB case attachment", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "type": "string", + "const": "settlement_conflict", + "description": "Machine-readable error code" + }, + "details": { + "description": "Additional structured error details", + "type": "object", + "propertyNames": { + "type": "string" + }, + "additionalProperties": {} + } + }, + "required": [ + "message", + "code" + ] + }, + "examples": { + "settlement_conflict": { + "summary": "A settlement with conflicting details already exists for this merchant", + "value": { + "code": "settlement_conflict", + "message": "A settlement with conflicting details already exists for this merchant" + } + } + } + } + } + }, + "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" + } + } + } + } + } + } + }, + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "minLength": 1, + "maxLength": 256, + "examples": [ + "fiat_Bk4nWp8XmQj2YrTv6" + ] + }, + "required": true, + "description": "Fiat settlement ID returned at creation time." + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "merchantId", + "required": true + } + ], + "security": [ + { + "apiKey": [] + } + ] + } + } + }, + "tags": [ + { + "name": "Gateway" + }, + { + "name": "Payments" + }, + { + "name": "Webhooks" + }, + { + "name": "Refunds" + }, + { + "name": "Merchant Management" + }, + { + "name": "Settlements" + }, + { + "name": "Crypto Settlement" + }, + { + "name": "Fiat Settlement" + } + ], + "components": { + "schemas": { + "Action": { + "oneOf": [ + { + "type": "object", + "description": "An action that requires a wallet RPC call to complete", + "required": [ + "data", + "type" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/WalletRpcAction", + "description": "An action that requires a wallet RPC call to complete" + }, + "type": { + "type": "string", + "enum": [ + "walletRpc" + ] + } + } + }, + { + "type": "object", + "description": "An action that requires building to complete", + "required": [ + "data", + "type" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/Build", + "description": "An action that requires building to complete" + }, + "type": { + "type": "string", + "enum": [ + "build" + ] + } + } + }, + { + "type": "object", + "description": "Send an amount to an account. The whole action, with no transaction to\nbuild or sign.", + "required": [ + "data", + "type" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/TransferAction", + "description": "Send an amount to an account. The whole action, with no transaction to\nbuild or sign." + }, + "type": { + "type": "string", + "enum": [ + "transfer" + ] + } + } + } + ], + "example": { + "data": { + "chain_id": "eip155:8453", + "method": "eth_signTypedData_v4", + "params": [ + "0x0000000000000000000000000000000000000000", + "{\"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\"}}" + ] + }, + "type": "walletRpc" + } + }, + "Amount": { + "type": "object", + "required": [ + "unit", + "value", + "display" + ], + "properties": { + "display": { + "$ref": "#/components/schemas/AmountDisplay", + "description": "Display information for the amount" + }, + "unit": { + "type": "string", + "description": "Currency unit, prefixed with either \"iso4217/\" or \"caip19/\"", + "example": "iso4217/USD" + }, + "value": { + "type": "string", + "description": "Amount value, in the currency unit's minor units" + } + }, + "example": { + "display": { + "assetName": "USD Coin", "assetSymbol": "USDC", "decimals": 6, "iconUrl": "https://assets.walletconnect.com/usdc.png", @@ -2714,7 +9537,7 @@ "expiresAt": 1718236800, "gatewayUrl": "https://api.pay.walletconnect.com/pay_123", "isFinal": false, - "paymentId": "pay_c8a2ecc101M7W4KR8EF5FM7CMD14MAEK85", + "paymentId": "pay_a0a2ecc101M7WG0ACBEX6FY72RC8M480J5", "pollInMs": 1000, "status": "requires_action" } @@ -2861,7 +9684,7 @@ "example": { "cancelledAt": "2025-01-14T10:30:00Z", "cancelledReason": "cancelled_by_user", - "paymentId": "pay_daa2ecc101M7W4KR8GJK7F86HM8J02BMCT", + "paymentId": "pay_7aa2ecc101M7WG0ACDV5MZVKK7T80HRG8W", "status": "cancelled" } }, @@ -3761,7 +10584,7 @@ "example": { "cancelledAt": "2025-01-14T10:30:00Z", "cancelledReason": "cancelled_by_merchant", - "paymentId": "pay_4aa2ecc101M7W4KR8E2Z6Z02DB70AGET15", + "paymentId": "pay_75a2ecc101M7WG0ACBSBVDW3QGXZ2QKMGK", "status": "cancelled" } }, @@ -4240,72 +11063,592 @@ "description": "The canonical (fee-bump) hash, hex." } } - }, - "namespace": { - "type": "string", - "enum": [ - "stellar" - ] + }, + "namespace": { + "type": "string", + "enum": [ + "stellar" + ] + } + } + }, + { + "type": "object", + "required": [ + "data", + "namespace" + ], + "properties": { + "data": { + "type": "object", + "required": [ + "tx_hash" + ], + "properties": { + "tx_hash": { + "type": "string", + "description": "The canonical txID (`sha256(raw_data)`), hex." + } + } + }, + "namespace": { + "type": "string", + "enum": [ + "tron" + ] + } + } + } + ], + "description": "Chain-agnostic confirmed-transaction identifier. Used only as the lifted id on\n`CryptoTransferActionState::Confirmed` and in API responses — never an\nin-flight state." + }, + "WalletRpcAction": { + "type": "object", + "required": [ + "chain_id", + "method", + "params" + ], + "properties": { + "chain_id": { + "type": "string" + }, + "method": { + "type": "string" + }, + "params": { + "type": "array", + "items": {} + } + }, + "example": { + "chain_id": "eip155:8453", + "method": "eth_signTypedData_v4", + "params": [ + "0x0000000000000000000000000000000000000000", + "{\"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\"}}" + ] + } + }, + "MerchantApiErrorCode": { + "type": "string", + "enum": [ + "invalid_params", + "params_validation", + "not_found", + "internal_error", + "bad_gateway", + "rate_limited", + "payment_transition_conflict", + "payment_transition_unavailable", + "settlement_asset_conflict", + "settlement_conflict", + "settlement_destination_not_ready", + "token_not_enabled", + "version_conflict", + "payouts_unavailable", + "payout_not_cancellable", + "logo_too_small", + "logo_too_large", + "logo_not_square", + "logo_file_too_big", + "logo_invalid_mime", + "logo_invalid_dimensions", + "missing_api_key", + "invalid_api_key", + "missing_merchant_id", + "invalid_api_version", + "unknown_api_version", + "api_version_downgrade", + "idempotency_conflict", + "missing_idempotency_key", + "payment_not_succeeded", + "already_refunded", + "receipt_unavailable", + "receipt_service_unavailable", + "payouts_disabled", + "unsupported_asset", + "payout_account_unavailable", + "payout_account_busy", + "screening_unavailable" + ], + "description": "Machine-readable error code" + }, + "MerchantApiErrorResponse": { + "type": "object", + "required": [ + "message", + "code" + ], + "properties": { + "message": { + "type": "string", + "description": "Human-readable error message" + }, + "code": { + "$ref": "#/components/schemas/MerchantApiErrorCode" + }, + "issues": { + "type": "array", + "description": "Field-level validation issues (present on validation errors)", + "items": { + "type": "object", + "required": [ + "field", + "message" + ], + "properties": { + "field": { + "type": "string" + }, + "message": { + "type": "string" + } } } + } + } + }, + "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": [ - "data", - "namespace" + "assetSymbol", + "assetName", + "decimals" ], - "properties": { - "data": { + "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", - "required": [ - "tx_hash" - ], "properties": { - "tx_hash": { - "type": "string", - "description": "The canonical txID (`sha256(raw_data)`), hex." + "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" }, - "namespace": { - "type": "string", - "enum": [ - "tron" - ] + { + "type": "null" } - } + ] } + }, + "required": [ + "unit", + "value", + "display" ], - "description": "Chain-agnostic confirmed-transaction identifier. Used only as the lifted id on\n`CryptoTransferActionState::Confirmed` and in API responses — never an\nin-flight state." + "description": "Token-denominated amount" }, - "WalletRpcAction": { + "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": [ - "chain_id", - "method", - "params" + "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": { - "chain_id": { - "type": "string" + "status": { + "type": "string", + "description": "Refund state. \"fully_refunded\" is the only value this API emits.", + "examples": [ + "fully_refunded" + ] }, - "method": { + "fullyRefundedAt": { + "description": "ISO 8601 timestamp when the payment was fully refunded. Present only for fully refunded payments.", "type": "string" - }, - "params": { + } + }, + "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." + }, + "MerchantPaymentsResponse": { + "type": "object", + "properties": { + "data": { "type": "array", - "items": {} + "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" } }, - "example": { - "chain_id": "eip155:8453", - "method": "eth_signTypedData_v4", - "params": [ - "0x0000000000000000000000000000000000000000", - "{\"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\"}}" - ] - } + "required": [ + "data", + "nextCursor", + "stats" + ] } }, "securitySchemes": { @@ -4325,6 +11668,12 @@ "in": "header", "name": "App-Id", "description": "Public App ID for wallet authentication. When using this auth mode, the Client-Id header is also required." + }, + "apiKey": { + "type": "apiKey", + "in": "header", + "name": "Api-Key", + "description": "Partner API key." } } }, diff --git a/scripts/generate-specs.mjs b/scripts/generate-specs.mjs index 9374366..a1cae94 100644 --- a/scripts/generate-specs.mjs +++ b/scripts/generate-specs.mjs @@ -12,9 +12,19 @@ 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' }]; +// Every operation is documented under the Core base URL, the only host integrators call. The API +// gateway on api.pay.walletconnect.com forwards some routes to the merchant service +// (api.merchant.pay.walletconnect.com), so only those are taken from its spec: the rest of it isn't +// reachable through the gateway and isn't part of the public API reference. +const SERVICES = [ + { name: 'Core', baseUrl: 'https://api.pay.walletconnect.com' }, + { + name: 'Merchant', + baseUrl: 'https://api.merchant.pay.walletconnect.com', + isForwarded: (method, path) => + /^\/v1\/(merchants|refunds)(\/|$)/.test(path) || (method === 'get' && path === '/v1/payments'), + }, +]; const VERSION_RE = /^\d{4}-\d{2}-\d{2}(\.preview)?$/; @@ -43,8 +53,17 @@ function mergeSpecs(specs, version) { const seenTags = new Set(); - for (const spec of specs) { - for (const [path, methods] of Object.entries(spec.paths || {})) { + for (const [i, spec] of specs.entries()) { + const { isForwarded } = SERVICES[i]; + for (const [path, allMethods] of Object.entries(spec.paths || {})) { + const methods = {}; + for (const [method, op] of Object.entries(allMethods)) { + if (isForwarded && !isForwarded(method, path)) continue; + if (merged.paths[path]?.[method]) throw new Error(`${method.toUpperCase()} ${path} is in more than one spec`); + // Only the first spec's top-level security survives the merge, so each operation keeps its own. + methods[method] = op.security || !spec.security ? op : { ...op, security: spec.security }; + } + if (Object.keys(methods).length === 0) continue; merged.paths[path] = { ...(merged.paths[path] || {}), ...methods }; for (const op of Object.values(methods)) { for (const tagName of op.tags || []) { @@ -57,7 +76,8 @@ function mergeSpecs(specs, version) { } for (const tag of spec.tags || []) { - if (!seenTags.has(tag.name)) { + // A filtered spec's other tags belong to operations that were left out. + if (!seenTags.has(tag.name) && !isForwarded) { seenTags.add(tag.name); merged.tags.push(tag); }