Skip to main content

WalaMail API Wrapper

A professional Python client library for interacting with the WalaMail API. This wrapper allows you to automate account management, check balances, and handle bulk purchases with custom formatting.


🚀 Installation

You can install the wrapper directly using pip:

pip install walamail

Note: Requires requests library (handled automatically by pip).


🔑 Authentication

Access requires an API Token. You can generate or retrieve your token from the WalaMail Dashboard under User Settings > API Keys.

All requests are authenticated via the Authorization: Bearer <token> header, which the client handles automatically.


📖 Quick Start

from walamail import WalaMailClient

# 1. Initialize the client
client = WalaMailClient(api_token="your_api_token", base_url="http://localhost:3000")

# 2. Check your balance
balance_info = client.get_balance()
print(f"💰 Balance: ${balance_info['balance']}")

# 3. Check what's in stock
stock = client.get_stock()
for item in stock:
    print(f"📦 {item['name']} - Price: ${item['price']} - Available: {item['stock']}")

🛠️ Detailed Method Reference

WalaMailClient(api_token, base_url="http://localhost:3000")

Constructs the API client.

  • api_token (str): Your secret API key.
  • base_url (str): The root URL of your WalaMail deployment.

get_balance()

Returns current user financial state.

  • Returns: {"balance": float, "transactions": [...]}
  • Use Case: Monitoring credit before running large automation batches.

get_stock()

Lists all active products and their real-time inventory levels.

  • Returns: List[{"id": int, "name": str, "price": float, "stock": int, ...}]
  • Use Case: Checking if Microsoft/Outlook accounts are available before attempting a purchase.

purchase(product_id, quantity, format="oauth", delimiter="|")

Bulk purchase accounts with customizable output format.

  • Arguments:
    • product_id (int): The numeric ID of the product.
    • quantity (int): Number of accounts to buy.
    • format (str):
      • oauth: Full credentials including Refresh Token and Client ID (default).
      • standard: Only email|password.
    • delimiter (str): Delimiter character. Options: |, :, -.
  • Returns:
    {
      "tradeNo": "WM...",
      "quantity": 5,
      "totalAmount": 0.05,
      "credentials": [
        "email|pass|token|id",
        "email|pass|token|id"
      ]
    }
    

get_accounts(page=1, limit=50)

Retrieves your order history and previously purchased accounts.

  • Returns: Paginated list of account records including emails and associated order IDs.

get_account_details(account_id)

Get technical details for a specific account, including direct instructions for Microsoft Graph API integration.

  • Returns: Configuration object for the specific account.

list_mail_accounts()

Helper specifically for the Mail Proxy system. Returns a list of accounts that can be used with the mailbox reading endpoints.


🧪 Advanced Example: Automated Purchase Flow

from walamail import WalaMailClient

client = WalaMailClient("YOUR_TOKEN")

# Find a specific product (e.g., 'Trusted Outlook')
stock = client.get_stock()
target_product = next((p for p in stock if "Trusted" in p["name"]), None)

if target_product and target_product["stock"] >= 5:
    # Buy 5 accounts in standard format using colon separator
    order = client.purchase(
        product_id=target_product["id"],
        quantity=5,
        format="standard",
        delimiter=":"
    )
    
    print(f"Order {order['tradeNo']} completed!")
    for account_line in order['credentials']:
        email, password = account_line.split(":")
        print(f"Purchased: {email}")
else:
    print("Stock insufficient or product not found.")

⚠️ Error Handling

The wrapper raises exceptions for API errors (4xx/5xx). It is recommended to wrap calls in try-except blocks.

try:
    client.get_balance()
except Exception as e:
    print(f"Request failed: {e}")

Metadata

Release files for walamail 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for walamail 0.1.1
File Size Uploaded Provenance
walamail-0.1.1.tar.gz 4.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for walamail 0.1.1
File Interpreter ABI Platform
walamail-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.3 kB

Release files / walamail-0.1.1.tar.gz

Download URL walamail-0.1.1.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
eb0155eb89a3aac34de93ac1d38b5170fc16bef3fb9244f63b25b595da50960c
BLAKE2b-256 checksum
How to use checksums
3034a03df56d06c2d40b88fae923271c1cffed873560f9d9aad62c0faf826936
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / walamail-0.1.1-py3-none-any.whl

Download URL walamail-0.1.1-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7f78fa2ac1cf9038f8b560834adf986707f220c48f2aca9a1333757463d6366
BLAKE2b-256 checksum
How to use checksums
4b39ea9c2b5b2dacf8f8f061991075f12120b3ed94d06a3900ff84efd371afa1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for walamail 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page