Crea una nueva wallet para un usuario de tu aplicacion.
Endpoint
POST https://api.pan.dev/v1/wallets
Autenticacion
Solo API Key. X402 no soportado para operaciones de escritura.
Request
| Header | Valor |
|---|
| Authorization | Bearer pan_sk_... |
| Content-Type | application/json |
Body
{
"userId": "usuario_123",
"chainType": "ethereum",
"email": "[email protected]",
"metadata": {
"nombre": "Juan Perez",
"plan": "premium"
}
}
Parametros
| Campo | Tipo | Requerido | Descripcion |
|---|
userId | string | Si | ID unico 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
| Codigo | Error | Descripcion |
|---|
| 400 | INVALID_REQUEST | Body invalido |
| 401 | UNAUTHORIZED | API key invalida |
| 403 | WALLET_LIMIT_EXCEEDED | Limite de wallets del plan |
| 409 | WALLET_ALREADY_EXISTS | Usuario ya tiene wallet |
Ejemplos
curl -X POST https://api.pan.dev/v1/wallets \
-H "Authorization: Bearer $PAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"userId": "usuario_123",
"metadata": {"nombre": "Juan Perez"}
}'