Skip to content

Admin System

Complete guide to the admin system, authentication, and tenant creation for partners, resellers, integrators, and developers.

Overview

The WalletPass.ai admin system provides three roles:

  • Super Admin - Full system access
  • Admin - Can create and manage own tenants (for partners, resellers, integrators, developers)
  • Tenant - Uses API keys for normal operations

Getting Admin Access

Requesting an Admin Account

Admin accounts are for:

  • Partners - Companies that resell WalletPass.ai services
  • Resellers - Distributing WalletPass.ai to end customers
  • Integrators - Developers building integrations
  • Developers - Building custom solutions

To request an admin account:

  1. Contact Support - Reach out to support@walletpass.ai

  2. Provide Details:

    • Company name
    • Use case (partner, reseller, integrator, developer)
    • Expected number of tenants you'll manage
    • Contact information
  3. Receive Credentials:

    • Admin email and password
    • Access to admin endpoints
    • Documentation for tenant creation

Authentication Methods

Admin Authentication

Currently, the system uses email as Bearer token for admin endpoints:

http
Authorization: Bearer admin@walletpass.ai

⚠️ Important: This is for development/MVP. Production will use JWT tokens.

Bearer Token Authentication

Bearer tokens are used for tenant creation:

http
Authorization: Bearer bt_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

API Key Authentication

Tenants use API keys for all operations:

http
X-API-Key: wp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Admin Capabilities

As an admin, you can:

  • Create Bearer Tokens - Generate tokens for tenant creation
  • Create Tenants - Onboard new customer tenants
  • View Own Tenants - See tenants you've created
  • Manage Own Bearer Tokens - Create, view, and delete your tokens

Note: Admins can only see and manage tenants they created. Super admins can see all tenants.

Creating Tenants (For Admins)

Step 1: Create a Bearer Token

First, create a bearer token that you'll use to create tenants:

bash
curl -X POST https://tenant.walletpass.ai/v1/bearer-tokens \
  -H "Authorization: Bearer your-admin-email@example.com" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Production Token",
    "expires_at": "2026-12-31T23:59:59Z"
  }'

Response:

json
{
  "status": "success",
  "data": {
    "id": "token-uuid",
    "token": "bt_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "name": "Production Token",
    "expires_at": "2026-12-31T23:59:59Z",
    "created_at": "2025-01-09T10:30:00Z"
  }
}

⚠️ Important: Save the token value immediately - it's only shown once!

Step 2: Create a Tenant

Use the bearer token to create a new tenant for your customer:

bash
curl -X POST https://tenant.walletpass.ai/v1/onboard \
  -H "Authorization: Bearer bt_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "company_name": "Customer Company Name",
    "contact_email": "contact@customercompany.com",
    "contact_name": "John Doe"
  }'

Response:

json
{
  "status": "success",
  "message": "Tenant onboarded successfully",
  "data": {
    "tenant_id": "550e8400-e29b-41d4-a716-446655440000",
    "api_key": "wp_864e820cbbabce90ead1bc429eec64ed",
    "company_name": "Customer Company Name",
    "contact_email": "contact@customercompany.com",
    "created_at": "2025-01-09T10:30:00Z"
  }
}

⚠️ Important: Save the api_key - this is what your customer will use for all API calls!

Step 3: Provide Credentials to Customer

Share with your customer:

  • API Key: wp_864e820cbbabce90ead1bc429eec64ed
  • Base URL: https://tenant.walletpass.ai
  • Documentation: Link to this documentation site

Bearer Token Management

List Your Bearer Tokens

bash
curl -H "Authorization: Bearer your-admin-email@example.com" \
  https://tenant.walletpass.ai/v1/bearer-tokens

Response:

json
{
  "status": "success",
  "data": [
    {
      "id": "token-uuid-1",
      "name": "Production Token",
      "expires_at": "2026-12-31T23:59:59Z",
      "created_at": "2025-01-09T10:30:00Z",
      "is_active": true
    },
    {
      "id": "token-uuid-2",
      "name": "Development Token",
      "expires_at": null,
      "created_at": "2025-01-08T10:30:00Z",
      "is_active": true
    }
  ]
}

