Skip to main content

Overview

Base Pay supports requesting user profile information during payments through the dataCallback capability. This allows you to collect personal information like email addresses, physical addresses, phone numbers, and names during transactions.

Supported Data Types

The following data types are supported for profile requests:

Data Object Types

Name Object

Physical Address Object

Phone Number Object

Request Format

To request profile data, include the dataCallback capability in your wallet_sendCalls request:

Callback API

Your callback API will receive a POST request with the following structure:

Response Format

Your callback API must respond with one of two formats:

1. Success Response

Return the calls the user will end up submitting wrapped in a request object. They can be the same calls or new ones, but they must be present. You can change all capabilities (e.g. switching Paymaster if calls happen on a different chain) except the data callback capability, which must remain present.

2. Error Response

Return validation errors to prompt the user to correct their information:

Example Implementation

Here’s a complete example of a validation API endpoint:

Important Notes

  1. HTTPS Required: Your callback URL must use HTTPS, even for local development. Use a service like ngrok for testing.
  2. Return Original or New Calls: You MUST return the original calls or new calls in your success response. If you don’t, the wallet will return an error.
  3. Optional Fields: You can make any requested field optional by setting optional: true in the request. Optional fields will be marked as such in the Base Account interface.
  4. Privacy: Users always have full control over their data. They can choose to share or withhold any information, and they’re clearly shown what data you’re requesting.
  5. Validation: Base Account performs basic validation before sending data to your callback URL. This includes checking that emails are valid and addresses are properly formatted.