Alias-Based Invoicing#

Alias-based invoicing is CasaPay's low-code solution for operators who want to invoice tenants without deep API integration. CasaPay generates a unique email alias (e.g., jane.doe@casapay.me) for each tenant. When the operator sends a PDF invoice to that alias — from their PMS, accounting tool, or plain email — CasaPay automatically processes the PDF and converts it into a payment request delivered to the tenant via email and the CasaPay Wallet.

How it works#

  1. Generate an alias — Call the API or use the CasaPay Chrome Extension to create an alias for a tenant
  2. Send invoices to the alias — From any tool (PMS, CRM, email), send PDF invoices to tenant.name@casapay.me
  3. CasaPay processes the PDF — The system extracts invoice details (amount, due date, line items) from the PDF
  4. Tenant receives payment request — The tenant gets a payment link via email and an in-app notification in the CasaPay Wallet
  5. Tenant pays — The tenant clicks the link or opens the wallet to complete payment

Low-code integration

Alias-based invoicing requires no webhook handling, no payment intent creation, and no checkout integration. Just generate an alias once and send your invoices to it. CasaPay handles the rest.

The Email Alias object#

AttributeTypeDescription
idstringUnique identifier with alias_ prefix
objectstringAlways "email_alias"
emailstringThe generated alias address (e.g., jane.doe@casapay.me)
tenantstringAssociated tenant/customer ID
payment_agreementstringAssociated Payment Agreement ID
entitystringOperator entity ID
statusenumactive, paused, disabled
invoices_receivedintegerNumber of PDF invoices processed through this alias
last_invoice_attimestampWhen the last invoice was received
metadatahashKey-value pairs
createdtimestampTime at which the alias was created
livemodebooleanWhether this is a live mode object
{
  "id": "alias_abc123",
  "object": "email_alias",
  "email": "jane.doe@casapay.me",
  "tenant": "cus_123456789",
  "payment_agreement": "pa_789xyz",
  "entity": "ent_456def",
  "status": "active",
  "invoices_received": 12,
  "last_invoice_at": 1708732800,
  "metadata": {
    "property_id": "prop_456",
    "unit": "4B"
  },
  "created": 1700000000,
  "livemode": true
}

Create an Email Alias#

Creates a new email alias for a tenant. If the tenant does not exist, one is created automatically from the provided email.

POST/v1/email_aliases

Parameters#

tenant_emailstringREQUIRED

The tenant's actual email address. Used to generate the alias and create the tenant record if needed.

entity_idstringREQUIRED

The operator entity ID this alias belongs to.

tenant_first_namestring

Tenant's first name. If not provided, extracted from the email address.

tenant_last_namestring

Tenant's last name. If not provided, extracted from the email address.

currencystring

Three-letter ISO 4217 currency code. Defaults to the entity's currency.

metadatahash

Set of key-value pairs for additional information.

Response#

Returns the Email Alias object. If a tenant with this email already exists, returns the existing alias with already_exists: true.

curl https://api.casapay.com/v1/email_aliases \
  -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc" \
  -H "Content-Type: application/json" \
  -d '{
    "tenant_email": "jane.doe@example.com",
    "entity_id": "ent_456def",
    "tenant_first_name": "Jane",
    "tenant_last_name": "Doe",
    "currency": "eur",
    "metadata": {
      "property_id": "prop_456",
      "unit": "4B"
    }
  }'
{
  "id": "alias_abc123",
  "object": "email_alias",
  "email": "jane.doe@casapay.me",
  "tenant": "cus_new789",
  "payment_agreement": "pa_auto456",
  "entity": "ent_456def",
  "status": "active",
  "already_exists": false,
  "invoices_received": 0,
  "last_invoice_at": null,
  "metadata": {
    "property_id": "prop_456",
    "unit": "4B"
  },
  "created": 1708732800,
  "livemode": false
}

Retrieve an Email Alias#

Retrieves the details of an existing email alias.

GET/v1/email_aliases/:id

Parameters#

idstringREQUIRED

The alias ID.

curl https://api.casapay.com/v1/email_aliases/alias_abc123 \
  -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc"

