Skip to main content
This documentation covers integrating WalletConnect Pay through WalletKit for React Native wallets. This approach provides a unified API where Pay is built into WalletKit, simplifying the integration for wallet developers.

Sample Wallet

For a complete working example, check out our sample wallet implementation:

Sample Wallet - React Native (WalletKit)

A reference React Native wallet app demonstrating WalletConnect Pay via WalletKit.
Using AI for Integration? If you’re using an AI IDE or assistant to help with integration, you can provide it with our comprehensive AI integration prompt for better context and guidance.

Requirements

  • Node.js 16+
  • WalletKit (@reown/walletkit)
You also need a WCP ID for your project, obtained from the WalletConnect Dashboard. How to obtain a WCP ID
  1. Navigate to the WalletConnect Dashboard.
  2. Select the project that is associated with your wallet (as in, the projectId that is being used for your wallet’s WalletConnect integration).
Select the project on WalletConnect Dashboard
  1. Click on the “Get Started” button to get a WCP ID associated with your project.
  2. The Dashboard will now show the WCP ID associated with your project.
  3. Click on the three dots on the right of the WCP ID and select “Copy WCP ID”. You will be using this for your wallet’s WalletConnect Pay integration.
Copy WCP ID from WalletConnect Dashboard

Installation

Install WalletKit using npm or yarn:
WalletConnect Pay is automatically included as part of WalletKit.
Check the npm page for the latest version.

Initialization

Initialize WalletKit as usual. Pay functionality is automatically available:
Use isPaymentLink to determine if a scanned URI is a payment link or a standard WalletConnect pairing URI:

Payment Flow

The payment flow consists of six main steps: Detect Payment Link -> Get Options -> Collect Data (if required) -> Get Actions -> Sign Actions -> Confirm Payment
1

Get Payment Options

Retrieve available payment options for a payment link:
2

Collect User Data (If Required)

After the user selects an option, check for collectData on it. If present, collect the data before fetching the required actions.

Embedded Data Collection Form

When a payment requires user information (e.g., for Travel Rule compliance), the SDK returns a collectData field on individual payment options. Each option may independently require data collection — some options may require it while others don’t.The form is loaded from selectedOption.collectData.url and embedded in your wallet (a WebView on mobile, an iframe on web). It handles field rendering, validation, Terms & Conditions and Privacy Policy acceptance, and submits data directly to the backend.Collect this data before fetching the required actions. For an option that requires Information Capture, getRequiredPaymentActions fails with 400 IC data required until the data has been submitted.The recommended approach is to display all payment options upfront, then handle data collection only when the user selects an option that requires it:
  1. Call getPaymentOptions and display all available options to the user
  2. Show a visual indicator (e.g., “Info required” badge) on options where option.collectData is present
  3. When the user selects an option, check selectedOption.collectData
  4. If present, load selectedOption.collectData.url in the embedded form
  5. Optionally append query parameters to the form URL — prefill (known user data), theme, and themeVariables (appearance). See Form URL parameters below. Use proper URL building so existing query parameters are preserved.
  6. Listen for completion messages: IC_COMPLETE (success) or IC_ERROR (failure)
  7. On IC_COMPLETE, continue the flow — fetch the required actions, sign, and confirm the payment. Don’t pass collectedData to confirmPayment(); the form submits data directly to the backend

Decision Matrix

Form URL parameters

The form URL accepts the following optional query parameters. Append them to selectedOption.collectData.url before loading it, preserving any existing query parameters.
collectData.schema is a JSON schema string — parse it and read its required array to discover the field keys for prefill. For example, a required array of ["fullName", "dob", "pobAddress"] maps to a prefill object of {"fullName": "...", "dob": "...", "pobAddress": "..."}.

Customizing the form appearance

