Skip to content

Commit 80720b7

Browse files
committed
Revamp wallet and payments API docs and endpoints
Updated wallet and payments documentation to reflect new authentication and user management endpoints, including /v1/auth/initiate and /v1/auth/complete. Improved API reference sections, added OpenApiEndpoint usage, clarified pregeneration and user listing flows, and enhanced code samples for Unity and .NET SDKs. Refactored APIEndpoint component to show query parameters and examples, and updated AuthMethodsTabs to use new auth endpoints.
1 parent ac44cf0 commit 80720b7

File tree

9 files changed

+316
-443
lines changed

9 files changed

+316
-443
lines changed

apps/portal/src/app/contracts/page.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,22 @@ Read, write, and deploy smart contracts on any EVM compatible blockchain.
6969

7070
<TabsContent value="http">
7171

72+
### Read from Contracts
73+
7274
<OpenApiEndpoint path="/v1/contracts/read" method="POST" />
7375

76+
### Write to Contracts
77+
7478
<OpenApiEndpoint path="/v1/contracts/write" method="POST" />
7579

80+
### Deploy Contracts
81+
82+
<OpenApiEndpoint path="/v1/contracts" method="POST" />
83+
84+
### List Contracts
85+
86+
<OpenApiEndpoint path="/v1/contracts" method="GET" />
87+
7688
</TabsContent>
7789

7890
<TabsContent value="typescript">