List Email Aliases#

Returns a list of email aliases. The aliases are sorted by creation date, with the most recent first.

GET/v1/email_aliases

Parameters#

entity_idstring

Filter by operator entity.

tenantstring

Filter by tenant/customer ID.

statusstring

Filter by status: active, paused, or disabled.

limitinteger

Maximum number of objects to return. Default is 10, maximum is 100.

starting_afterstring

Cursor for pagination. Pass the ID of the last object from the previous page.

curl "https://api.casapay.com/v1/email_aliases?entity_id=ent_456def&limit=10" \
  -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc"

Update an Email Alias#

Updates the specified email alias.

POST/v1/email_aliases/:id

Parameters#

statusstring

Set to paused to temporarily stop processing invoices, or disabled to permanently deactivate.

metadatahash

Update key-value pairs.

curl https://api.casapay.com/v1/email_aliases/alias_abc123 \
  -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc" \
  -H "Content-Type: application/json" \
  -d '{"status": "paused"}'

Bulk Create Aliases#

Creates multiple email aliases in a single request. Useful when onboarding multiple tenants at once.

POST/v1/email_aliases/bulk

Parameters#

entity_idstringREQUIRED

The operator entity ID.

aliasesarrayREQUIRED

Array of alias creation objects, each containing tenant_email and optionally tenant_first_name, tenant_last_name.

currencystring

Default currency for all aliases. Defaults to entity currency.

curl https://api.casapay.com/v1/email_aliases/bulk \
  -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc" \
  -H "Content-Type: application/json" \
  -d '{
    "entity_id": "ent_456def",
    "aliases": [
      {"tenant_email": "jane.doe@example.com", "tenant_first_name": "Jane", "tenant_last_name": "Doe"},
      {"tenant_email": "john.smith@example.com"},
      {"tenant_email": "maria.garcia@example.com", "tenant_first_name": "Maria", "tenant_last_name": "Garcia"}
    ],
    "currency": "eur"
  }'
{
  "object": "list",
  "data": [
    {
      "id": "alias_abc123",
      "email": "jane.doe@casapay.me",
      "tenant": "cus_new789",
      "status": "active",
      "already_exists": false
    },
    {
      "id": "alias_def456",
      "email": "john.smith@casapay.me",
      "tenant": "cus_new790",
      "status": "active",
      "already_exists": false
    },
    {
      "id": "alias_ghi789",
      "email": "maria.garcia@casapay.me",
      "tenant": "cus_existing123",
      "status": "active",
      "already_exists": true
    }
  ],
  "total_created": 2,
  "total_existing": 1
}

Chrome Extension#

CasaPay provides a Chrome Extension for operators who prefer a visual interface for generating aliases. The extension supports:

  • Single alias generation — Paste a tenant email and get the alias instantly
  • Bulk CSV upload — Upload a CSV of tenant emails and download results with generated aliases
  • Copy to clipboard — One-click copy of generated aliases for pasting into PMS or email
  • Recent history — Quick access to the last 10 generated aliases
  • Sandbox mode — Test alias generation without affecting production data

Install the extension

The CasaPay Chrome Extension is available for operators on all plans. Contact your account manager or visit the CasaPay Dashboard to get started.


PDF Processing#

When a PDF invoice is sent to a CasaPay email alias, the system:

  1. Identifies the tenant from the alias routing
  2. Extracts invoice data including amount, due date, line items, and reference numbers
  3. Creates an Alias Invoice record linking the PDF to the payment agreement
  4. Generates a payment request with a unique payment link
  5. Notifies the tenant via email (with payment link + formatted invoice) and in the CasaPay Wallet

Supported PDF formats#

CasaPay processes invoices from any PMS or accounting tool. The system uses OCR and document intelligence to extract:

  • Total amount due
  • Due date
  • Line item descriptions and amounts
  • Invoice reference numbers
  • Tax amounts

Processing time

PDF processing typically completes within 30 seconds. Complex or multi-page invoices may take up to 2 minutes. Subscribe to alias_invoice.processed webhooks for real-time notifications.