Note: The actual token value is only shown when created. After that, you can only see metadata.

Get Bearer Token Details

bash
curl -H "Authorization: Bearer your-admin-email@example.com" \
  https://tenant.walletpass.ai/v1/bearer-tokens/{token_id}

Delete Bearer Token

bash
curl -X DELETE https://tenant.walletpass.ai/v1/bearer-tokens/{token_id} \
  -H "Authorization: Bearer your-admin-email@example.com"

Viewing Your Tenants

List All Your Tenants

bash
curl -H "Authorization: Bearer your-admin-email@example.com" \
  https://tenant.walletpass.ai/v1/tenants

Response:

json
{
  "status": "success",
  "data": [
    {
      "tenant_id": "550e8400-e29b-41d4-a716-446655440000",
      "company_name": "Customer Company Name",
      "contact_email": "contact@customercompany.com",
      "status": "active",
      "created_at": "2025-01-09T10:30:00Z"
    }
  ]
}

Note: You only see tenants you created. Super admins see all tenants.

Get Tenant Details

bash
curl https://tenant.walletpass.ai/v1/tenant/{tenant_id}

This endpoint doesn't require authentication and returns public tenant information.

Complete Workflow Example

Here's a complete example of creating a tenant for a customer:

bash
# 1. Create bearer token (one-time, or create new ones as needed)
curl -X POST https://tenant.walletpass.ai/v1/bearer-tokens \
  -H "Authorization: Bearer partner@example.com" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Q1 2025 Token",
    "expires_at": "2025-03-31T23:59:59Z"
  }'

# Response contains: "token": "bt_abc123..."

# 2. Create tenant for customer
curl -X POST https://tenant.walletpass.ai/v1/onboard \
  -H "Authorization: Bearer bt_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "company_name": "Coffee Shop Inc",
    "contact_email": "admin@coffeeshop.com",
    "contact_name": "Jane Smith"
  }'

# Response contains: "api_key": "wp_xyz789..."

# 3. Share api_key with customer
# Customer can now use: X-API-Key: wp_xyz789...

Role-Based Access Control

Admin Access

  • ✅ Create own bearer tokens
  • ✅ Create own tenants
  • ✅ View own tenants only
  • ✅ Manage own bearer tokens
  • ❌ Cannot create other admins
  • ❌ Cannot see other admins' tenants

Super Admin Access

  • ✅ All admin capabilities
  • ✅ Create and manage all admins
  • ✅ View all tenants
  • ✅ Manage all bearer tokens

Tenant Access

  • ✅ Use API keys for normal operations
  • ✅ Access all tenant API endpoints
  • ❌ Cannot access admin endpoints
  • ❌ Cannot create other tenants

Security Best Practices

  1. Secure Bearer Tokens

    • Set appropriate expiration dates
    • Rotate tokens regularly
    • Delete unused tokens
  2. Token Storage

    • Store tokens securely
    • Never commit tokens to version control
    • Use environment variables
  3. API Key Distribution

    • Share API keys securely with customers
    • Use encrypted channels
    • Document proper usage
  4. Monitoring

    • Monitor tenant creation activity
    • Review bearer token usage
    • Track API key usage per tenant

Troubleshooting

"Invalid admin credentials"

  • Verify you're using the correct admin email as Bearer token
  • Check that your admin account is active
  • Contact support if issues persist

"Bearer token not found"

  • Verify token is correct (including bt_ prefix)
  • Check token hasn't expired
  • Ensure token is active

"Only super admin can create admins"

You're trying to create an admin without super admin privileges. Contact support to request admin access.

"Tenant creation failed"

  • Verify bearer token is valid and not expired
  • Check request body format
  • Ensure all required fields are provided
  • Contact support if issues persist

Support

Need help? Contact our support team:

WalletPass.ai Documentation