apps/portal/src/app/payments/page.mdx

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import {
1010
TabsList,
1111
TabsTrigger,
1212
TabsContent,
13-
Badge
13+
Badge,
14+
OpenApiEndpoint,
1415
} from "@doc";
1516
import {
1617
ReactIcon,
@@ -181,7 +182,27 @@ const preparedQuote = await Bridge.Buy.prepare({
181182
</TabsContent>
182183

183184
<TabsContent value="http">
184-
The thirdweb Payments REST API is available at `https://payments.thirdweb.com/`. See the full [API Reference](https://payments.thirdweb.com/reference) for details.
185+
Use the thirdweb payments API to create and manage payments programmatically.
186+
187+
### Create Payment
188+
189+
Create a payment for your product or service:
190+
191+
<OpenApiEndpoint path="/v1/payments" method="POST" />
192+
193+
### Complete Payment
194+
195+
Complete a payment using the product ID:
196+
197+
<OpenApiEndpoint path="/v1/payments/{id}" method="POST" />
198+
199+
### Swap Tokens
200+
201+
Swap tokens for optimal payment processing:
202+
203+
<OpenApiEndpoint path="/v1/payments/swap" method="POST" />
204+
205+
For more details, see the full [API Reference](https://api.thirdweb.com/reference).
185206
</TabsContent>
186207
</Tabs>
187208

apps/portal/src/app/wallets/custom-auth/page.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ You will be asked to enter the following values
6868

6969
<TabsContent value="http">
7070

71-
<OpenApiEndpoint path="/v1/wallets/user/generic-auth" method="POST" />
71+
<OpenApiEndpoint path="/v1/auth/initiate" method="POST" />
7272

7373
</TabsContent>
7474

@@ -188,7 +188,7 @@ Once you've logged in with your own auth, you can pass the user's JWT to the in-
188188

189189
<TabsContent value="http">
190190

191-
<OpenApiEndpoint path="/v1/wallets/user/generic-auth" method="POST" requestBodyOverride={{
191+
<OpenApiEndpoint path="/v1/auth/complete" method="POST" requestBodyOverride={{
192192
type: "auth-payload",
193193
payload: "<your-auth-payload>",
194194
}} />

apps/portal/src/app/wallets/get-users/page.mdx

Lines changed: 51 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -20,191 +20,104 @@ From your backend, you can list all your users and fetch the details of any user
2020
<TabsList>
2121
<TabsTrigger value="single">Single User</TabsTrigger>
2222
<TabsTrigger value="all">All Users</TabsTrigger>
23+
<TabsTrigger value="create">Create User</TabsTrigger>
2324
</TabsList>
2425

2526
<TabsContent value="single">
2627

27-
### Endpoint
28+
## Get Single User
2829

29-
`GET` request to the following endpoint:
30-
31-
```http
32-
GET /v1/wallets/[email protected]
33-
Host: api.thirdweb.com
34-
x-secret-key: <your-secret-key>
35-
```
36-
37-
<OpenApiEndpoint path="/v1/wallets/user" method="GET" />
30+
Fetch details for a specific user by email, phone, wallet address, or user ID.
3831

3932
### Query Parameters
4033

41-
You can then query by different user identifiers:
34+
You can query by any of these user identifiers:
4235

43-
- `address`: The user's wallet address that thirdweb has generated for them
36+
- `address`: The user's wallet address that thirdweb generated
4437
- `email`: The user's email address
4538
- `phone`: The user's phone number
46-
- `externalWalletAddress`: The user's wallet address that used to login via SIWE
39+
- `externalWalletAddress`: The user's external wallet address (SIWE login)
4740
- `id`: The user's ID (for custom auth)
4841

4942
### Authentication
5043

51-
You need to include the following headers:
52-
44+
Required headers:
5345
- `x-secret-key`: Your secret key for authentication
5446
- `x-ecosystem-id` (optional): Your ecosystem ID
5547
- `x-ecosystem-partner-id` (optional): Your ecosystem partner ID
5648

57-
### Example Requests
58-
59-
Here's an example curl command to fetch user details by email:
60-
61-
```bash
49+
### Example
6250

63-
curl -X GET 'https://api.thirdweb.com/v1/wallets/[email protected]' \
64-
-H 'x-secret-key: YOUR_SECRET_KEY'
65-
66-
```
67-
68-
Here's an example curl command to fetch user details by address:
51+
<OpenApiEndpoint path="/v1/wallets/user" method="GET" />
6952

70-
```bash
71-
curl -X GET 'https://api.thirdweb.com/v1/wallets/user?address=0x123456789abcdef' \
72-
-H 'x-secret-key: YOUR_SECRET_KEY'
73-
```
53+
For ecosystem wallets, include the ecosystem headers in your requests.
7454

75-
Here's an example curl command to fetch the user details for an ecosystem owner:
55+
</TabsContent>
7656

77-
```bash
78-
curl -X GET 'https://api.thirdweb.com/v1/wallets/user?address=0x123456789abcdef' \
79-
-H 'x-secret-key: YOUR_SECRET_KEY' \
80-
-H 'x-ecosystem-id: ecosystem.YOUR_ECOSYSTEM_ID' \
81-
-H 'x-ecosystem-partner-id: YOUR_PARTNER_ID'
82-
```
57+
<TabsContent value="all">
8358

84-
In both examples, replace `YOUR_SECRET_KEY` with your actual ThirdWeb Client Secret.
59+
## Get All Users
8560

86-
Replace `YOUR_ECOSYSTEM_ID` and `YOUR_PARTNER_ID` with your actual ecosystem ID and partner ID respectively. The partner ID can be one you set up for yourself as the ecosystem owner.
61+
List all users in your in-app or ecosystem wallet with pagination support.
8762

88-
### Response Format
63+
### Query Parameters
8964

90-
The API returns a JSON array with the following structure for each user:
65+
- `page` (optional): Page number for pagination
66+
- `limit` (optional): Maximum users per request (default: 50)
9167

92-
```json
93-
{
94-
"result": {
95-
"pagination": {
96-
"hasMore": false,
97-
"limit": 50,
98-
"page": 1
99-
},
100-
"wallets": [
101-
{
102-
"address": "0x3aA70e68BBA8BC922a75d07388e368892c15c9Da",
103-
"createdAt": "2025-07-21T22:58:12.834Z",
104-
"profiles": [
105-
{
106-
"id": "107302390467834615186",
107-
"name": "Richard Hendricks",
108-
"type": "google",
109-
"email": "[email protected]",
110-
"picture": "https://lh3.googleusercontent.com/a/ACg8ocKC1D6ezzzaZxxUk4qtK_HCwVwpNamVopazXwklGBwuuHeSf_c=s96-c",
111-
"givenName": "Richard",
112-
"emailVerified": true
113-
}
114-
]
115-
}
116-
]
117-
}
118-
}
119-
```
68+
### Authentication
12069

121-
For more information, [view the full reference](https://api.thirdweb.com/reference#tag/wallets/get/v1/wallets/user)
70+
Required headers:
71+
- `x-secret-key`: Your secret key for authentication
72+
- `x-ecosystem-id` (optional): Your ecosystem ID
73+
- `x-ecosystem-partner-id` (optional): Your ecosystem partner ID
12274

123-
### Convenience Methods
75+
<Callout variant="info" title="Ecosystem Users">
76+
For ecosystem wallets, the secret key must be from the same account as the ecosystem owner.
77+
</Callout>
12478

125-
If you are using the thirdweb SDK, you can use the `getUser` method to retrieve user details.
79+
### Example
12680

127-
<Stack>
128-
<ArticleIconCard
129-
title="getUser"
130-
icon={TypeScriptIcon}
131-
description="Get user details from your backend for thirdweb wallets in TypeScript"
132-
href="/references/typescript/v5/getUser"
133-
/>
134-
</Stack>
81+
<OpenApiEndpoint path="/v1/wallets/users" method="GET" />
13582

13683
</TabsContent>
13784

138-
<TabsContent value="all">
85+
<TabsContent value="create">
13986

140-
### Endpoint
87+
## Create User Wallet (Pregeneration)
14188

142-
`GET` request to the following endpoint:
89+
Pregenerate a user wallet before authentication. This creates a wallet in advance that can be claimed later when the user authenticates.
14390

144-
```http
145-
GET /v1/wallets/users
146-
Host: api.thirdweb.com
147-
x-secret-key: <your-secret-key>
148-
```
91+
### Use Cases
14992

150-
### Query Parameters
151-
152-
- `page` (optional): The page number to fetch (for pagination)
153-
- `limit` (optional): Maximum number of users to return per request (defaults to 50)
93+
- Create wallets based on known email addresses or user IDs
94+
- Pre-fund wallets with tokens or NFTs before users claim them
95+
- Enable smoother onboarding experiences
15496

15597
### Authentication
15698

157-
You need to include the following headers:
158-
99+
Required headers:
159100
- `x-secret-key`: Your secret key for authentication
160101
- `x-ecosystem-id` (optional): Your ecosystem ID
161102
- `x-ecosystem-partner-id` (optional): Your ecosystem partner ID
162103

163-
<Callout variant="info" title="Getting ecosystem users">
164-
For ecosystem wallets, the secret key have to be from the same account as the
165-
ecosystem owner.
166-
</Callout>
104+
### Example
167105

168-
### Example Requests
169-
170-
Here's an example curl command to fetch all users:
171-
172-
```bash
173-
curl -X GET 'https://api.thirdweb.com/v1/wallets/users?page=2&limit=100' \
174-
-H 'x-secret-key: YOUR_SECRET_KEY' \
175-
-H 'Content-Type: application/json'
176-
```
177-
178-
### Response Format
179-
180-
A successful API call returns an array of user objects in the following format:
181-
182-
```json
183-
{
184-
"result": {
185-
"pagination": {
186-
"hasMore": false,
187-
"limit": 50,
188-
"page": 1
189-
},
190-
"wallets": [
191-
{
192-
"address": "0x3aA70e68BBA8BC922a75d07388e368892c15c9Da",
193-
"createdAt": "2025-07-21T22:58:12.834Z",
194-
"profiles": [
195-
{
196-
"id": "107302390467834615186",
197-
"name": "Richard Hendricks",
198-
"type": "google",
199-
"email": "[email protected]",
200-
"picture": "https://lh3.googleusercontent.com/a/ACg8ocKC1D6ezzzaZxxUk4qtK_HCwVwpNamVopazXwklGBwuuHeSf_c=s96-c",
201-
"givenName": "Richard",
202-
"emailVerified": true
203-
}]
204-
},
205-
]
206-
}
207-
```
106+
<OpenApiEndpoint path="/v1/wallets/user" method="POST" />
208107

209108
</TabsContent>
109+
210110
</Tabs>
111+
112+
## SDK Integration
113+
114+
If you're using the thirdweb SDK, you can use the `getUser` method for easier integration:
115+
116+
<Stack>
117+
<ArticleIconCard
118+
title="getUser"
119+
icon={TypeScriptIcon}
120+
description="Get user details from your backend for thirdweb wallets in TypeScript"
121+
href="/references/typescript/v5/getUser"
122+
/>
123+
</Stack>

0 commit comments

Comments
 (0)