API-first integration (Non-SDK wallets) - WalletConnect Pay Docs

Integrating WalletConnect Pay

If you’re integrating WalletConnect Pay into a wallet without using the Wallet Pay SDK, you can use an API-first approach via the Gateway API. This flow is centered around three Gateway calls:

Prerequisites

Payment flow

The payment flow mirrors the SDK flow, but you call the Gateway API directly: Get Options → (Collect Data) → (Fetch Actions) → Execute Wallet RPC → Confirm Payment

Wallet RPC / Chain Wallet Connect Pay (Gateway API) Wallet User
alt[Selected option requires data collection] alt[Option includes a build action] Scan QR / Open payment link
POST /v1/gateway/payment/{id}/options (accounts) options[] (+ optional info/collectData) Display payment options
Select payment option Load selectedOption.collectData.url in WebView Fill form & accept T&C (IC_COMPLETE)
POST /v1/gateway/payment/{id}/fetch (optionId, data) actions[] (walletRpc)
Request signature(s) / transaction(s) Approve Execute wallet RPC actions (in order)
Results (e.g., signature(s) / tx hash(es)) POST /v1/gateway/payment/{id}/confirm (optionId, results, collectedData?)
status + isFinal (+ pollInMs) Show result / status

Understanding actions

Payment options can include an actions[] array. Each action tells your wallet what needs to happen next.

Maintain action ordering. The results[] you submit in Confirm a payment must correspond to the actions you executed, in order.

High-level steps

1) Get payment options

Call Get payment options for the given paymentId, passing a list of accounts (CAIP-10 / chain namespace format as provided by your wallet).

2) Fetch an action (only if required)

If an option contains an action of type build, call Fetch an action with that optionId and the data payload to resolve it into one or more executable actions (typically walletRpc).

3) Confirm a payment

After your wallet executes the required walletRpc actions (sign/submit), call Confirm a payment with:

If you used the WebView-based data collection flow (i.e., displayed collectData.url in a WebView), there is no need to send collectedData in the confirm request — the WebView submits user data directly to the backend.

If isFinal is false, the response may include pollInMs. Use it to decide when to check again.

The WalletConnect Pay SDKs support WebView-based data collection. Each payment option may have its own collectData.url. When present on a selected option, wallets can display this URL in a WebView instead of building native forms.

Integration guidelines

These guidelines reflect the patterns used internally by the WalletConnect Pay SDK. Following them ensures a smooth, reliable UX.

Payment link detection

Payment links can arrive in several formats. Your wallet should detect and extract the paymentId from:

Format Example
WC Pay URL (path) https://pay.walletconnect.com/pay_123
WC Pay URL (query) https://pay.walletconnect.com/?pid=pay_123
wc: URI with pay= param wc:abc@2?pay=https%3A%2F%2Fpay.walletconnect.com%2F%3Fpid%3Dpay_123
Bare payment ID pay_123

Only trust pay.walletconnect.com and *.pay.walletconnect.com as valid WC Pay hosts. Always validate the domain before extracting a payment ID.

Check for payment links before handling generic URLs or WalletConnect pairing URIs. Payment links are HTTPS URLs that would otherwise open in a browser.

Providing accounts

Pass all of the user’s accounts in CAIP-10 format (eip155:{chainId}:{address}) when calling Get payment options. Include accounts for every supported chain to maximize the number of payment options returned.

Resolving build actions

When an option’s actions[] contains a build action, it cannot be executed directly. Call Fetch an action (POST /v1/gateway/payment/{id}/fetch) with the optionId and the build action’s data string.

Executing wallet RPC actions

Each walletRpc action contains:

Execute each action in order using your wallet’s signing or transaction implementation. While doing so, ensure to collect the necessary signature or transaction hash outcomes for submission.

Submitting results

When calling Confirm a payment, wrap each signature as a walletRpc result:

{
  "optionId": "opt_123",
  "results": [
    { "type": "walletRpc", "data": ["0x<signature_1>"] },
    { "type": "walletRpc", "data": ["0x<signature_2>"] }
  ]
}

The results[] array must match the actions[] array in both length and order. Misalignment can cause payment failures.

Polling for final status

After Confirm a payment returns, check the isFinal field:

Retry strategy

Implement retries with exponential backoff and jitter for resilience:

Data collection

Data collection is per-option — each payment option may independently have a collectData object.

Expiration handling

Payments have an expiration timestamp (expiresAt in the payment info). Display a countdown or warning to the user when time is running low, and prevent submission after expiry.

API Reference

For request/response schemas and examples for each Gateway endpoint, see the API Reference.