Endpoint
POST https://api.pan.tech/v1/wallets
Autenticación
Solo API Key. X402 no soportado para operaciones de escritura.
Request
Headers
| Header | Valor |
|---|---|
| Authorization | Bearer pan_sk_... |
| Content-Type | application/json |
Body
{
"userId": "usuario_123",
"chainType": "ethereum",
"email": "usuario@ejemplo.com",
"metadata": {
"nombre": "Juan Perez",
"plan": "premium"
}
}
Parámetros
| Campo | Tipo | Requerido | Descripción |
|---|---|---|---|
userId | string | Si | ID único del usuario en tu app |
chainType | string | No | ethereum (default) o tron |
email | string | No | Email para notificaciones |
metadata | object | No | Datos adicionales (JSON) |
Response
201 Created
{
"id": "pan_wallet_a1b2c3d4e5f6",
"userId": "usuario_123",
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"chainType": "ethereum",
"chains": [
"ethereum",
"ethereum-sepolia",
"arbitrum",
"arbitrum-sepolia",
"base",
"base-sepolia"
],
"metadata": {
"nombre": "Juan Perez",
"plan": "premium"
},
"createdAt": "2024-01-15T10:30:00Z"
}
Errores
| Código | Error | Descripción |
|---|---|---|
| 400 | INVALID_REQUEST | Body inválido |
| 401 | UNAUTHORIZED | API key inválida |
| 403 | WALLET_LIMIT_EXCEEDED | Límite de wallets del plan |
| 409 | WALLET_ALREADY_EXISTS | Usuario ya tiene wallet |
Ejemplos
curl -X POST https://api.pan.tech/v1/wallets \
-H "Authorization: Bearer $PAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"userId": "usuario_123",
"metadata": {"nombre": "Juan Perez"}
}'
const response = await fetch('https://api.pan.tech/v1/wallets', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.PAN_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
userId: 'usuario_123',
metadata: { nombre: 'Juan Perez' }
})
});
const wallet = await response.json();
import requests
response = requests.post(
'https://api.pan.tech/v1/wallets',
headers={
'Authorization': f'Bearer {API_KEY}',
'Content-Type': 'application/json'
},
json={
'userId': 'usuario_123',
'metadata': {'nombre': 'Juan Perez'}
}
)
wallet = response.json()
const wallet = await pan.wallet.create({
userId: 'usuario_123',
metadata: { nombre: 'Juan Perez' }
});
