diff --git a/Cargo.lock b/Cargo.lock index 95f4ebc8..15aae020 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -530,7 +530,7 @@ dependencies = [ "derive_more 2.1.1", "foldhash 0.2.0", "hashbrown 0.16.1", - "indexmap 2.13.0", + "indexmap 2.14.0", "itoa", "k256 0.13.4", "keccak-asm", @@ -782,7 +782,7 @@ dependencies = [ "async-trait", "coins-ledger", "futures-util", - "semver 1.0.27", + "semver 1.0.28", "thiserror 2.0.18", "tracing", ] @@ -846,7 +846,7 @@ dependencies = [ "alloy-sol-macro-input", "const-hex", "heck 0.5.0", - "indexmap 2.13.0", + "indexmap 2.14.0", "proc-macro-error2", "proc-macro2", "quote", @@ -5719,7 +5719,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.13.0", + "indexmap 2.14.0", "slab", "tokio", "tokio-util", @@ -5738,7 +5738,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.4.0", - "indexmap 2.13.0", + "indexmap 2.14.0", "slab", "tokio", "tokio-util", @@ -5812,6 +5812,12 @@ dependencies = [ "serde_core", ] +[[package]] +name = "hashbrown" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" + [[package]] name = "hdrhistogram" version = "7.5.4" @@ -6414,12 +6420,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.13.0" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" dependencies = [ "equivalent", - "hashbrown 0.16.1", + "hashbrown 0.17.0", "serde", "serde_core", ] @@ -7061,7 +7067,7 @@ checksum = "0d61ec3e1ff8aaee8c5151688550c0363f85bc37845450764c31ff7584a33f38" dependencies = [ "anyhow", "camino", - "indexmap 2.13.0", + "indexmap 2.14.0", "parking_lot", "proc-macro2", "quote", @@ -7513,7 +7519,7 @@ source = "git+https://github.com/mystenlabs/sui?rev=f9c8d50#f9c8d503474a0339548f dependencies = [ "anyhow", "enum-compat-util", - "indexmap 2.13.0", + "indexmap 2.14.0", "move-abstract-interpreter", "move-core-types", "move-proc-macros", @@ -7549,7 +7555,7 @@ version = "0.1.0" source = "git+https://github.com/mystenlabs/sui?rev=f9c8d50#f9c8d503474a0339548fea1bd49489b5275b9af8" dependencies = [ "anyhow", - "indexmap 2.13.0", + "indexmap 2.14.0", "move-binary-format", "move-core-types", "petgraph 0.8.3", @@ -7648,7 +7654,7 @@ dependencies = [ "enum-compat-util", "ethnum", "hex", - "indexmap 2.13.0", + "indexmap 2.14.0", "leb128", "move-proc-macros", "num 0.4.3", @@ -7673,7 +7679,7 @@ dependencies = [ "clap", "codespan", "colored", - "indexmap 2.13.0", + "indexmap 2.14.0", "lcov", "move-abstract-interpreter", "move-binary-format", @@ -8350,6 +8356,23 @@ dependencies = [ "smallvec", ] +[[package]] +name = "oas3" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ed0821ab10d7703415a06df039c2493f3a7667999d8b4e104731de0c53796f" +dependencies = [ + "derive_more 2.1.1", + "http 1.4.0", + "log", + "once_cell", + "regex", + "semver 1.0.28", + "serde", + "serde_json", + "url", +] + [[package]] name = "object" version = "0.37.3" @@ -8440,17 +8463,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" -[[package]] -name = "openapiv3" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8d427828b22ae1fff2833a03d8486c2c881367f1c336349f307f321e7f4d05" -dependencies = [ - "indexmap 2.13.0", - "serde", - "serde_json", -] - [[package]] name = "openssl" version = "0.10.76" @@ -8741,7 +8753,7 @@ dependencies = [ "data-encoding", "getrandom 0.2.17", "hmac 0.12.1", - "indexmap 2.13.0", + "indexmap 2.14.0", "rand 0.8.5", "serde", "serde_json", @@ -8930,7 +8942,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset 0.4.2", - "indexmap 2.13.0", + "indexmap 2.14.0", ] [[package]] @@ -8941,7 +8953,7 @@ checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455" dependencies = [ "fixedbitset 0.5.7", "hashbrown 0.15.5", - "indexmap 2.13.0", + "indexmap 2.14.0", "serde", ] @@ -9299,9 +9311,8 @@ dependencies = [ [[package]] name = "progenitor" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2326f73d5326257514712436680ef8da4543ee47c0e9e0d501545c8909ee12e4" +version = "0.14.0" +source = "git+https://github.com/WalletConnect/progenitor.git?rev=604aacb0df72ee1d288942ebb85cdfa6f37a79fe#604aacb0df72ee1d288942ebb85cdfa6f37a79fe" dependencies = [ "progenitor-client", "progenitor-impl", @@ -9310,9 +9321,8 @@ dependencies = [ [[package]] name = "progenitor-client" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71a0beb939758f229cbae70a4889c7c76a4ac0e90f0b1e7ae9b4636a927d1018" +version = "0.14.0" +source = "git+https://github.com/WalletConnect/progenitor.git?rev=604aacb0df72ee1d288942ebb85cdfa6f37a79fe#604aacb0df72ee1d288942ebb85cdfa6f37a79fe" dependencies = [ "bytes", "futures-core", @@ -9325,14 +9335,13 @@ dependencies = [ [[package]] name = "progenitor-impl" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f6d9109b04e005bbdec84cacec7e81cc15533f2b5dc505f0defc212d270c15" +version = "0.14.0" +source = "git+https://github.com/WalletConnect/progenitor.git?rev=604aacb0df72ee1d288942ebb85cdfa6f37a79fe#604aacb0df72ee1d288942ebb85cdfa6f37a79fe" dependencies = [ "heck 0.5.0", "http 1.4.0", - "indexmap 2.13.0", - "openapiv3", + "indexmap 2.14.0", + "oas3", "proc-macro2", "quote", "regex", @@ -9347,11 +9356,10 @@ dependencies = [ [[package]] name = "progenitor-macro" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46596c574831739c661f22923fe587399c61f5e3e79b73cc9a93644c72248d84" +version = "0.14.0" +source = "git+https://github.com/WalletConnect/progenitor.git?rev=604aacb0df72ee1d288942ebb85cdfa6f37a79fe#604aacb0df72ee1d288942ebb85cdfa6f37a79fe" dependencies = [ - "openapiv3", + "oas3", "proc-macro2", "progenitor-impl", "quote", @@ -10005,9 +10013,9 @@ checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" [[package]] name = "regress" -version = "0.10.5" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2057b2325e68a893284d1538021ab90279adac1139957ca2a74426c6f118fb48" +checksum = "158a764437582235e3501f683b93a0a6f8d825d04a789dbe5ed30b8799b8908a" dependencies = [ "hashbrown 0.16.1", "memchr", @@ -10385,7 +10393,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.27", + "semver 1.0.28", ] [[package]] @@ -10395,7 +10403,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dd18cd2bae1820af0b6ad5e54f4a51d0f3fcc53b05f845675074efcc7af071d" dependencies = [ "rustc_version 0.4.1", - "semver 1.0.27", + "semver 1.0.28", ] [[package]] @@ -10925,9 +10933,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" dependencies = [ "serde", "serde_core", @@ -11095,7 +11103,7 @@ version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" dependencies = [ - "indexmap 2.13.0", + "indexmap 2.14.0", "itoa", "memchr", "serde", @@ -11179,7 +11187,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.13.0", + "indexmap 2.14.0", "schemars 0.9.0", "schemars 1.2.1", "serde_core", @@ -11218,7 +11226,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.13.0", + "indexmap 2.14.0", "itoa", "ryu", "serde", @@ -11551,7 +11559,7 @@ version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1c97747dbf44bb1ca44a561ece23508e99cb592e862f22222dcf42f51d1e451" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", "syn 2.0.117", @@ -11790,7 +11798,7 @@ dependencies = [ "dashmap 5.5.3", "futures", "futures-util", - "indexmap 2.13.0", + "indexmap 2.14.0", "indicatif", "log", "rayon", @@ -11906,7 +11914,7 @@ dependencies = [ "bincode", "crossbeam-channel", "futures-util", - "indexmap 2.13.0", + "indexmap 2.14.0", "log", "rand 0.8.5", "rayon", @@ -12496,7 +12504,7 @@ dependencies = [ "futures-util", "http 0.2.12", "log", - "semver 1.0.27", + "semver 1.0.28", "serde", "serde_json", "solana-account-decoder-client-types", @@ -12599,7 +12607,7 @@ dependencies = [ "log", "reqwest 0.12.28", "reqwest-middleware", - "semver 1.0.27", + "semver 1.0.28", "serde", "serde_json", "solana-account", @@ -12670,7 +12678,7 @@ checksum = "aceb2a48783c4297f564b8f8f962181d921ac004e84efbd7313cf44e3ad54a83" dependencies = [ "base64 0.22.1", "bs58 0.5.1", - "semver 1.0.27", + "semver 1.0.28", "serde", "serde_json", "solana-account", @@ -12935,7 +12943,7 @@ dependencies = [ "futures-util", "governor", "histogram", - "indexmap 2.13.0", + "indexmap 2.14.0", "itertools 0.12.1", "libc", "log", @@ -13084,7 +13092,7 @@ dependencies = [ "async-trait", "bincode", "futures-util", - "indexmap 2.13.0", + "indexmap 2.14.0", "indicatif", "log", "rayon", @@ -13224,7 +13232,7 @@ checksum = "d84bcb8923fe9a7f8acb2cea7bf7aa4e1603d77b207d318b3315e5b1eec65dc2" dependencies = [ "agave-feature-set", "rand 0.8.5", - "semver 1.0.27", + "semver 1.0.28", "serde", "solana-sanitize", "solana-serde-varint", @@ -14197,7 +14205,7 @@ dependencies = [ "fastcrypto-tbls", "fastcrypto-zkp", "im", - "indexmap 2.13.0", + "indexmap 2.14.0", "itertools 0.13.0", "lru 0.10.1", "move-binary-format", @@ -14364,7 +14372,7 @@ dependencies = [ "erased", "futures", "html-escape", - "indexmap 2.13.0", + "indexmap 2.14.0", "itertools 0.14.0", "js-sys", "linear-map", @@ -14894,7 +14902,7 @@ version = "0.9.12+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" dependencies = [ - "indexmap 2.13.0", + "indexmap 2.14.0", "serde_core", "serde_spanned", "toml_datetime 0.7.5+spec-1.1.0", @@ -14940,7 +14948,7 @@ version = "0.25.8+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16bff38f1d86c47f9ff0647e6838d7bb362522bdf44006c7068c2b1e606f1f3c" dependencies = [ - "indexmap 2.13.0", + "indexmap 2.14.0", "toml_datetime 1.1.0+spec-1.1.0", "toml_parser", "winnow 1.0.0", @@ -15171,7 +15179,7 @@ dependencies = [ "futures-core", "futures-util", "hdrhistogram", - "indexmap 2.13.0", + "indexmap 2.14.0", "pin-project-lite", "slab", "sync_wrapper", @@ -15504,9 +15512,9 @@ dependencies = [ [[package]] name = "typify" -version = "0.4.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7144144e97e987c94758a3017c920a027feac0799df325d6df4fc8f08d02068e" +checksum = "bc0b89f47309feaeb23c4509c15c9a04234f7deccef6f96c3bfe95319819a304" dependencies = [ "typify-impl", "typify-macro", @@ -15514,9 +15522,9 @@ dependencies = [ [[package]] name = "typify-impl" -version = "0.4.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "062879d46aa4c9dfe0d33b035bbaf512da192131645d05deacb7033ec8581a09" +checksum = "fa7b026f540b148b81043c720889dbb942b08659aa8a43f624ac4f04dbfc1861" dependencies = [ "heck 0.5.0", "log", @@ -15524,7 +15532,7 @@ dependencies = [ "quote", "regress", "schemars 0.8.22", - "semver 1.0.27", + "semver 1.0.28", "serde", "serde_json", "syn 2.0.117", @@ -15534,14 +15542,14 @@ dependencies = [ [[package]] name = "typify-macro" -version = "0.4.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9708a3ceb6660ba3f8d2b8f0567e7d4b8b198e2b94d093b8a6077a751425de9e" +checksum = "39ed96c57f06ae0839416b986921a98f18b220da63bbb243a8570a00c8492183" dependencies = [ "proc-macro2", "quote", "schemars 0.8.22", - "semver 1.0.27", + "semver 1.0.28", "serde", "serde_json", "serde_tokenstream", @@ -15652,7 +15660,7 @@ dependencies = [ "glob", "goblin", "heck 0.5.0", - "indexmap 2.13.0", + "indexmap 2.14.0", "once_cell", "serde", "tempfile", @@ -15695,7 +15703,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98f51ebca0d9a4b2aa6c644d5ede45c56f73906b96403c08a1985e75ccb64a01" dependencies = [ "anyhow", - "indexmap 2.13.0", + "indexmap 2.14.0", "proc-macro2", "quote", "syn 2.0.117", @@ -15738,7 +15746,7 @@ checksum = "a806dddc8208f22efd7e95a5cdf88ed43d0f3271e8f63b47e757a8bbdb43b63a" dependencies = [ "anyhow", "heck 0.5.0", - "indexmap 2.13.0", + "indexmap 2.14.0", "tempfile", "uniffi_internal_macros", ] @@ -16081,7 +16089,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" dependencies = [ "anyhow", - "indexmap 2.13.0", + "indexmap 2.14.0", "wasm-encoder", "wasmparser", ] @@ -16145,8 +16153,8 @@ checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" dependencies = [ "bitflags 2.11.0", "hashbrown 0.15.5", - "indexmap 2.13.0", - "semver 1.0.27", + "indexmap 2.14.0", + "semver 1.0.28", ] [[package]] @@ -16569,7 +16577,7 @@ checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" dependencies = [ "anyhow", "heck 0.5.0", - "indexmap 2.13.0", + "indexmap 2.14.0", "prettyplease", "syn 2.0.117", "wasm-metadata", @@ -16600,7 +16608,7 @@ checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" dependencies = [ "anyhow", "bitflags 2.11.0", - "indexmap 2.13.0", + "indexmap 2.14.0", "log", "serde", "serde_derive", @@ -16619,9 +16627,9 @@ checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" dependencies = [ "anyhow", "id-arena", - "indexmap 2.13.0", + "indexmap 2.14.0", "log", - "semver 1.0.27", + "semver 1.0.28", "serde", "serde_derive", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 478475a9..324c0dba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,8 +50,8 @@ uniffi_build = { version = "0.31.0", default-features = false } uniffi = { version = "0.31.0", default-features = false, features = ["tokio"] } # API client generation -progenitor = { version = "0.11.2", default-features = false, features = ["macro"] } -progenitor-client = { version = "0.11.2", default-features = false } +progenitor = { git = "https://github.com/WalletConnect/progenitor.git", rev = "604aacb0df72ee1d288942ebb85cdfa6f37a79fe", default-features = false, features = ["macro"] } +progenitor-client = { git = "https://github.com/WalletConnect/progenitor.git", rev = "604aacb0df72ee1d288942ebb85cdfa6f37a79fe", default-features = false } uniffi_macros = { version = "0.31.0", default-features = false } wasm-bindgen = "0.2" diff --git a/crates/yttrium/src/pay/mod.rs b/crates/yttrium/src/pay/mod.rs index 47adbb23..272a7ac8 100644 --- a/crates/yttrium/src/pay/mod.rs +++ b/crates/yttrium/src/pay/mod.rs @@ -612,8 +612,8 @@ impl From for CollectDataAction { fn from(c: types::CollectData) -> Self { Self { fields: c.fields.into_iter().map(Into::into).collect(), - url: c.url, - schema: c.schema.and_then(|s| serde_json::to_string(&s).ok()), + url: Some(c.url), + schema: serde_json::to_string(&c.schema).ok(), } } } @@ -963,7 +963,7 @@ impl WalletConnectPay { &self.config, &self.client_id ) - .id(&payment_id) + .id(payment_id.clone()) .include_payment_info(include_payment_info) .body(body.clone()) .send() @@ -982,14 +982,11 @@ impl WalletConnectPay { })?; let api_response = response.into_inner(); - pay_debug!( - "get_payment_options: success, {} options", - api_response.options.len() - ); + let options = api_response.options.unwrap_or_default(); + pay_debug!("get_payment_options: success, {} options", options.len()); // Cache the options with their raw actions - let cached: Vec = api_response - .options + let cached: Vec = options .iter() .map(|o| CachedPaymentOption { option_id: o.id.clone(), @@ -1006,7 +1003,7 @@ impl WalletConnectPay { Ok(PaymentOptionsResponse { payment_id, info: api_response.info.map(Into::into), - options: api_response.options.into_iter().map(Into::into).collect(), + options: options.into_iter().map(Into::into).collect(), collect_data: api_response.collect_data.map(Into::into), }) } @@ -1145,7 +1142,7 @@ impl WalletConnectPay { &self.config, &self.client_id ) - .id(&payment_id) + .id(payment_id.clone()) .body(body.clone()); if let Some(ms) = max_poll_ms { req = req.max_poll_ms(ms); @@ -1352,7 +1349,7 @@ impl WalletConnectPay { &self.config, &self.client_id ) - .id(payment_id) + .id(payment_id.to_string()) .body(body.clone()) .send() .await @@ -1371,7 +1368,7 @@ impl WalletConnectPay { &self.config, &self.client_id ) - .id(&payment_id); + .id(payment_id.clone()); if let Some(ms) = max_poll_ms { req = req.max_poll_ms(ms); } diff --git a/crates/yttrium/src/pay/openapi.json b/crates/yttrium/src/pay/openapi.json index a9bec22d..99641912 100644 --- a/crates/yttrium/src/pay/openapi.json +++ b/crates/yttrium/src/pay/openapi.json @@ -1,2373 +1,3238 @@ { - "openapi": "3.0.3", - "info": { - "title": "WalletConnect Pay API", - "description": "API for the WalletConnect Pay service", - "contact": { - "name": "WalletConnect", - "url": "https://walletconnect.com" - }, - "license": { - "name": "" - }, - "version": "2026-02-19.preview" - }, - "servers": [ - { - "url": "https://api.pay.walletconnect.com" - } - ], - "paths": { - "/v1/gateway/payment/{id}": { - "get": { - "tags": [ - "Gateway" - ], - "summary": "Get a payment", - "description": "This endpoint returns only basic information to display to the user to begin the payment flow.", - "operationId": "gatewayGetPayment", - "parameters": [ - { - "name": "Api-Key", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "App-Id", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "Client-Id", - "in": "header", - "required": false, - "schema": { - "type": "string" - } + "components": { + "schemas": { + "Action": { + "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" + }, + "oneOf": [ { - "name": "WCP-Version", - "in": "header", - "required": false, - "schema": { - "type": "string" - } + "description": "An action that requires a wallet RPC call to complete", + "properties": { + "data": { + "$ref": "#/components/schemas/WalletRpcAction", + "description": "An action that requires a wallet RPC call to complete" + }, + "type": { + "enum": [ + "walletRpc" + ], + "type": "string" + } + }, + "required": [ + "data", + "type" + ], + "type": "object" }, { - "name": "Sdk-Name", - "in": "header", - "required": false, - "schema": { - "type": "string" - } + "description": "An action that requires building to complete", + "properties": { + "data": { + "$ref": "#/components/schemas/Build", + "description": "An action that requires building to complete" + }, + "type": { + "enum": [ + "build" + ], + "type": "string" + } + }, + "required": [ + "data", + "type" + ], + "type": "object" + } + ] + }, + "Amount": { + "example": { + "display": { + "assetName": "USD Coin", + "assetSymbol": "USDC", + "decimals": 6, + "iconUrl": "https://assets.walletconnect.com/usdc.png", + "networkIconUrl": "https://assets.walletconnect.com/base.png", + "networkName": "Base" }, - { - "name": "Sdk-Version", - "in": "header", - "required": false, - "schema": { - "type": "string" - } + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "1000000" + }, + "properties": { + "display": { + "$ref": "#/components/schemas/AmountDisplay", + "description": "Display information for the amount" }, - { - "name": "Sdk-Platform", - "in": "header", - "required": false, - "schema": { - "type": "string" - } + "unit": { + "type": "string", + "example": "iso4217/USD", + "description": "Currency unit, prefixed with either \"iso4217/\" or \"caip19/\"" }, - { - "name": "id", - "in": "path", - "description": "Payment ID", - "required": true, - "schema": { - "type": "string" - } + "value": { + "description": "Amount value, in the currency unit's minor units", + "type": "string" } + }, + "required": [ + "unit", + "value", + "display" ], - "responses": { - "200": { - "description": "Payment status retrieved successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetPaymentResponse" - } - } - } + "type": "object" + }, + "AmountDisplay": { + "example": { + "assetName": "USD Coin", + "assetSymbol": "USDC", + "decimals": 6, + "iconUrl": "https://assets.walletconnect.com/usdc.png", + "networkIconUrl": "https://assets.walletconnect.com/base.png", + "networkName": "Base" + }, + "properties": { + "assetName": { + "description": "Full name of the asset", + "type": "string" }, - "400": { - "description": "Invalid request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } + "assetSymbol": { + "description": "Ticker/symbol of the asset", + "type": "string" }, - "401": { - "description": "Invalid API key", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } + "decimals": { + "description": "Number of minor decimals of the asset", + "format": "int32", + "minimum": 0, + "type": "integer" }, - "404": { - "description": "Payment not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } + "iconUrl": { + "description": "URL of the icon of the asset (if token)", + "type": [ + "string", + "null" + ] }, - "500": { - "description": "Internal error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } + "networkIconUrl": { + "description": "URL of the icon of the network (if token)", + "type": [ + "string", + "null" + ] + }, + "networkName": { + "description": "Name of the network of the asset (if token)", + "type": [ + "string", + "null" + ] } - } - } - }, - "/v1/gateway/payment/{id}/confirm": { - "post": { - "tags": [ - "Gateway" + }, + "required": [ + "assetSymbol", + "assetName", + "decimals" ], - "summary": "Confirm a payment", - "description": "This endpoint confirms a payment and submits it to the blockchain for processing.", - "operationId": "confirm_payment_handler", - "parameters": [ - { - "name": "Api-Key", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "App-Id", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "Client-Id", - "in": "header", - "required": false, - "schema": { - "type": "string" - } + "type": "object" + }, + "AmountParameter": { + "example": { + "unit": "iso4217/USD", + "value": "100" + }, + "properties": { + "unit": { + "type": "string", + "example": "iso4217/USD", + "description": "Currency unit, prefixed with either \"iso4217/\" or \"caip19/\"" }, - { - "name": "WCP-Version", - "in": "header", - "required": false, - "schema": { - "type": "string" - } + "value": { + "description": "Amount value, in the currency unit's minor units", + "type": "string" + } + }, + "required": [ + "unit", + "value" + ], + "type": "object" + }, + "Build": { + "example": { + "data": "..." + }, + "properties": { + "data": { + "type": "string" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "BuyerInfo": { + "example": { + "accountCaip10": "eip155:1:0x0000000000000000000000000000000000000000", + "accountProviderIcon": "https://example.com/icon.png", + "accountProviderName": "Wallet" + }, + "properties": { + "accountCaip10": { + "description": "Account CAIP-10", + "type": "string" }, - { - "name": "Sdk-Name", - "in": "header", - "required": false, - "schema": { - "type": "string" - } + "accountProviderIcon": { + "description": "Account provider icon URL", + "type": [ + "string", + "null" + ] }, - { - "name": "Sdk-Version", - "in": "header", - "required": false, - "schema": { - "type": "string" + "accountProviderName": { + "description": "Account provider name", + "type": "string" + } + }, + "required": [ + "accountCaip10", + "accountProviderName" + ], + "type": "object" + }, + "CollectData": { + "example": { + "fields": [ + { + "id": "fullName", + "name": "Full name", + "required": true, + "type": "text" + }, + { + "id": "dob", + "name": "Date of birth", + "required": true, + "type": "date" } + ], + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "anyOf": [ + { + "required": [ + "pobCountry", + "pobAddress" + ] + }, + { + "required": [ + "porCountry", + "porAddress" + ] + } + ], + "properties": { + "dob": { + "description": "Date of birth in YYYY-MM-DD format", + "format": "date", + "title": "Date of Birth", + "type": "string" + }, + "fullName": { + "description": "User's full legal name", + "minLength": 1, + "title": "Full Name", + "type": "string" + }, + "pobAddress": { + "description": "Place of birth city and state (e.g., 'New York, NY')", + "maxLength": 200, + "title": "Place of Birth Address", + "type": "string" + }, + "pobCountry": { + "description": "Place of birth country code (ISO 3166-1 alpha-2)", + "pattern": "^[A-Z]{2}$", + "title": "Place of Birth Country", + "type": "string" + }, + "porAddress": { + "description": "Place of residence street address, city, and state", + "maxLength": 200, + "title": "Place of Residence Address", + "type": "string" + }, + "porCountry": { + "description": "Place of residence country code (ISO 3166-1 alpha-2)", + "pattern": "^[A-Z]{2}$", + "title": "Place of Residence Country", + "type": "string" + }, + "tosConfirmed": { + "const": true, + "description": "Must be true to confirm Terms of Service acceptance", + "title": "Terms of Service Confirmation", + "type": "boolean" + } + }, + "required": [ + "fullName", + "dob", + "tosConfirmed" + ], + "type": "object" }, - { - "name": "Sdk-Platform", - "in": "header", - "required": false, - "schema": { - "type": "string" - } + "url": "https://data-collection.walletconnect.com/ic/pay_123?accounts=eip155:1:0x123" + }, + "properties": { + "fields": { + "deprecated": true, + "description": "Deprecated: Use `schema` and `url` fields instead for webview-based data collection", + "items": { + "$ref": "#/components/schemas/CollectDataField" + }, + "type": "array" }, - { - "name": "id", - "in": "path", - "description": "Payment ID", - "required": true, - "schema": { - "type": "string" - } + "schema": { + "description": "JSON Schema for validating IC form data (for webview mode)" }, - { - "name": "maxPollMs", - "in": "query", - "description": "Maximum time to long-poll for payment status, in milliseconds.", - "required": false, - "schema": { - "type": "integer", - "format": "int64", - "minimum": 0, - "nullable": true - } + "url": { + "description": "URL for webview-based data collection", + "type": "string" } + }, + "required": [ + "fields", + "schema", + "url" ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConfirmPaymentRequest" - } - } - }, - "required": true + "type": "object" + }, + "CollectDataField": { + "example": { + "id": "fullName", + "name": "Full name", + "required": true, + "type": "text" }, - "responses": { - "200": { - "description": "Payment confirmed successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ConfirmPaymentResponse" - } - } - } + "properties": { + "id": { + "description": "ID of the field for submission", + "type": "string" }, - "400": { - "description": "Invalid request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } + "name": { + "description": "Human readable name of the field", + "type": "string" }, - "401": { - "description": "Invalid API key", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } + "required": { + "description": "Requiredness of the field", + "type": "boolean" }, - "404": { - "description": "Payment not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "500": { - "description": "Internal error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } + "type": { + "$ref": "#/components/schemas/CollectDataFieldType", + "description": "Type of the field" } - } - } - }, - "/v1/gateway/payment/{id}/fetch": { - "post": { - "tags": [ - "Gateway" + }, + "required": [ + "type", + "id", + "name", + "required" ], - "summary": "Fetches an action", - "description": "This endpoint fetches an action for a payment.", - "operationId": "fetch_handler", - "parameters": [ - { - "name": "Api-Key", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "App-Id", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "Client-Id", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "WCP-Version", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "Sdk-Name", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "Sdk-Version", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "Sdk-Platform", - "in": "header", - "required": false, - "schema": { - "type": "string" - } + "type": "object" + }, + "CollectDataFieldResult": { + "example": { + "id": "fullName", + "value": "John" + }, + "properties": { + "id": { + "type": "string" }, - { - "name": "id", - "in": "path", - "description": "Payment ID", - "required": true, - "schema": { - "type": "string" - } + "value": { + "type": "string" } + }, + "required": [ + "id", + "value" ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FetchRequest" - } + "type": "object" + }, + "CollectDataFieldType": { + "enum": [ + "text", + "date", + "checkbox" + ], + "type": "string" + }, + "CollectDataResult": { + "example": { + "fields": [ + { + "id": "fullName", + "value": "John Smith" + }, + { + "id": "dob", + "value": "1990-01-01" + }, + { + "id": "tosConfirmed", + "value": "true" + }, + { + "id": "pobCountry", + "value": "US" + }, + { + "id": "pobAddress", + "value": "New York, NY" } - }, - "required": true + ] }, - "responses": { - "200": { - "description": "Action built successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FetchResponse" - } + "properties": { + "fields": { + "items": { + "$ref": "#/components/schemas/CollectDataFieldResult" + }, + "type": "array" + } + }, + "required": [ + "fields" + ], + "type": "object" + }, + "ConfirmPaymentRequest": { + "example": { + "collectedData": { + "fields": [ + { + "id": "fullName", + "value": "John Smith" + }, + { + "id": "dob", + "value": "1990-01-01" + }, + { + "id": "tosConfirmed", + "value": "true" + }, + { + "id": "pobCountry", + "value": "US" + }, + { + "id": "pobAddress", + "value": "New York, NY" } - } + ] }, - "400": { - "description": "Invalid request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } + "excludeFromRelayer": null, + "optionId": "opt_123", + "results": [ + { + "data": [ + "0x123" + ], + "type": "walletRpc" } - }, - "401": { - "description": "Invalid API key", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } + ] + }, + "properties": { + "collectedData": { + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/components/schemas/CollectDataResult" } - } + ] }, - "404": { - "description": "Payment not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } + "optionId": { + "description": "ID of the option to confirm", + "type": "string" }, - "500": { - "description": "Internal error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } + "results": { + "items": { + "$ref": "#/components/schemas/ConfirmPaymentResult" + }, + "type": "array" } - } - } - }, - "/v1/gateway/payment/{id}/options": { - "post": { - "tags": [ - "Gateway" + }, + "required": [ + "optionId", + "results" ], - "summary": "Get payment options", - "description": "This endpoint takes a list of accounts and returns a list of options that can be used to complete the payment.", - "operationId": "gatewayGetPaymentOptions", - "parameters": [ - { - "name": "Api-Key", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "App-Id", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "Client-Id", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "WCP-Version", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "Sdk-Name", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "Sdk-Version", - "in": "header", - "required": false, - "schema": { - "type": "string" - } + "type": "object" + }, + "ConfirmPaymentResponse": { + "example": { + "info": null, + "isFinal": true, + "pollInMs": null, + "status": "succeeded" + }, + "properties": { + "info": { + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/components/schemas/GatewayPaymentInformation", + "description": "Payment information (transaction hash). Present when status is\nSucceeded, null otherwise." + } + ] }, - { - "name": "Sdk-Platform", - "in": "header", - "required": false, - "schema": { - "type": "string" - } + "isFinal": { + "description": "True if the payment is in a final state and no longer requires polling", + "type": "boolean" }, - { - "name": "id", - "in": "path", - "description": "Payment ID", - "required": true, - "schema": { - "type": "string" - } + "pollInMs": { + "description": "Time to poll for payment status, in milliseconds. Not present if the\npayment is in a final state.", + "format": "int64", + "minimum": 0, + "type": [ + "integer", + "null" + ] }, - { - "name": "includePaymentInfo", - "in": "query", - "description": "Whether to include payment information in the response", - "required": false, - "schema": { - "type": "boolean", - "nullable": true - } + "status": { + "$ref": "#/components/schemas/PaymentStatus", + "description": "Payment status" } + }, + "required": [ + "status", + "isFinal" ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetPaymentOptionsRequest" - } - } - }, - "required": true + "type": "object" + }, + "ConfirmPaymentResult": { + "example": { + "data": [ + "0x123" + ], + "type": "walletRpc" }, - "responses": { - "200": { - "description": "Payment options retrieved successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetPaymentOptionsResponse" - } - } - } - }, - "400": { - "description": "Invalid request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } + "oneOf": [ + { + "properties": { + "data": { + "items": {}, + "type": "array" + }, + "type": { + "enum": [ + "walletRpc" + ], + "type": "string" } - } + }, + "required": [ + "data", + "type" + ], + "type": "object" + } + ] + }, + "CreatePayment": { + "example": { + "amount": { + "unit": "iso4217/USD", + "value": "100" }, - "401": { - "description": "Invalid API key", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } + "expiresAt": null, + "referenceId": "ORDER-123" + }, + "properties": { + "amount": { + "$ref": "#/components/schemas/AmountParameter" }, - "404": { - "description": "Payment not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } + "expiresAt": { + "format": "int64", + "type": [ + "integer", + "null" + ] }, - "500": { - "description": "Internal error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } + "referenceId": { + "type": "string" } - } - } - }, - "/v1/gateway/payment/{id}/status": { - "get": { - "tags": [ - "Gateway" + }, + "required": [ + "referenceId", + "amount" ], - "summary": "Get the payment status", - "description": "Retrieves the status of a payment by its ID. Returns a polling delay to wait\nbefore checking the status again.", - "operationId": "gatewayGetPaymentStatus", - "parameters": [ - { - "name": "Api-Key", - "in": "header", - "required": false, - "schema": { - "type": "string" - } + "type": "object" + }, + "CreatePaymentResponse": { + "example": { + "expiresAt": 1718236800, + "gatewayUrl": "https://api.pay.walletconnect.com/pay_123", + "isFinal": false, + "paymentId": "pay_3ea2ecc101KQD22XFCAS33CBY1Y8PS5DXH", + "pollInMs": 1000, + "status": "requires_action" + }, + "properties": { + "expiresAt": { + "description": "Payment expiration timestamp, in seconds since epoch", + "format": "int64", + "minimum": 0, + "type": "integer" }, - { - "name": "App-Id", - "in": "header", - "required": false, - "schema": { - "type": "string" - } + "gatewayUrl": { + "description": "Gateway URL to redirect the user to for payment", + "type": "string" }, - { - "name": "Client-Id", - "in": "header", - "required": false, - "schema": { - "type": "string" - } + "isFinal": { + "description": "True if the payment is in a final state and no longer requires polling", + "type": "boolean" }, - { - "name": "WCP-Version", - "in": "header", - "required": false, - "schema": { - "type": "string" - } + "paymentId": { + "$ref": "#/components/schemas/PaymentId", + "description": "Payment ID" }, - { - "name": "Sdk-Name", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "Sdk-Version", - "in": "header", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "Sdk-Platform", - "in": "header", - "required": false, - "schema": { - "type": "string" - } + "pollInMs": { + "description": "Time to poll for payment status, in milliseconds. Not present if the\npayment is in a final state.", + "format": "int64", + "minimum": 0, + "type": [ + "integer", + "null" + ] }, - { - "name": "id", - "in": "path", - "description": "Payment ID", - "required": true, - "schema": { - "type": "string" - } + "status": { + "$ref": "#/components/schemas/PaymentStatus", + "description": "Payment status" + } + }, + "required": [ + "paymentId", + "status", + "expiresAt", + "isFinal", + "gatewayUrl" + ], + "type": "object" + }, + "ErrorCode": { + "description": "Standard error codes for API responses.\n\nThis prevents typos like \"invlaid_params\" from reaching production.", + "enum": [ + "rate_limited", + "invalid_params", + "params_validation", + "payment_not_found", + "idempotency_conflict", + "internal_error", + "invalid_api_key", + "unauthorized", + "forbidden", + "invalid_state", + "payment_expired", + "quote_expired", + "missing_api_key", + "missing_merchant_api_key", + "missing_merchant_id", + "header_not_ascii", + "not_sandbox_api_key", + "merchant_not_found", + "merchant_exists", + "api_key_not_found", + "partner_not_found", + "customer_not_found", + "wallet_not_found", + "executor_not_found", + "missing_app_id", + "missing_client_id", + "invalid_app_id", + "conflicting_auth_headers", + "missing_auth_headers", + "invalid_api_version", + "unknown_api_version", + "api_version_downgrade", + "sanctioned_user", + "payment_not_succeeded", + "already_refunded" + ], + "type": "string" + }, + "ErrorResponse": { + "description": "Standard error response structure for API errors.", + "properties": { + "code": { + "$ref": "#/components/schemas/ErrorCode" }, - { - "name": "maxPollMs", - "in": "query", - "description": "Maximum time to long-poll for payment status, in milliseconds.", - "required": false, - "schema": { - "type": "integer", - "format": "int64", - "minimum": 0, - "nullable": true - } + "message": { + "type": "string" } + }, + "required": [ + "code", + "message" ], - "responses": { - "200": { - "description": "Payment status retrieved successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetPaymentStatusResponse" - } - } - } + "type": "object" + }, + "FetchRequest": { + "example": { + "data": "...", + "optionId": "opt_123" + }, + "properties": { + "data": { + "description": "Extra build payload", + "type": "string" }, - "400": { - "description": "Invalid request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } + "optionId": { + "description": "ID of the option to build an action for", + "type": "string" + } + }, + "required": [ + "optionId", + "data" + ], + "type": "object" + }, + "FetchResponse": { + "example": { + "actions": [ + { + "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" } + ] + }, + "properties": { + "actions": { + "items": { + "$ref": "#/components/schemas/Action" + }, + "type": "array" + } + }, + "required": [ + "actions" + ], + "type": "object" + }, + "GatewayCancelPaymentResponse": { + "example": { + "cancelledAt": "2025-01-14T10:30:00Z", + "cancelledReason": "cancelled_by_user", + "paymentId": "pay_74a2ecc101KQD22XFQ5PW5PA1GSAGNJRK0", + "status": "cancelled" + }, + "properties": { + "cancelledAt": { + "type": "string" }, - "401": { - "description": "Invalid API key", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } + "cancelledReason": { + "type": "string" }, - "404": { - "description": "Payment not found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } + "paymentId": { + "$ref": "#/components/schemas/PaymentId" }, - "500": { - "description": "Internal error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } + "status": { + "$ref": "#/components/schemas/PaymentStatus" } - } - } - }, - "/v1/payments": { - "post": { - "tags": [ - "Payments" + }, + "required": [ + "paymentId", + "status", + "cancelledReason", + "cancelledAt" ], - "summary": "Create a new payment", - "description": "Creates a new payment with the provided payment details.", - "operationId": "paymentsCreatePayment", - "parameters": [ - { - "name": "Api-Key", - "in": "header", - "required": true, - "schema": { - "type": "string" - } + "type": "object" + }, + "GatewayPaymentInformation": { + "description": "Payment information returned when a gateway payment succeeds.", + "properties": { + "optionAmount": { + "$ref": "#/components/schemas/Amount", + "description": "Amount paid in token units" }, - { - "name": "Merchant-Id", - "in": "header", - "required": true, - "schema": { + "txId": { + "description": "Transaction identifier (hash)", + "type": "string" + } + }, + "required": [ + "txId", + "optionAmount" + ], + "type": "object" + }, + "GetPaymentOptionsRequest": { + "example": { + "accounts": [ + "eip155:8453:0x123" + ], + "refresh": null + }, + "properties": { + "accounts": { + "items": { "type": "string" - } + }, + "type": "array" }, - { - "name": "WCP-Version", - "in": "header", - "required": false, - "schema": { + "refresh": { + "items": { "type": "string" + }, + "type": [ + "array", + "null" + ] + } + }, + "required": [ + "accounts" + ], + "type": "object" + }, + "GetPaymentOptionsResponse": { + "example": { + "collectData": { + "fields": [ + { + "id": "fullName", + "name": "Full name", + "required": true, + "type": "text" + }, + { + "id": "dob", + "name": "Date of birth", + "required": true, + "type": "date" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "anyOf": [ + { + "required": [ + "pobCountry", + "pobAddress" + ] + }, + { + "required": [ + "porCountry", + "porAddress" + ] + } + ], + "properties": { + "dob": { + "description": "Date of birth in YYYY-MM-DD format", + "format": "date", + "title": "Date of Birth", + "type": "string" + }, + "fullName": { + "description": "User's full legal name", + "minLength": 1, + "title": "Full Name", + "type": "string" + }, + "pobAddress": { + "description": "Place of birth city and state (e.g., 'New York, NY')", + "maxLength": 200, + "title": "Place of Birth Address", + "type": "string" + }, + "pobCountry": { + "description": "Place of birth country code (ISO 3166-1 alpha-2)", + "pattern": "^[A-Z]{2}$", + "title": "Place of Birth Country", + "type": "string" + }, + "porAddress": { + "description": "Place of residence street address, city, and state", + "maxLength": 200, + "title": "Place of Residence Address", + "type": "string" + }, + "porCountry": { + "description": "Place of residence country code (ISO 3166-1 alpha-2)", + "pattern": "^[A-Z]{2}$", + "title": "Place of Residence Country", + "type": "string" + }, + "tosConfirmed": { + "const": true, + "description": "Must be true to confirm Terms of Service acceptance", + "title": "Terms of Service Confirmation", + "type": "boolean" + } + }, + "required": [ + "fullName", + "dob", + "tosConfirmed" + ], + "type": "object" + }, + "url": "https://data-collection.walletconnect.com/ic/pay_123?accounts=eip155:1:0x123" + }, + "info": { + "amount": { + "display": { + "assetName": "USD Coin", + "assetSymbol": "USDC", + "decimals": 6, + "iconUrl": "https://assets.walletconnect.com/usdc.png", + "networkIconUrl": "https://assets.walletconnect.com/base.png", + "networkName": "Base" + }, + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "1000000" + }, + "buyer": { + "accountCaip10": "eip155:1:0x0000000000000000000000000000000000000000", + "accountProviderIcon": "https://example.com/icon.png", + "accountProviderName": "Wallet" + }, + "expiresAt": 1700000000, + "merchant": { + "iconUrl": "https://example.com/icon.png", + "name": "Merchant" + }, + "status": "requires_action" + }, + "options": [ + { + "account": "eip155:1:0x0000000000000000000000000000000000000000", + "actions": [ + { + "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": { + "display": { + "assetName": "USD Coin", + "assetSymbol": "USDC", + "decimals": 6, + "iconUrl": "https://assets.walletconnect.com/usdc.png", + "networkIconUrl": "https://assets.walletconnect.com/base.png", + "networkName": "Base" + }, + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "1000000" + }, + "collectData": { + "fields": [ + { + "id": "fullName", + "name": "Full name", + "required": true, + "type": "text" + }, + { + "id": "dob", + "name": "Date of birth", + "required": true, + "type": "date" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "anyOf": [ + { + "required": [ + "pobCountry", + "pobAddress" + ] + }, + { + "required": [ + "porCountry", + "porAddress" + ] + } + ], + "properties": { + "dob": { + "description": "Date of birth in YYYY-MM-DD format", + "format": "date", + "title": "Date of Birth", + "type": "string" + }, + "fullName": { + "description": "User's full legal name", + "minLength": 1, + "title": "Full Name", + "type": "string" + }, + "pobAddress": { + "description": "Place of birth city and state (e.g., 'New York, NY')", + "maxLength": 200, + "title": "Place of Birth Address", + "type": "string" + }, + "pobCountry": { + "description": "Place of birth country code (ISO 3166-1 alpha-2)", + "pattern": "^[A-Z]{2}$", + "title": "Place of Birth Country", + "type": "string" + }, + "porAddress": { + "description": "Place of residence street address, city, and state", + "maxLength": 200, + "title": "Place of Residence Address", + "type": "string" + }, + "porCountry": { + "description": "Place of residence country code (ISO 3166-1 alpha-2)", + "pattern": "^[A-Z]{2}$", + "title": "Place of Residence Country", + "type": "string" + }, + "tosConfirmed": { + "const": true, + "description": "Must be true to confirm Terms of Service acceptance", + "title": "Terms of Service Confirmation", + "type": "boolean" + } + }, + "required": [ + "fullName", + "dob", + "tosConfirmed" + ], + "type": "object" + }, + "url": "https://data-collection.walletconnect.com/ic/pay_123?accounts=eip155:1:0x123" + }, + "etaS": 5, + "expiresAt": 1700000300, + "id": "opt_123" + } + ] + }, + "properties": { + "collectData": { + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/components/schemas/CollectData" + } + ] + }, + "info": { + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/components/schemas/GetPaymentResponse" + } + ] + }, + "options": { + "items": { + "$ref": "#/components/schemas/PaymentOption" + }, + "type": [ + "array", + "null" + ] + } + }, + "type": "object" + }, + "GetPaymentResponse": { + "example": { + "amount": { + "display": { + "assetName": "USD Coin", + "assetSymbol": "USDC", + "decimals": 6, + "iconUrl": "https://assets.walletconnect.com/usdc.png", + "networkIconUrl": "https://assets.walletconnect.com/base.png", + "networkName": "Base" + }, + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "1000000" + }, + "buyer": { + "accountCaip10": "eip155:1:0x0000000000000000000000000000000000000000", + "accountProviderIcon": "https://example.com/icon.png", + "accountProviderName": "Wallet" + }, + "expiresAt": 1700000000, + "merchant": { + "iconUrl": "https://example.com/icon.png", + "name": "Merchant" + }, + "status": "requires_action" + }, + "properties": { + "amount": { + "$ref": "#/components/schemas/Amount" + }, + "buyer": { + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/components/schemas/BuyerInfo" + } + ] + }, + "expiresAt": { + "format": "int64", + "minimum": 0, + "type": "integer" + }, + "merchant": { + "$ref": "#/components/schemas/MerchantInfo" + }, + "status": { + "$ref": "#/components/schemas/PaymentStatus" + } + }, + "required": [ + "status", + "amount", + "expiresAt", + "merchant" + ], + "type": "object" + }, + "GetPaymentStatusResponse": { + "example": { + "info": { + "optionAmount": { + "display": { + "assetName": "USD Coin", + "assetSymbol": "USDC", + "decimals": 6, + "iconUrl": "https://assets.walletconnect.com/usdc.png", + "networkIconUrl": "https://assets.walletconnect.com/base.png", + "networkName": "Base" + }, + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "1000000" + }, + "txId": "0xabc123..." + }, + "isFinal": true, + "pollInMs": null, + "status": "succeeded" + }, + "properties": { + "failureCode": { + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/components/schemas/PaymentFailureCode", + "description": "Machine-readable reason identifying why the payment failed. Present\nonly when `status == \"failed\"`." + } + ] + }, + "info": { + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/components/schemas/PaymentInformation", + "description": "Payment information (transaction hash, amount). Present when status is\nSucceeded, null otherwise." + } + ] + }, + "isFinal": { + "description": "True if the payment is in a final state and no longer requires polling", + "type": "boolean" + }, + "pollInMs": { + "description": "Time to poll for payment status, in milliseconds. Not present if the\npayment is in a final state.", + "format": "int64", + "minimum": 0, + "type": [ + "integer", + "null" + ] + }, + "status": { + "$ref": "#/components/schemas/PaymentStatus", + "description": "Payment status" + } + }, + "required": [ + "status", + "isFinal" + ], + "type": "object" + }, + "MerchantInfo": { + "example": { + "iconUrl": "https://example.com/icon.png", + "name": "Merchant" + }, + "properties": { + "iconUrl": { + "description": "Merchant icon URL", + "type": [ + "string", + "null" + ] + }, + "name": { + "description": "Merchant name", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "PaymentFailureCode": { + "description": "Machine-readable code identifying why a payment reached `Failed`.\n\nTwo distinct string forms exist per variant:\n- **Strum** (`Display`/`AsRefStr`/`EnumString`): the DynamoDB storage form\n written to the `failure_reason` column. Preserves the existing on-disk\n value for rows written before this type existed.\n- **Serde** (`Serialize`/`Deserialize`): the public API form. Deliberately\n decoupled from the internal term so that compliance-specific wording\n isn't surfaced to external consumers.", + "enum": [ + "declined_user" + ], + "type": "string" + }, + "PaymentId": { + "description": "Payment ID", + "examples": [ + "pay_7fa2ecc101ARZ3NDEKTSV4RRFFQ69G5FAV" + ], + "type": "string" + }, + "PaymentInformation": { + "description": "Payment information returned when payment succeeds", + "example": { + "optionAmount": { + "display": { + "assetName": "USD Coin", + "assetSymbol": "USDC", + "decimals": 6, + "iconUrl": "https://assets.walletconnect.com/usdc.png", + "networkIconUrl": "https://assets.walletconnect.com/base.png", + "networkName": "Base" + }, + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "1000000" + }, + "txId": "0xabc123..." + }, + "properties": { + "optionAmount": { + "$ref": "#/components/schemas/Amount", + "description": "Amount paid in token units" + }, + "txId": { + "description": "Transaction identifier (hash)", + "type": "string" + } + }, + "required": [ + "txId", + "optionAmount" + ], + "type": "object" + }, + "PaymentOption": { + "example": { + "account": "eip155:1:0x0000000000000000000000000000000000000000", + "actions": [ + { + "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": { + "display": { + "assetName": "USD Coin", + "assetSymbol": "USDC", + "decimals": 6, + "iconUrl": "https://assets.walletconnect.com/usdc.png", + "networkIconUrl": "https://assets.walletconnect.com/base.png", + "networkName": "Base" + }, + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "1000000" + }, + "collectData": { + "fields": [ + { + "id": "fullName", + "name": "Full name", + "required": true, + "type": "text" + }, + { + "id": "dob", + "name": "Date of birth", + "required": true, + "type": "date" + } + ], + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "anyOf": [ + { + "required": [ + "pobCountry", + "pobAddress" + ] + }, + { + "required": [ + "porCountry", + "porAddress" + ] + } + ], + "properties": { + "dob": { + "description": "Date of birth in YYYY-MM-DD format", + "format": "date", + "title": "Date of Birth", + "type": "string" + }, + "fullName": { + "description": "User's full legal name", + "minLength": 1, + "title": "Full Name", + "type": "string" + }, + "pobAddress": { + "description": "Place of birth city and state (e.g., 'New York, NY')", + "maxLength": 200, + "title": "Place of Birth Address", + "type": "string" + }, + "pobCountry": { + "description": "Place of birth country code (ISO 3166-1 alpha-2)", + "pattern": "^[A-Z]{2}$", + "title": "Place of Birth Country", + "type": "string" + }, + "porAddress": { + "description": "Place of residence street address, city, and state", + "maxLength": 200, + "title": "Place of Residence Address", + "type": "string" + }, + "porCountry": { + "description": "Place of residence country code (ISO 3166-1 alpha-2)", + "pattern": "^[A-Z]{2}$", + "title": "Place of Residence Country", + "type": "string" + }, + "tosConfirmed": { + "const": true, + "description": "Must be true to confirm Terms of Service acceptance", + "title": "Terms of Service Confirmation", + "type": "boolean" + } + }, + "required": [ + "fullName", + "dob", + "tosConfirmed" + ], + "type": "object" + }, + "url": "https://data-collection.walletconnect.com/ic/pay_123?accounts=eip155:1:0x123" + }, + "etaS": 5, + "expiresAt": 1700000300, + "id": "opt_123" + }, + "properties": { + "account": { + "description": "The account to use for the option", + "type": "string" + }, + "actions": { + "description": "Actions required to complete the option", + "items": { + "$ref": "#/components/schemas/Action" + }, + "type": "array" + }, + "amount": { + "$ref": "#/components/schemas/Amount", + "description": "The option's token and amount" + }, + "collectData": { + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/components/schemas/CollectData", + "description": "Per-option IC data collection info. Present when this option's account requires data collection, null otherwise." + } + ] + }, + "etaS": { + "description": "Estimated time to complete the option, in seconds", + "format": "int64", + "minimum": 0, + "type": "integer" + }, + "expiresAt": { + "description": "Unix timestamp (seconds) after which this quote is stale and confirm_payment\nwill reject it with `quote_expired`. The wallet should re-fetch options before\nthis deadline. `None` for direct-currency options that don't involve a rate.", + "format": "int64", + "minimum": 0, + "type": [ + "integer", + "null" + ] + }, + "id": { + "description": "ID of the option to be used to refer to it in other requests. May be up to 2^16 characters.", + "type": "string" + } + }, + "required": [ + "id", + "account", + "amount", + "etaS", + "actions" + ], + "type": "object" + }, + "PaymentStatus": { + "description": "Payment status representing the lifecycle of a payment.\n\nPayments progress through these states from creation to terminal status.\nSome states are specific to the payment source (pull vs push).", + "enum": [ + "requires_action", + "processing", + "succeeded", + "failed", + "expired", + "cancelled" + ], + "type": "string" + }, + "PaymentsCancelPaymentResponse": { + "example": { + "cancelledAt": "2025-01-14T10:30:00Z", + "cancelledReason": "cancelled_by_merchant", + "paymentId": "pay_e4a2ecc101KQD22XFEEG9632MG2CHB44QZ", + "status": "cancelled" + }, + "properties": { + "cancelledAt": { + "type": "string" + }, + "cancelledReason": { + "type": "string" + }, + "paymentId": { + "$ref": "#/components/schemas/PaymentId" + }, + "status": { + "$ref": "#/components/schemas/PaymentStatus" + } + }, + "required": [ + "paymentId", + "status", + "cancelledReason", + "cancelledAt" + ], + "type": "object" + }, + "PaymentsGetPaymentResponse": { + "example": { + "info": { + "optionAmount": { + "display": { + "assetName": "USD Coin", + "assetSymbol": "USDC", + "decimals": 6, + "iconUrl": "https://assets.walletconnect.com/usdc.png", + "networkIconUrl": "https://assets.walletconnect.com/base.png", + "networkName": "Base" + }, + "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", + "value": "1000000" + }, + "txId": "0xabc123..." + }, + "referenceId": "ORDER-123", + "settlement": null, + "status": "succeeded" + }, + "properties": { + "failureCode": { + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/components/schemas/PaymentFailureCode", + "description": "Machine-readable reason identifying why the payment failed. Present\nonly when `status == \"failed\"`." + } + ] + }, + "info": { + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/components/schemas/PaymentInformation", + "description": "Payment information (transaction hash, amount). Present when status is\nSucceeded, null otherwise." + } + ] + }, + "referenceId": { + "description": "Merchant-provided reference ID for this payment, as supplied during\npayment creation", + "type": "string" + }, + "settlement": { + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/components/schemas/PaymentsSettlementInformation", + "description": "Settlement metadata for the MTA → destination transfer. Null when\nsettlement has not completed yet (pending, non-MTA flows, or\npre-confirmation)." + } + ] + }, + "status": { + "$ref": "#/components/schemas/PaymentStatus", + "description": "Payment status" + } + }, + "required": [ + "status", + "referenceId" + ], + "type": "object" + }, + "PaymentsSettlementAmount": { + "description": "Amount information for a successful settlement transfer.", + "properties": { + "unit": { + "type": "string", + "example": "iso4217/USD", + "description": "Settlement unit — the asset or currency used in the settlement\ntransfer. Uses the same unit format as payment amounts\n(e.g. \"caip19/eip155:1/erc20:0xA0b86...\" for crypto,\n\"iso4217/USD\" for fiat)." + } + }, + "required": [ + "unit" + ], + "type": "object" + }, + "PaymentsSettlementInformation": { + "description": "Settlement metadata returned for MTA-based payments.\n\nOnly present once the settlement transfer has completed on-chain.", + "example": { + "successful": { + "amount": { + "unit": "caip19/eip155:1/erc20:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" + }, + "txId": "0xabc123def456789abc123def456789abc123def456789abc123def456789abc1" + } + }, + "properties": { + "successful": { + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/components/schemas/PaymentsSettlementSuccessful", + "description": "Settlement success details. Null while settlement is pending,\npopulated once the on-chain transfer completes successfully." + } + ] + } + }, + "type": "object" + }, + "PaymentsSettlementSuccessful": { + "description": "Details of a successful settlement transfer.", + "example": { + "amount": { + "unit": "caip19/eip155:1/erc20:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" + }, + "txId": "0xabc123def456789abc123def456789abc123def456789abc123def456789abc1" + }, + "properties": { + "amount": { + "$ref": "#/components/schemas/PaymentsSettlementAmount", + "description": "Settlement amount — the asset/currency and value transferred." + }, + "txId": { + "description": "Transaction hash of the MTA → settlement destination transfer.", + "type": "string" + } + }, + "required": [ + "txId", + "amount" + ], + "type": "object" + }, + "WalletRpcAction": { + "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\"}}" + ] + }, + "properties": { + "chain_id": { + "type": "string" + }, + "method": { + "type": "string" + }, + "params": { + "items": {}, + "type": "array" + } + }, + "required": [ + "chain_id", + "method", + "params" + ], + "type": "object" + } + }, + "securitySchemes": { + "API Key": { + "in": "header", + "name": "Api-Key", + "type": "apiKey" + }, + "ApiKey": { + "description": "Private API key for wallet authentication", + "in": "header", + "name": "Api-Key", + "type": "apiKey" + }, + "AppId": { + "description": "Public App ID for wallet authentication. When using this auth mode, the Client-Id header is also required.", + "in": "header", + "name": "App-Id", + "type": "apiKey" + } + } + }, + "info": { + "contact": { + "name": "WalletConnect", + "url": "https://walletconnect.com" + }, + "description": "API for the WalletConnect Pay service", + "license": { + "name": "" + }, + "title": "WalletConnect Pay API", + "version": "2026-02-18" + }, + "openapi": "3.1.0", + "paths": { + "/v1/gateway/payment/{id}": { + "get": { + "description": "This endpoint returns only basic information to display to the user to begin the payment flow.", + "operationId": "gatewayGetPayment", + "parameters": [ + { + "in": "header", + "name": "Api-Key", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] } }, { - "name": "Sdk-Name", "in": "header", + "name": "App-Id", "required": false, "schema": { - "type": "string" + "type": [ + "string", + "null" + ] } }, { - "name": "Sdk-Version", "in": "header", + "name": "Client-Id", "required": false, "schema": { - "type": "string" + "type": [ + "string", + "null" + ] } }, { - "name": "Sdk-Platform", "in": "header", + "name": "WCP-Version", "required": false, "schema": { - "type": "string" + "type": [ + "string", + "null" + ] } }, { - "name": "Idempotency-Key", "in": "header", + "name": "Sdk-Name", "required": false, "schema": { - "type": "string" + "type": [ + "string", + "null" + ] } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreatePayment" - } + }, + { + "in": "header", + "name": "Sdk-Version", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] } }, - "required": true - }, + { + "in": "header", + "name": "Sdk-Platform", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } + }, + { + "description": "Payment ID", + "in": "path", + "name": "id", + "required": true, + "schema": { + "$ref": "#/components/schemas/PaymentId" + } + } + ], "responses": { - "201": { - "description": "Payment created successfully", + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreatePaymentResponse" + "$ref": "#/components/schemas/GetPaymentResponse" } } - } + }, + "description": "Payment status retrieved successfully" }, "400": { - "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } - } + }, + "description": "Invalid request" }, "401": { - "description": "Invalid API key", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } - } + }, + "description": "Invalid API key" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Payment not found" }, "500": { - "description": "Internal error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } - } + }, + "description": "Internal error" } - } + }, + "summary": "Get a payment", + "tags": [ + "Gateway" + ] } }, - "/v1/payments/{id}/status": { - "get": { - "tags": [ - "Payments" - ], - "summary": "Get the payment status", - "description": "Retrieves the status of a payment by its ID. Returns a polling delay to wait\nbefore checking the status again.", - "operationId": "paymentsGetPaymentStatus", + "/v1/gateway/payment/{id}/cancel": { + "post": { + "operationId": "gatewayCancelPayment", "parameters": [ { - "name": "Api-Key", "in": "header", - "required": true, + "name": "Api-Key", + "required": false, "schema": { - "type": "string" + "type": [ + "string", + "null" + ] } }, { - "name": "Merchant-Id", "in": "header", - "required": true, + "name": "App-Id", + "required": false, "schema": { - "type": "string" + "type": [ + "string", + "null" + ] } }, { - "name": "WCP-Version", "in": "header", + "name": "Client-Id", "required": false, "schema": { - "type": "string" + "type": [ + "string", + "null" + ] } }, { - "name": "Sdk-Name", "in": "header", + "name": "WCP-Version", "required": false, "schema": { - "type": "string" + "type": [ + "string", + "null" + ] } }, { - "name": "Sdk-Version", "in": "header", + "name": "Sdk-Name", "required": false, "schema": { - "type": "string" + "type": [ + "string", + "null" + ] } }, { - "name": "Sdk-Platform", "in": "header", + "name": "Sdk-Version", "required": false, "schema": { - "type": "string" + "type": [ + "string", + "null" + ] } }, { - "name": "Idempotency-Key", "in": "header", + "name": "Sdk-Platform", "required": false, "schema": { - "type": "string" + "type": [ + "string", + "null" + ] } }, { - "name": "id", "in": "path", - "description": "Payment ID", + "name": "id", "required": true, "schema": { - "type": "string" - } - }, - { - "name": "maxPollMs", - "in": "query", - "description": "Maximum time to long-poll for payment status, in milliseconds.", - "required": false, - "schema": { - "type": "integer", - "format": "int64", - "minimum": 0, - "nullable": true + "$ref": "#/components/schemas/PaymentId" } } ], "responses": { "200": { - "description": "Payment status retrieved successfully", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetPaymentStatusResponse" + "$ref": "#/components/schemas/GatewayCancelPaymentResponse" } } - } + }, + "description": "Payment cancelled successfully" }, "400": { - "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } - } + }, + "description": "Payment cannot be cancelled" }, "401": { - "description": "Invalid API key", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } - } + }, + "description": "Invalid API key" }, "404": { - "description": "Payment not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } - } + }, + "description": "Payment not found" }, "500": { - "description": "Internal error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } - } + }, + "description": "Internal error" } - } + }, + "tags": [ + "Gateway" + ] } - } - }, - "components": { - "schemas": { - "Action": { - "oneOf": [ + }, + "/v1/gateway/payment/{id}/confirm": { + "post": { + "description": "This endpoint confirms a payment and submits it to the blockchain for processing.", + "operationId": "confirm_payment_handler", + "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" - ] - } + "in": "header", + "name": "Api-Key", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] } }, { - "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" - ] - } + "in": "header", + "name": "App-Id", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] } - } - ], - "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/\"" - }, - "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", - "networkIconUrl": "https://assets.walletconnect.com/base.png", - "networkName": "Base" - }, - "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", - "value": "1000000" - } - }, - "AmountDisplay": { - "type": "object", - "required": [ - "assetSymbol", - "assetName", - "decimals" - ], - "properties": { - "assetName": { - "type": "string", - "description": "Full name of the asset" - }, - "assetSymbol": { - "type": "string", - "description": "Ticker/symbol of the asset" }, - "decimals": { - "type": "integer", - "format": "int32", - "description": "Number of minor decimals of the asset", - "minimum": 0 + { + "in": "header", + "name": "Client-Id", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "iconUrl": { - "type": "string", - "description": "URL of the icon of the asset (if token)", - "nullable": true + { + "in": "header", + "name": "WCP-Version", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "networkIconUrl": { - "type": "string", - "description": "URL of the icon of the network (if token)", - "nullable": true + { + "in": "header", + "name": "Sdk-Name", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "networkName": { - "type": "string", - "description": "Name of the network of the asset (if token)", - "nullable": true - } - }, - "example": { - "assetName": "USD Coin", - "assetSymbol": "USDC", - "decimals": 6, - "iconUrl": "https://assets.walletconnect.com/usdc.png", - "networkIconUrl": "https://assets.walletconnect.com/base.png", - "networkName": "Base" - } - }, - "AmountParameter": { - "type": "object", - "required": [ - "unit", - "value" - ], - "properties": { - "unit": { - "type": "string", - "description": "Currency unit, prefixed with either \"iso4217/\" or \"caip19/\"" + { + "in": "header", + "name": "Sdk-Version", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "value": { - "type": "string", - "description": "Amount value, in the currency unit's minor units" - } - }, - "example": { - "unit": "iso4217/USD", - "value": "100" - } - }, - "Build": { - "type": "object", - "required": [ - "data" - ], - "properties": { - "data": { - "type": "string" - } - }, - "example": { - "data": "..." - } - }, - "BuyerInfo": { - "type": "object", - "required": [ - "accountCaip10", - "accountProviderName" - ], - "properties": { - "accountCaip10": { - "type": "string", - "description": "Account CAIP-10" + { + "in": "header", + "name": "Sdk-Platform", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "accountProviderIcon": { - "type": "string", - "description": "Account provider icon URL", - "nullable": true + { + "description": "Payment ID", + "in": "path", + "name": "id", + "required": true, + "schema": { + "$ref": "#/components/schemas/PaymentId" + } }, - "accountProviderName": { - "type": "string", - "description": "Account provider name" + { + "description": "Maximum time to long-poll for payment status, in milliseconds.", + "in": "query", + "name": "maxPollMs", + "required": false, + "schema": { + "format": "int64", + "minimum": 0, + "type": [ + "integer", + "null" + ] + } } - }, - "example": { - "accountCaip10": "eip155:1:0x0000000000000000000000000000000000000000", - "accountProviderIcon": "https://example.com/icon.png", - "accountProviderName": "Wallet" - } - }, - "CollectData": { - "type": "object", - "required": [ - "fields" ], - "properties": { - "fields": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CollectDataField" + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfirmPaymentRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfirmPaymentResponse" + } + } }, - "description": "Deprecated: Use `schema` and `url` fields instead for webview-based data collection", - "deprecated": true + "description": "Payment confirmed successfully" }, - "schema": { - "description": "JSON Schema for validating IC form data (for webview mode)", - "nullable": true + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Invalid request" }, - "url": { - "type": "string", - "nullable": true, - "description": "URL for webview-based data collection" - } - }, - "example": { - "fields": [ - { - "id": "fullName", - "name": "Full name", - "required": true, - "type": "text" + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } }, - { - "id": "dob", - "name": "Date of birth", - "required": true, - "type": "date" - } - ], - "schema": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "anyOf": [ - { - "required": [ - "pobCountry", - "pobAddress" - ] - }, - { - "required": [ - "porCountry", - "porAddress" - ] + "description": "Invalid API key" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } } - ], - "properties": { - "dob": { - "description": "Date of birth in YYYY-MM-DD format", - "format": "date", - "title": "Date of Birth", - "type": "string" - }, - "fullName": { - "description": "User's full legal name", - "minLength": 1, - "title": "Full Name", - "type": "string" - }, - "pobAddress": { - "description": "Place of birth city and state (e.g., 'New York, NY')", - "maxLength": 200, - "title": "Place of Birth Address", - "type": "string" - }, - "pobCountry": { - "description": "Place of birth country code (ISO 3166-1 alpha-2)", - "pattern": "^[A-Z]{2}$", - "title": "Place of Birth Country", - "type": "string" - }, - "porAddress": { - "description": "Place of residence street address, city, and state", - "maxLength": 200, - "title": "Place of Residence Address", - "type": "string" - }, - "porCountry": { - "description": "Place of residence country code (ISO 3166-1 alpha-2)", - "pattern": "^[A-Z]{2}$", - "title": "Place of Residence Country", - "type": "string" - }, - "tosConfirmed": { - "const": true, - "description": "Must be true to confirm Terms of Service acceptance", - "title": "Terms of Service Confirmation", - "type": "boolean" + }, + "description": "Payment not found" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } } }, - "required": [ - "fullName", - "dob", - "tosConfirmed" - ], - "type": "object" + "description": "Internal error" + } + }, + "summary": "Confirm a payment", + "tags": [ + "Gateway" + ] + } + }, + "/v1/gateway/payment/{id}/fetch": { + "post": { + "description": "This endpoint fetches an action for a payment.", + "operationId": "fetch_handler", + "parameters": [ + { + "in": "header", + "name": "Api-Key", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "url": "https://data-collection.walletconnect.com/ic/pay_123?accounts=eip155:1:0x123" - } - }, - "CollectDataField": { - "type": "object", - "required": [ - "type", - "id", - "name", - "required" - ], - "properties": { - "id": { - "type": "string", - "description": "ID of the field for submission" + { + "in": "header", + "name": "App-Id", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "name": { - "type": "string", - "description": "Human readable name of the field" + { + "in": "header", + "name": "Client-Id", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "required": { - "type": "boolean", - "description": "Requiredness of the field" + { + "in": "header", + "name": "WCP-Version", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "type": { - "$ref": "#/components/schemas/CollectDataFieldType", - "description": "Type of the field" - } - }, - "example": { - "id": "fullName", - "name": "Full name", - "required": true, - "type": "text" - } - }, - "CollectDataFieldResult": { - "type": "object", - "required": [ - "id", - "value" - ], - "properties": { - "id": { - "type": "string" + { + "in": "header", + "name": "Sdk-Name", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } + }, + { + "in": "header", + "name": "Sdk-Version", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } + }, + { + "in": "header", + "name": "Sdk-Platform", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "value": { - "type": "string" + { + "description": "Payment ID", + "in": "path", + "name": "id", + "required": true, + "schema": { + "$ref": "#/components/schemas/PaymentId" + } } - }, - "example": { - "id": "fullName", - "value": "John" - } - }, - "CollectDataFieldType": { - "type": "string", - "enum": [ - "text", - "date", - "checkbox" - ] - }, - "CollectDataResult": { - "type": "object", - "required": [ - "fields" ], - "properties": { - "fields": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CollectDataFieldResult" + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FetchRequest" + } } - } + }, + "required": true }, - "example": { - "fields": [ - { - "id": "fullName", - "value": "John Smith" + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FetchResponse" + } + } }, - { - "id": "dob", - "value": "1990-01-01" + "description": "Action built successfully" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } }, - { - "id": "tosConfirmed", - "value": "true" + "description": "Invalid request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } }, - { - "id": "pobCountry", - "value": "US" + "description": "Invalid API key" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } }, - { - "id": "pobAddress", - "value": "New York, NY" + "description": "Payment not found" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Internal error" + } + }, + "summary": "Fetches an action", + "tags": [ + "Gateway" + ] + } + }, + "/v1/gateway/payment/{id}/options": { + "post": { + "description": "This endpoint takes a list of accounts and returns a list of options that can be used to complete the payment.", + "operationId": "gatewayGetPaymentOptions", + "parameters": [ + { + "in": "header", + "name": "Api-Key", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] } - ] - } - }, - "ConfirmPaymentRequest": { - "type": "object", - "required": [ - "optionId", - "results" - ], - "properties": { - "collectedData": { - "$ref": "#/components/schemas/CollectDataResult", - "nullable": true }, - "optionId": { - "type": "string", - "description": "ID of the option to confirm" + { + "in": "header", + "name": "App-Id", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ConfirmPaymentResult" + { + "in": "header", + "name": "Client-Id", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] } - } - }, - "example": { - "collectedData": { - "fields": [ - { - "id": "fullName", - "value": "John Smith" - }, - { - "id": "dob", - "value": "1990-01-01" - }, - { - "id": "tosConfirmed", - "value": "true" - }, - { - "id": "pobCountry", - "value": "US" - }, - { - "id": "pobAddress", - "value": "New York, NY" - } - ] }, - "excludeFromRelayer": null, - "optionId": "opt_123", - "results": [ - { - "data": [ - "0x123" - ], - "type": "walletRpc" + { + "in": "header", + "name": "WCP-Version", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] } - ] - } - }, - "ConfirmPaymentResponse": { - "type": "object", - "required": [ - "status", - "isFinal" - ], - "properties": { - "info": { - "$ref": "#/components/schemas/GatewayPaymentInformation", - "nullable": true, - "description": "Payment information (transaction hash). Present when status is\nSucceeded, null otherwise." }, - "isFinal": { - "type": "boolean", - "description": "True if the payment is in a final state and no longer requires polling" + { + "in": "header", + "name": "Sdk-Name", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "pollInMs": { - "type": "integer", - "format": "int64", - "description": "Time to poll for payment status, in milliseconds. Not present if the\npayment is in a final state.", - "minimum": 0, - "nullable": true + { + "in": "header", + "name": "Sdk-Version", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "status": { - "$ref": "#/components/schemas/PaymentStatus", - "description": "Payment status" - } - }, - "example": { - "info": null, - "isFinal": true, - "pollInMs": null, - "status": "succeeded" - } - }, - "ConfirmPaymentResult": { - "oneOf": [ { - "type": "object", - "required": [ - "data", - "type" - ], - "properties": { - "data": { - "type": "array", - "items": {} - }, - "type": { - "type": "string", - "enum": [ - "walletRpc" - ] - } + "in": "header", + "name": "Sdk-Platform", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] } - } - ], - "example": { - "data": [ - "0x123" - ], - "type": "walletRpc" - } - }, - "CreatePayment": { - "type": "object", - "required": [ - "referenceId", - "amount" - ], - "properties": { - "amount": { - "$ref": "#/components/schemas/AmountParameter" }, - "expiresAt": { - "type": "integer", - "format": "int64", - "nullable": true + { + "description": "Payment ID", + "in": "path", + "name": "id", + "required": true, + "schema": { + "$ref": "#/components/schemas/PaymentId" + } }, - "referenceId": { - "type": "string" + { + "description": "Whether to include payment information in the response", + "in": "query", + "name": "includePaymentInfo", + "required": false, + "schema": { + "type": [ + "boolean", + "null" + ] + } } - }, - "example": { - "amount": { - "unit": "iso4217/USD", - "value": "100" - }, - "expiresAt": null, - "referenceId": "ORDER-123" - } - }, - "CreatePaymentResponse": { - "type": "object", - "required": [ - "paymentId", - "status", - "expiresAt", - "isFinal", - "gatewayUrl" ], - "properties": { - "expiresAt": { - "type": "integer", - "format": "int64", - "description": "Payment expiration timestamp, in seconds since epoch", - "minimum": 0 + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPaymentOptionsRequest" + } + } }, - "gatewayUrl": { - "type": "string", - "description": "Gateway URL to redirect the user to for payment" + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPaymentOptionsResponse" + } + } + }, + "description": "Payment options retrieved successfully" }, - "isFinal": { - "type": "boolean", - "description": "True if the payment is in a final state and no longer requires polling" + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Invalid request" }, - "paymentId": { - "$ref": "#/components/schemas/PaymentId", - "description": "Payment ID" + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Invalid API key" }, - "pollInMs": { - "type": "integer", - "format": "int64", - "description": "Time to poll for payment status, in milliseconds. Not present if the\npayment is in a final state.", - "minimum": 0, - "nullable": true + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Payment not found" }, - "status": { - "$ref": "#/components/schemas/PaymentStatus", - "description": "Payment status" + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Internal error" } }, - "example": { - "expiresAt": 1718236800, - "gatewayUrl": "https://api.pay.walletconnect.com/pay_123", - "isFinal": false, - "paymentId": "pay_19a2ecc101KJZRBV11SR1Y3BKYRJKM62DR", - "pollInMs": 1000, - "status": "requires_action" - } - }, - "ErrorCode": { - "type": "string", - "description": "Standard error codes for API responses.\n\nThis prevents typos like \"invlaid_params\" from reaching production.", - "enum": [ - "rate_limited", - "invalid_params", - "params_validation", - "payment_not_found", - "idempotency_conflict", - "internal_error", - "invalid_api_key", - "unauthorized", - "forbidden", - "invalid_state", - "payment_expired", - "quote_expired", - "missing_api_key", - "missing_merchant_api_key", - "missing_merchant_id", - "header_not_ascii", - "not_sandbox_api_key", - "merchant_not_found", - "merchant_exists", - "api_key_not_found", - "partner_not_found", - "wallet_not_found", - "missing_app_id", - "missing_client_id", - "invalid_app_id", - "conflicting_auth_headers", - "missing_auth_headers", - "invalid_api_version", - "unknown_api_version", - "api_version_downgrade", - "sanctioned_user" + "summary": "Get payment options", + "tags": [ + "Gateway" ] - }, - "ErrorResponse": { - "type": "object", - "description": "Standard error response structure for API errors.", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "$ref": "#/components/schemas/ErrorCode" + } + }, + "/v1/gateway/payment/{id}/status": { + "get": { + "description": "Retrieves the status of a payment by its ID. Returns a polling delay to wait\nbefore checking the status again.", + "operationId": "gatewayGetPaymentStatus", + "parameters": [ + { + "in": "header", + "name": "Api-Key", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "message": { - "type": "string" - } - } - }, - "FetchRequest": { - "type": "object", - "required": [ - "optionId", - "data" - ], - "properties": { - "data": { - "type": "string", - "description": "Extra data to be passed" + { + "in": "header", + "name": "App-Id", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "optionId": { - "type": "string", - "description": "ID of the option to build an action for" - } - }, - "example": { - "data": "...", - "optionId": "opt_123" - } - }, - "FetchResponse": { - "type": "object", - "required": [ - "actions" - ], - "properties": { - "actions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Action" + { + "in": "header", + "name": "Client-Id", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] } - } - }, - "example": { - "actions": [ - { - "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" + }, + { + "in": "header", + "name": "WCP-Version", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } + }, + { + "in": "header", + "name": "Sdk-Name", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } + }, + { + "in": "header", + "name": "Sdk-Version", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } + }, + { + "in": "header", + "name": "Sdk-Platform", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } + }, + { + "description": "Payment ID", + "in": "path", + "name": "id", + "required": true, + "schema": { + "$ref": "#/components/schemas/PaymentId" + } + }, + { + "description": "Maximum time to long-poll for payment status, in milliseconds.", + "in": "query", + "name": "maxPollMs", + "required": false, + "schema": { + "format": "int64", + "minimum": 0, + "type": [ + "integer", + "null" + ] } - ] - } - }, - "GatewayPaymentInformation": { - "type": "object", - "description": "Payment information returned when a gateway payment succeeds.", - "required": [ - "txId", - "optionAmount" + } ], - "properties": { - "optionAmount": { - "$ref": "#/components/schemas/Amount", - "description": "Amount paid in token units" + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPaymentStatusResponse" + } + } + }, + "description": "Payment status retrieved successfully" }, - "txId": { - "type": "string", - "description": "Transaction identifier (hash)" + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Invalid request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Invalid API key" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Payment not found" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Internal error" } - } - }, - "GetPaymentOptionsRequest": { - "type": "object", - "required": [ - "accounts" - ], - "properties": { - "accounts": { - "type": "array", - "items": { + }, + "summary": "Get the payment status", + "tags": [ + "Gateway" + ] + } + }, + "/v1/payments": { + "post": { + "description": "Creates a new payment with the provided payment details.", + "operationId": "paymentsCreatePayment", + "parameters": [ + { + "in": "header", + "name": "Api-Key", + "required": true, + "schema": { "type": "string" } }, - "refresh": { - "type": "array", - "items": { + { + "in": "header", + "name": "Merchant-Id", + "required": true, + "schema": { "type": "string" - }, - "nullable": true - } - }, - "example": { - "accounts": [ - "eip155:8453:0x123" - ], - "refresh": null - } - }, - "GetPaymentOptionsResponse": { - "type": "object", - "properties": { - "collectData": { - "$ref": "#/components/schemas/CollectData", - "nullable": true + } }, - "info": { - "$ref": "#/components/schemas/GetPaymentResponse", - "nullable": true + { + "in": "header", + "name": "WCP-Version", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "options": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PaymentOption" + { + "in": "header", + "name": "Sdk-Name", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] } - } - }, - "example": { - "collectData": { - "fields": [ - { - "id": "fullName", - "name": "Full name", - "required": true, - "type": "text" - }, - { - "id": "dob", - "name": "Date of birth", - "required": true, - "type": "date" - } - ], + }, + { + "in": "header", + "name": "Sdk-Version", + "required": false, "schema": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "anyOf": [ - { - "required": [ - "pobCountry", - "pobAddress" - ] - }, - { - "required": [ - "porCountry", - "porAddress" - ] - } - ], - "properties": { - "dob": { - "description": "Date of birth in YYYY-MM-DD format", - "format": "date", - "title": "Date of Birth", - "type": "string" - }, - "fullName": { - "description": "User's full legal name", - "minLength": 1, - "title": "Full Name", - "type": "string" - }, - "pobAddress": { - "description": "Place of birth city and state (e.g., 'New York, NY')", - "maxLength": 200, - "title": "Place of Birth Address", - "type": "string" - }, - "pobCountry": { - "description": "Place of birth country code (ISO 3166-1 alpha-2)", - "pattern": "^[A-Z]{2}$", - "title": "Place of Birth Country", - "type": "string" - }, - "porAddress": { - "description": "Place of residence street address, city, and state", - "maxLength": 200, - "title": "Place of Residence Address", - "type": "string" - }, - "porCountry": { - "description": "Place of residence country code (ISO 3166-1 alpha-2)", - "pattern": "^[A-Z]{2}$", - "title": "Place of Residence Country", - "type": "string" - }, - "tosConfirmed": { - "const": true, - "description": "Must be true to confirm Terms of Service acceptance", - "title": "Terms of Service Confirmation", - "type": "boolean" - } - }, - "required": [ - "fullName", - "dob", - "tosConfirmed" - ], - "type": "object" - }, - "url": "https://data-collection.walletconnect.com/ic/pay_123?accounts=eip155:1:0x123" + "type": [ + "string", + "null" + ] + } }, - "info": { - "amount": { - "display": { - "assetName": "USD Coin", - "assetSymbol": "USDC", - "decimals": 6, - "iconUrl": "https://assets.walletconnect.com/usdc.png", - "networkIconUrl": "https://assets.walletconnect.com/base.png", - "networkName": "Base" - }, - "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", - "value": "1000000" - }, - "buyer": { - "accountCaip10": "eip155:1:0x0000000000000000000000000000000000000000", - "accountProviderIcon": "https://example.com/icon.png", - "accountProviderName": "Wallet" + { + "in": "header", + "name": "Sdk-Platform", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } + }, + { + "in": "header", + "name": "Idempotency-Key", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePayment" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePaymentResponse" + } + } }, - "expiresAt": 1700000000, - "merchant": { - "iconUrl": "https://example.com/icon.png", - "name": "Merchant" + "description": "Payment created successfully" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } }, - "status": "requires_action" + "description": "Invalid request" }, - "options": [ - { - "account": "eip155:1:0x0000000000000000000000000000000000000000", - "actions": [ - { - "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" + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } - ], - "amount": { - "display": { - "assetName": "USD Coin", - "assetSymbol": "USDC", - "decimals": 6, - "iconUrl": "https://assets.walletconnect.com/usdc.png", - "networkIconUrl": "https://assets.walletconnect.com/base.png", - "networkName": "Base" - }, - "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", - "value": "1000000" - }, - "collectData": { - "fields": [ - { - "id": "fullName", - "name": "Full name", - "required": true, - "type": "text" - }, - { - "id": "dob", - "name": "Date of birth", - "required": true, - "type": "date" - } - ], + } + }, + "description": "Invalid API key" + }, + "500": { + "content": { + "application/json": { "schema": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "anyOf": [ - { - "required": [ - "pobCountry", - "pobAddress" - ] - }, - { - "required": [ - "porCountry", - "porAddress" - ] - } - ], - "properties": { - "dob": { - "description": "Date of birth in YYYY-MM-DD format", - "format": "date", - "title": "Date of Birth", - "type": "string" - }, - "fullName": { - "description": "User's full legal name", - "minLength": 1, - "title": "Full Name", - "type": "string" - }, - "pobAddress": { - "description": "Place of birth city and state (e.g., 'New York, NY')", - "maxLength": 200, - "title": "Place of Birth Address", - "type": "string" - }, - "pobCountry": { - "description": "Place of birth country code (ISO 3166-1 alpha-2)", - "pattern": "^[A-Z]{2}$", - "title": "Place of Birth Country", - "type": "string" - }, - "porAddress": { - "description": "Place of residence street address, city, and state", - "maxLength": 200, - "title": "Place of Residence Address", - "type": "string" - }, - "porCountry": { - "description": "Place of residence country code (ISO 3166-1 alpha-2)", - "pattern": "^[A-Z]{2}$", - "title": "Place of Residence Country", - "type": "string" - }, - "tosConfirmed": { - "const": true, - "description": "Must be true to confirm Terms of Service acceptance", - "title": "Terms of Service Confirmation", - "type": "boolean" - } - }, - "required": [ - "fullName", - "dob", - "tosConfirmed" - ], - "type": "object" - }, - "url": "https://data-collection.walletconnect.com/ic/pay_123?accounts=eip155:1:0x123" - }, - "etaS": 5, - "expiresAt": 1700000300, - "id": "opt_123" - } - ] + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Internal error" + } }, - "required": [ - "options" + "summary": "Create a new payment", + "tags": [ + "Payments" ] - }, - "GetPaymentResponse": { - "type": "object", - "required": [ - "status", - "amount", - "expiresAt", - "merchant" + } + }, + "/v1/payments/{id}": { + "get": { + "description": "Retrieves the full details of a payment by its ID, including settlement\ninformation when available.", + "operationId": "paymentsGetPayment", + "parameters": [ + { + "in": "header", + "name": "Api-Key", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Merchant-Id", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "WCP-Version", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } + }, + { + "in": "header", + "name": "Sdk-Name", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } + }, + { + "in": "header", + "name": "Sdk-Version", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } + }, + { + "in": "header", + "name": "Sdk-Platform", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } + }, + { + "in": "header", + "name": "Idempotency-Key", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } + }, + { + "description": "Payment ID", + "in": "path", + "name": "id", + "required": true, + "schema": { + "$ref": "#/components/schemas/PaymentId" + } + } ], - "properties": { - "amount": { - "$ref": "#/components/schemas/Amount" + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaymentsGetPaymentResponse" + } + } + }, + "description": "Payment details retrieved successfully" }, - "buyer": { - "$ref": "#/components/schemas/BuyerInfo", - "nullable": true + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Invalid request" }, - "expiresAt": { - "type": "integer", - "format": "int64", - "minimum": 0 + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Invalid API key" }, - "merchant": { - "$ref": "#/components/schemas/MerchantInfo" + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Payment not found" }, - "status": { - "$ref": "#/components/schemas/PaymentStatus" + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Internal error" } }, - "example": { - "amount": { - "display": { - "assetName": "USD Coin", - "assetSymbol": "USDC", - "decimals": 6, - "iconUrl": "https://assets.walletconnect.com/usdc.png", - "networkIconUrl": "https://assets.walletconnect.com/base.png", - "networkName": "Base" - }, - "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", - "value": "1000000" + "summary": "Get payment details", + "tags": [ + "Payments" + ] + } + }, + "/v1/payments/{id}/cancel": { + "post": { + "operationId": "paymentsCancelPayment", + "parameters": [ + { + "in": "header", + "name": "Api-Key", + "required": true, + "schema": { + "type": "string" + } }, - "buyer": { - "accountCaip10": "eip155:1:0x0000000000000000000000000000000000000000", - "accountProviderIcon": "https://example.com/icon.png", - "accountProviderName": "Wallet" + { + "in": "header", + "name": "Merchant-Id", + "required": true, + "schema": { + "type": "string" + } }, - "expiresAt": 1700000000, - "merchant": { - "iconUrl": "https://example.com/icon.png", - "name": "Merchant" + { + "in": "header", + "name": "WCP-Version", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "status": "requires_action" - } - }, - "GetPaymentStatusResponse": { - "type": "object", - "required": [ - "status", - "isFinal" - ], - "properties": { - "info": { - "$ref": "#/components/schemas/PaymentInformation", - "nullable": true, - "description": "Payment information (transaction hash, amount). Present when status is\nSucceeded, null otherwise." + { + "in": "header", + "name": "Sdk-Name", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "isFinal": { - "type": "boolean", - "description": "True if the payment is in a final state and no longer requires polling" + { + "in": "header", + "name": "Sdk-Version", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "pollInMs": { - "type": "integer", - "format": "int64", - "description": "Time to poll for payment status, in milliseconds. Not present if the\npayment is in a final state.", - "minimum": 0, - "nullable": true + { + "in": "header", + "name": "Sdk-Platform", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "status": { - "$ref": "#/components/schemas/PaymentStatus", - "description": "Payment status" - } - }, - "example": { - "info": null, - "isFinal": false, - "pollInMs": 1000, - "status": "requires_action" - } - }, - "MerchantInfo": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "iconUrl": { - "type": "string", - "description": "Merchant icon URL", - "nullable": true + { + "in": "header", + "name": "Idempotency-Key", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "name": { - "type": "string", - "description": "Merchant name" + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "$ref": "#/components/schemas/PaymentId" + } } - }, - "example": { - "iconUrl": "https://example.com/icon.png", - "name": "Merchant" - } - }, - "PaymentId": { - "type": "string", - "description": "Payment ID", - "example": "pay_7fa2ecc101ARZ3NDEKTSV4RRFFQ69G5FAV" - }, - "PaymentInformation": { - "type": "object", - "description": "Payment information returned when payment succeeds", - "required": [ - "txId", - "optionAmount" ], - "properties": { - "optionAmount": { - "$ref": "#/components/schemas/Amount", - "description": "Amount paid in token units" + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaymentsCancelPaymentResponse" + } + } + }, + "description": "Payment cancelled successfully" }, - "txId": { - "type": "string", - "description": "Transaction identifier (hash)" - } - }, - "example": { - "optionAmount": { - "display": { - "assetName": "USD Coin", - "assetSymbol": "USDC", - "decimals": 6, - "iconUrl": "https://assets.walletconnect.com/usdc.png", - "networkIconUrl": "https://assets.walletconnect.com/base.png", - "networkName": "Base" + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } }, - "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", - "value": "1000000" + "description": "Payment cannot be cancelled" }, - "txId": "0xabc123..." - } - }, - "PaymentOption": { - "type": "object", - "required": [ - "id", - "account", - "amount", - "etaS", - "actions" - ], - "properties": { - "account": { - "type": "string", - "description": "The account to use for the option" + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Invalid API key" }, - "actions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Action" + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Payment not found" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } }, - "description": "Actions required to complete the option" + "description": "Internal error" + } + }, + "tags": [ + "Payments" + ] + } + }, + "/v1/payments/{id}/status": { + "get": { + "description": "Retrieves the status of a payment by its ID. Returns a polling delay to wait\nbefore checking the status again.", + "operationId": "paymentsGetPaymentStatus", + "parameters": [ + { + "in": "header", + "name": "Api-Key", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "Merchant-Id", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "WCP-Version", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "amount": { - "$ref": "#/components/schemas/Amount", - "description": "The option's token and amount" + { + "in": "header", + "name": "Sdk-Name", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "collectData": { - "$ref": "#/components/schemas/CollectData", - "nullable": true, - "description": "Per-option IC data collection info. Present when this option's account requires data collection, null otherwise." + { + "in": "header", + "name": "Sdk-Version", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "etaS": { - "type": "integer", - "format": "int64", - "description": "Estimated time to complete the option, in seconds", - "minimum": 0 + { + "in": "header", + "name": "Sdk-Platform", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "expiresAt": { - "type": "integer", - "format": "int64", - "description": "Unix timestamp (seconds) after which this quote is stale and confirm_payment\nwill reject it with `quote_expired`. The wallet should re-fetch options before\nthis deadline. `None` for direct-currency options that don't involve a rate.", - "minimum": 0, - "nullable": true + { + "in": "header", + "name": "Idempotency-Key", + "required": false, + "schema": { + "type": [ + "string", + "null" + ] + } }, - "id": { - "type": "string", - "description": "ID of the option to be used to refer to it in other requests. May be up to 2^16 characters." - } - }, - "example": { - "account": "eip155:1:0x0000000000000000000000000000000000000000", - "actions": [ - { - "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" + { + "description": "Payment ID", + "in": "path", + "name": "id", + "required": true, + "schema": { + "$ref": "#/components/schemas/PaymentId" } - ], - "amount": { - "display": { - "assetName": "USD Coin", - "assetSymbol": "USDC", - "decimals": 6, - "iconUrl": "https://assets.walletconnect.com/usdc.png", - "networkIconUrl": "https://assets.walletconnect.com/base.png", - "networkName": "Base" - }, - "unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000", - "value": "1000000" }, - "collectData": { - "fields": [ - { - "id": "fullName", - "name": "Full name", - "required": true, - "type": "text" - }, - { - "id": "dob", - "name": "Date of birth", - "required": true, - "type": "date" - } - ], + { + "description": "Maximum time to long-poll for payment status, in milliseconds.", + "in": "query", + "name": "maxPollMs", + "required": false, "schema": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "anyOf": [ - { - "required": [ - "pobCountry", - "pobAddress" - ] - }, - { - "required": [ - "porCountry", - "porAddress" - ] + "format": "int64", + "minimum": 0, + "type": [ + "integer", + "null" + ] + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPaymentStatusResponse" } - ], - "properties": { - "dob": { - "description": "Date of birth in YYYY-MM-DD format", - "format": "date", - "title": "Date of Birth", - "type": "string" - }, - "fullName": { - "description": "User's full legal name", - "minLength": 1, - "title": "Full Name", - "type": "string" - }, - "pobAddress": { - "description": "Place of birth city and state (e.g., 'New York, NY')", - "maxLength": 200, - "title": "Place of Birth Address", - "type": "string" - }, - "pobCountry": { - "description": "Place of birth country code (ISO 3166-1 alpha-2)", - "pattern": "^[A-Z]{2}$", - "title": "Place of Birth Country", - "type": "string" - }, - "porAddress": { - "description": "Place of residence street address, city, and state", - "maxLength": 200, - "title": "Place of Residence Address", - "type": "string" - }, - "porCountry": { - "description": "Place of residence country code (ISO 3166-1 alpha-2)", - "pattern": "^[A-Z]{2}$", - "title": "Place of Residence Country", - "type": "string" - }, - "tosConfirmed": { - "const": true, - "description": "Must be true to confirm Terms of Service acceptance", - "title": "Terms of Service Confirmation", - "type": "boolean" + } + }, + "description": "Payment status retrieved successfully" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" } - }, - "required": [ - "fullName", - "dob", - "tosConfirmed" - ], - "type": "object" + } }, - "url": "https://data-collection.walletconnect.com/ic/pay_123?accounts=eip155:1:0x123" + "description": "Invalid request" }, - "etaS": 5, - "expiresAt": 1700000300, - "id": "opt_123" - } - }, - "PaymentStatus": { - "type": "string", - "description": "Payment status representing the lifecycle of a payment.\n\nPayments progress through these states from creation to terminal status.\nSome states are specific to the payment source (pull vs push).", - "enum": [ - "requires_action", - "processing", - "succeeded", - "failed", - "expired", - "cancelled" - ] - }, - "WalletRpcAction": { - "type": "object", - "required": [ - "chain_id", - "method", - "params" - ], - "properties": { - "chain_id": { - "type": "string" + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Invalid API key" }, - "method": { - "type": "string" + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Payment not found" }, - "params": { - "type": "array", - "items": {} + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + }, + "description": "Internal error" } }, - "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\"}}" - ] - } - } - }, - "securitySchemes": { - "API Key": { - "type": "apiKey", - "in": "header", - "name": "Api-Key" - }, - "ApiKey": { - "type": "apiKey", - "in": "header", - "name": "Api-Key", - "description": "Private API key for wallet authentication" - }, - "AppId": { - "type": "apiKey", - "in": "header", - "name": "App-Id", - "description": "Public App ID for wallet authentication. When using this auth mode, the Client-Id header is also required." + "summary": "Get the payment status", + "tags": [ + "Payments" + ] } } }, @@ -2382,14 +3247,19 @@ "AppId": [] } ], + "servers": [ + { + "url": "https://api.pay.walletconnect.com" + } + ], "tags": [ { - "name": "Payments", - "description": "Payment operations" + "description": "Payment operations", + "name": "Payments" }, { - "name": "Gateway", - "description": "Gateway API for wallets to fulfill payments" + "description": "Gateway API for wallets to fulfill payments", + "name": "Gateway" } ] }