theme and themeVariables are optional and independent — pass either, both, or neither:
  • theme switches the form between light and dark base color modes. Match it to your wallet’s active mode for a seamless transition.
  • themeVariables applies brand-level overrides (font, font size, select colors, button border radius, and input border radius). Generate the theme in the WalletConnect Pay Dashboard, export it as a base64url string, and append it to the form URL verbatim — you don’t need to encode it at runtime.
The top-level collectData on the payment options response is still available for backward compatibility. However, the per-option collectData is the recommended approach as it provides more granular control over the flow.
Do not pass collectedData to confirmPayment() when using the embedded form. The form handles data submission directly.

WebView Message Types

The WebView communicates with your wallet through JavaScript bridge messages. The message payload is a JSON string with the following structure:Platform-Specific Bridge Names
3

Get Required Actions

Get the wallet RPC actions needed to complete the payment:
4

Sign Actions

Sign each required action using your wallet’s signing implementation:
Payment options may include multiple actions with different RPC methods. For example, a Permit2 payment where the user lacks sufficient allowance returns two actions: an eth_sendTransaction to approve the token allowance, followed by an eth_signTypedData_v4 to sign the Permit2 transfer. Your wallet must check action.walletRpc.method and dispatch to the appropriate handler. For full implementation guidance, see USDT support.
Signatures must be in the same order as the actions array.
5

Confirm Payment

Submit the signatures and collected data to complete the payment:

Data Collection Implementation

When selectedOption.collectData.url is present, display the URL in a WebView using react-native-webview. Install the dependency:
Data Collection Best Practices
  • Display prominently: Show the form full-screen or as a prominent modal so users can interact with it easily
  • Loading indicator: Show a loading indicator while the form loads
  • Handle errors: Listen for IC_ERROR messages and display a user-facing error message with an option to retry
  • External links: Open Terms & Conditions and Privacy Policy links in the system browser rather than navigating within the form
  • Domain restriction: Only allow navigation to WalletConnect pay domains and HTTPS URLs
  • Back navigation: Handle back/dismiss gracefully — confirm cancellation with the user before closing the form mid-flow
  • Keyboard behavior: Test that the soft keyboard appears and behaves correctly when users tap on form inputs
  • Theme to match your brand: Pass theme=light or theme=dark to match your wallet’s active color mode, and apply brand tokens with themeVariables exported from the WalletConnect Pay Dashboard. See Form URL parameters.

Complete Example

Here’s a complete implementation example:

API Reference

WalletKit Pay Methods Pay methods are accessed via walletkit.pay.*. Utility Functions Instance Methods (walletkit.pay) Parameters GetPaymentOptionsParams
GetRequiredPaymentActionsParams
ConfirmPaymentParams
Response Types PaymentOptionsResponse
PaymentOption
Action
ConfirmPaymentResponse
PaymentInfo
PayAmount
CollectDataAction

Error Handling

Handle errors gracefully in your payment flow:

Best Practices

  1. Use WalletKit Integration: If your wallet already uses WalletKit, prefer this approach for automatic configuration
  2. Use isPaymentLink() for Detection: Use the utility function instead of manual URL parsing for reliable payment link detection
  3. Account Format: Always use CAIP-10 format for accounts: eip155:{chainId}:{address}
  4. Multiple Chains: Provide accounts for all supported chains to maximize payment options
  5. Signature Order: Maintain the same order of signatures as the actions array
  6. Error Handling: Always handle errors gracefully and show appropriate user feedback
  7. Loading States: Show loading indicators during API calls and signing operations
  8. Expiration: Check paymentInfo.expiresAt and warn users if time is running low
  9. User Data: Only collect data when collectData is present in the response and you don’t already have the required user data. If you already have the required data, you can submit this without collecting from the user. You must make sure the user accepts WalletConnect Terms and Conditions and Privacy Policy before submitting user information to WalletConnect.
  10. WebView Data Collection: When selectedOption.collectData.url is present, display the URL in a WebView using react-native-webview rather than building native forms. The WebView handles form rendering, validation, and T&C acceptance.