Skip to content

Transaction Builder API

Create and manage transaction builders with full participant and property management capabilities.

Buyer transaction creation changes October 12, 2026

Start buyer transactions with a Buyer Record and convert it to a builder. Direct LISTING creation remains supported. Direct buyer TRANSACTION creation examples on this page describe the legacy workflow.


Overview

Transaction Builder Workflow

The Transaction Builder API allows you to:

  • Create new transaction builders for various types of real estate transactions
  • Configure property details, participants, and financial information
  • Manage buyers, sellers, agents, and other transaction participants
  • Submit completed transactions for processing
  • Convert listings to transactions
  • Backward Compatibility with legacy method names

🚨 CRITICAL API REQUIREMENTS

These requirements are MANDATORY for successful API calls:

Location Updates: - Basic address fields (street, city, state, zip) alone will FAIL - Additional fields are REQUIRED: county, yearBuilt, mlsNumber

Price/Date Updates: - Basic price fields alone will FAIL - BOTH commission objects are REQUIRED: listingCommission AND saleCommission - Commission objects MUST include negativeOrEmpty: false field

Commission Splits: - ⚠️ CRITICAL: Use PARTICIPANT IDs, not agent IDs! - After adding agents, retrieve the transaction to get participant IDs - Commission splits are REQUIRED before submission

Co-Agent Roles: - ✅ Working: "REAL", "BUYERS_AGENT", "SELLERS_AGENT" - ❌ Fails: "LISTING_AGENT"

Owner Agents: - Require specific sequence: location → price/date → participants → owner agent - Need valid officeId and teamId

Transaction Types: - Only two types available for draft stage: "SALE" or "LEASE" - Deal type (SALE/LEASE) is independent of representation type (BUYER/SELLER/DUAL) - dealType refers to the type of real estate transaction - representationType refers to which party the agent represents

Submission Requirements: - Commission splits MUST be populated (error: "commissionSplitsInfo cannot be empty") - Commission payer (usually title company) is REQUIRED - Both buyer AND seller must be added (even for buyer-only representation)


Quick Start

from typing import Dict, Any

from rezen import RezenClient

client: RezenClient = RezenClient()

# Step 1: Create transaction builder
transaction_id: str = client.transaction_builder.create_transaction_builder()

# Step 2: Add property information - CRITICAL REQUIREMENTS
# ⚠️ Additional fields beyond basic address are REQUIRED
location_data: Dict[str, Any] = {
    "street": "123 Main Street",  # Use 'street' not 'address'
    "city": "Salt Lake City",
    "state": "UTAH",  # MUST BE ALL CAPS
    "zip": "84101",   # Use 'zip' not 'zipCode'
    "county": "Salt Lake",      # REQUIRED - API fails without this
    "yearBuilt": 2020,         # REQUIRED - API fails without this
    "mlsNumber": "MLS123456"   # REQUIRED - API fails without this
}
client.transaction_builder.update_location_info(transaction_id, location_data)

# Step 3: Add price/date information - CRITICAL REQUIREMENTS
# ⚠️ BOTH commission objects are REQUIRED together

# Option 1: Using the helper method (recommended)
price_data = client.transaction_builder.prepare_price_and_date_data(
    sale_price=500000,
    representation_type="BUYER"
)
client.transaction_builder.update_price_and_date_info(transaction_id, price_data)

# Option 2: Manual construction (if you need full control)
# price_data: Dict[str, Any] = {
#     "dealType": "SALE",
#     "propertyType": "RESIDENTIAL",
#     "salePrice": {"amount": 500000, "currency": "USD"},
#     "representationType": "BUYER",
#     "listingCommission": {     # REQUIRED - cannot omit
#         "commissionPercent": 3.0,
#         "percentEnabled": True,
#         "negativeOrEmpty": False
#     },
#     "saleCommission": {        # REQUIRED - cannot omit
#         "commissionPercent": 3.0,
#         "percentEnabled": True,
#         "negativeOrEmpty": False
#     }
# }
# client.transaction_builder.update_price_and_date_info(transaction_id, price_data)

# Step 4: Add participants (use camelCase)
buyer_data: Dict[str, Any] = {
    "firstName": "John",  # Use camelCase
    "lastName": "Doe",    # Use camelCase
    "email": "john.doe@email.com",
    "phoneNumber": "(555) 123-4567"  # Use camelCase
}
client.transaction_builder.add_buyer(transaction_id, buyer_data)

# Step 5: Add co-agent (working roles only)
co_agent_data: Dict[str, Any] = {
    "agentId": "bd465129-b224-43e3-b92f-524ea5f53783",
    "role": "REAL",  # ✅ Working role
    "receivesInvoice": False
}
client.transaction_builder.add_co_agent(transaction_id, co_agent_data)

# Step 6: Submit transaction
client.transaction_builder.submit_transaction(transaction_id)
from typing import Dict, Any

from rezen import RezenClient

client: RezenClient = RezenClient()

# Create listing builder using dedicated method
listing: Dict[str, Any] = client.transaction_builder.create_listing_builder()
listing_id: str = listing["id"]

# Configure listing-specific details (use camelCase)
seller_data: Dict[str, Any] = {
    "firstName": "Jane",      # Use camelCase
    "lastName": "Smith",      # Use camelCase
    "email": "jane.smith@email.com",
    "phoneNumber": "(555) 987-6543"  # Use camelCase
}
client.transaction_builder.add_seller(listing_id, seller_data)
from typing import Dict, Any

from rezen import RezenClient

client: RezenClient = RezenClient()

# Convert a LISTING TRANSACTION to a transaction builder.
#
# IMPORTANT: This expects the listing's transaction id (often called
# `published_rezen_sale_guid` downstream), not a "listing builder id".
listing_transaction_id: str = "published_rezen_sale_guid-or-listing-transaction-id"
builder: Dict[str, Any] = client.transaction_builder.convert_listing_transaction_to_builder(
    listing_transaction_id
)
print(
    f"Converted listing transaction {listing_transaction_id} to builder {builder.get('id')}"
)

Core Transaction Management

Create Transaction Builder

Create empty transaction builder.

Starting October 12, 2026, buyer transactions must originate from a Buyer Record: use RezenClient.buyer_records.create_buyer_record followed by build_transaction. Direct LISTING creation remains supported. The direct TRANSACTION examples below describe the legacy workflow.

This is the starting point for creating a new transaction. After creation, you'll receive a transaction ID that you'll use for all subsequent operations.

⚠️ CRITICAL: Follow the recommended workflow for successful transaction creation. Many endpoints require specific data to be present before they will work.

Successful Working Example
# Complete working sequence with co-agent
client = RezenClient()

# 1. Create transaction
response = client.transaction_builder.create_transaction_builder()
transaction_id = response["id"]

# 2. Add location (with required additional fields)
location_data = {
    "street": "123 Main Street",
    "city": "Salt Lake City",
    "state": "UTAH",
    "zip": "84101",
    "county": "Salt Lake",      # REQUIRED
    "yearBuilt": 2020,         # REQUIRED
    "mlsNumber": "MLS123456"   # REQUIRED
}
client.transaction_builder.update_location_info(transaction_id, location_data)

# 3. Add price/date (with both commission objects)
price_data = {
    "dealType": "SALE",
    "propertyType": "RESIDENTIAL",
    "salePrice": {"amount": 550000, "currency": "USD"},
    "representationType": "BUYER",
    "listingCommission": {     # REQUIRED
        "commissionPercent": 3.0,
        "percentEnabled": True,
        "negativeOrEmpty": False
    },
    "saleCommission": {        # REQUIRED
        "commissionPercent": 3.0,
        "percentEnabled": True,
        "negativeOrEmpty": False
    }
}
client.transaction_builder.update_price_and_date_info(transaction_id, price_data)

# 4. Add participants
client.transaction_builder.add_buyer(transaction_id, {
    "firstName": "John",
    "lastName": "Buyer",
    "email": "john@example.com",
    "phoneNumber": "1(801) 555-1234"  # Include country code!
})

# 5. Add co-agent (this works immediately)
co_agent_info = {
    "agentId": "bd465129-b224-43e3-b92f-524ea5f53783",
    "role": "REAL",
    "receivesInvoice": False
}
client.transaction_builder.add_co_agent(transaction_id, co_agent_info)

# Result: Complete working transaction with co-agent
print(f"✅ Successfully created transaction {transaction_id} with co-agent")
Builder Types
  • "TRANSACTION": Standard real estate transaction
  • "LISTING": Property listing

Parameters:

Show table
Name Type Description Default
builder_type str

Type of builder to create ("TRANSACTION" or "LISTING")

'TRANSACTION'

Returns:

Show table
Type Description
Dict[str, Any]

Dictionary with transaction builder ID: {"id": "transaction-id"}

Raises:

Show table
Type Description
ValidationError

If builder_type is invalid

RezenError

If transaction creation fails

Consistent Response Format

The method now returns a consistent {"id": "transaction_id"} format instead of a raw string.

Create Listing Builder

Create a listing builder (wrapper for create_transaction_builder).

Returns:

Show table
Type Description
Dict[str, Any]

Dictionary with listing builder ID: {"id": "listing-id"}

Convenience Method

This is a wrapper around create_transaction_builder(builder_type='LISTING') for easier listing creation.

Convert Transaction to Builder

Convert a transaction to a transaction builder.

Parameters:

Show table
Name Type Description Default
transaction_id str

Transaction ID to create a builder from.

required

Returns:

Show table
Type Description
Dict[str, Any]

Transaction builder response data.

Convert Listing Transaction to Builder

Convert a listing transaction to a transaction builder.

A "listing transaction" is typically referenced by downstream systems as a published_rezen_sale_guid or similar identifier.

Parameters:

Show table
Name Type Description Default
listing_transaction_id str

Listing transaction ID to create a builder from.

required

Returns:

Show table
Type Description
Dict[str, Any]

Transaction builder response data.

Convert Listing to Transaction (Deprecated)

Convert a listing transaction to a transaction builder.

IMPORTANT

ReZEN's OpenAPI spec exposes only one conversion endpoint: POST /transaction-builder/{id}/transaction-to-builder.

In practice, listing "conversions" use the listing's transaction id (often called published_rezen_sale_guid in downstream systems) with that same endpoint.

Deprecated

This method name is misleading. Prefer one of: - convert_transaction_to_builder(transaction_id=...) - convert_listing_transaction_to_builder(listing_transaction_id=...)

Parameters:

Show table
Name Type Description Default
listing_id str

Listing transaction id (NOT a listing builder id).

required

Returns:

Show table
Type Description
Dict[str, Any]

Transaction builder response data

Create Different Builder Types

from typing import Dict, Any

from rezen import RezenClient

client: RezenClient = RezenClient()

# Standard transaction builder
response: Dict[str, Any] = client.transaction_builder.create_transaction_builder()
print(f"Transaction ID: {response['id']}")
# Returns: {"id": "transaction-id-here"}
from typing import Dict, Any

from rezen import RezenClient

client: RezenClient = RezenClient()

# Using dedicated listing builder method
response: Dict[str, Any] = client.transaction_builder.create_listing_builder()
print(f"Listing ID: {response['id']}")
from typing import Dict, Any

from rezen import RezenClient

client: RezenClient = RezenClient()

# Convert a LISTING TRANSACTION to a transaction builder.
listing_transaction_id = "published_rezen_sale_guid-or-listing-transaction-id"
builder: Dict[str, Any] = client.transaction_builder.convert_listing_transaction_to_builder(
    listing_transaction_id
)
print(f"New builder ID: {builder.get('id')}")

Get Transaction Builder

Get a specific transaction builder by ID.

Parameters:

Show table
Name Type Description Default
transaction_id str

Transaction builder ID

required

Returns:

Show table
Type Description
Dict[str, Any]

Transaction builder data

Response Structure

The transaction builder response includes:

  • Basic Information: ID, type, status, creation date
  • Participants: All buyers, sellers, agents, and other participants
  • Property Details: Location, pricing, and property information
  • Financial Data: Commission splits and payment information

Submit Transaction

Submit a transaction builder to create a transaction.

⚠️ CRITICAL REQUIREMENT: Commission splits MUST be populated before submission! ⚠️

The API will reject submission with error "commissionSplitsInfo cannot be empty" if commission splits are not properly configured.

🔄 COMPLETE SUBMISSION WORKFLOW:

  1. Create transaction builder
  2. Add location info (street, city, state, zip, county, yearBuilt, mlsNumber)
  3. Add price/date info with BOTH commissions and required fields:
  4. dealType: "SALE" (not "COMPENSATING")
  5. propertyType: "RESIDENTIAL"
  6. Both listingCommission and saleCommission with negativeOrEmpty: false
  7. Add buyer (required)
  8. Add seller (required - even for buyer representation!)
  9. Add owner agent (and co-agents if needed)
  10. Get transaction builder to retrieve participant IDs
  11. Add commission splits using PARTICIPANT IDs (not agent IDs!)
  12. Add commission payer (title company)
  13. Submit transaction
WORKING EXAMPLE
# After all setup steps...

# Get participant IDs
transaction = client.transaction_builder.get_transaction_builder(transaction_id)

# Find participant IDs from agents
owner_participant_id = None
for agent in transaction["agentsInfo"]["ownerAgent"]:
    if agent["agentId"] == current_user_id:
        owner_participant_id = agent["id"]
        break

# Add commission splits (REQUIRED!)
commission_splits = [{
    "participantId": owner_participant_id,
    "commission": {
        "commissionPercent": 100.0,
        "percentEnabled": True,
        "negativeOrEmpty": False
    }
}]
client.transaction_builder.update_commission_splits(
    transaction_id, commission_splits
)

# Now submit
result = client.transaction_builder.submit_transaction(transaction_id)

Parameters:

Show table
Name Type Description Default
transaction_id str

Transaction builder ID

required

Returns:

Show table
Type Description
Dict[str, Any]

Transaction preview response data with submitted transaction details

Raises:

Show table
Type Description
ValidationError

If commission splits are missing or other required fields

Submission Requirements

Before submitting, ensure:

  • At least one participant is added
  • Property location is specified
  • Required financial information is complete
  • All mandatory fields are populated

Delete Transaction Builder

Delete transaction builder.

Parameters:

Show table
Name Type Description Default
transaction_id str

Transaction builder ID

required

Returns:

Show table
Type Description
Dict[str, Any]

Deletion response data

Deletion Warning

This operation is irreversible. Ensure you have backups of any critical data before deletion.


Participant Management

Buyers

Add a new buyer.

Important: Use camelCase for field names: - firstName (not first_name) - lastName (not last_name) - phoneNumber (not phone_number)

Phone Number Format: - MUST include country code (1 for US) - Format: "1(xxx) xxx-xxxx" or "+1-xxx-xxx-xxxx" - Examples: "1(801) 555-0123", "+1-801-555-0123"

Example

buyer_info = { "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com", "phoneNumber": "1(555) 123-4567" # Include country code! }

Parameters:

Show table
Name Type Description Default
transaction_id str

Transaction builder ID

required
buyer_info Dict[str, Any]

Buyer information data with camelCase fields

required

Returns:

Show table
Type Description
Dict[str, Any]

Transaction builder response data

Required Buyer Fields:

Show table
Field Type Description
firstName str Buyer's first name (camelCase)
lastName str Buyer's last name (camelCase)
email str Valid email address
phoneNumber str Phone number with country code (camelCase)
company str Company name
address str Mailing address

Phone Number Formatting

All phone numbers MUST include the country code (1 for US):

  • ✅ Good: "1(801) 555-1234", "+1-801-555-1234", "1-801-555-1234"
  • ❌ Bad: "(801) 555-1234", "801-555-1234", "555-1234"

The API requires phone numbers to start with the country code for proper validation.

Complete Buyer Example

from typing import Dict, Any

from rezen import RezenClient

client: RezenClient = RezenClient()
transaction_id: str = "your-transaction-id-here"

buyer_data: Dict[str, Any] = {
    "firstName": "John",  # Use camelCase
    "lastName": "Doe",  # Use camelCase
    "email": "john.doe@email.com",
    "phoneNumber": "+1-555-123-4567",  # Use camelCase
    "company": "Doe Enterprises",
    "address": "456 Business Ave, Business City, BC 12345"
}

# Using new method name
response: Dict[str, Any] = client.transaction_builder.add_buyer(transaction_id, buyer_data)

# Or using backward compatibility alias
response: Dict[str, Any] = client.transaction_builder.put_buyer_to_draft(transaction_id, buyer_data)

Sellers

Add a new seller to a transaction builder.

Important: Use camelCase for field names: - firstName (not first_name) - lastName (not last_name) - phoneNumber (not phone_number)

Phone Number Format: - MUST include country code (1 for US) - Format: "1(xxx) xxx-xxxx" or "+1-xxx-xxx-xxxx" - Examples: "1(801) 555-9876", "+1-801-555-9876"

Example

seller_info = { "firstName": "Jane", "lastName": "Smith", "email": "jane.smith@example.com", "phoneNumber": "1(555) 987-6543" # Include country code! }

Parameters:

Show table
Name Type Description Default
transaction_id str

Transaction builder ID

required
seller_info Dict[str, Any]

Seller information data with camelCase fields

required

Returns:

Show table
Type Description
Dict[str, Any]

Transaction builder response data

Seller Configuration

from typing import Dict, Any

from rezen import RezenClient

client: RezenClient = RezenClient()
transaction_id: str = "your-transaction-id-here"

seller_data: Dict[str, Any] = {
    "firstName": "Jane",  # Use camelCase
    "lastName": "Smith",  # Use camelCase
    "email": "jane.smith@email.com",
    "phoneNumber": "+1-555-987-6543"  # Use camelCase
}

# Using new method name
response: Dict[str, Any] = client.transaction_builder.add_seller(transaction_id, seller_data)

# Or using backward compatibility alias
response: Dict[str, Any] = client.transaction_builder.put_seller_to_draft(transaction_id, seller_data)

Agents & Co-Agents

Add a new co-agent to the transaction.

Co-agents can be added at any time after transaction creation, unlike owner agents which require a specific sequence. The co-agent will appear in the transaction's agentsInfo.coAgents array.

⚠️ ROLE LIMITATIONS ⚠️ Based on testing, only certain roles work with co-agents:

✅ WORKING ROLES: - "REAL" - Always works (may display differently based on representationType) - "BUYERS_AGENT" - Works on transactions with location data - "SELLERS_AGENT" - Works on transactions with location data

❌ NON-WORKING ROLES: - "LISTING_AGENT" - Fails with "Bad request: Invalid request"

Required Fields
  • agentId (str): UUID of the co-agent (must be a valid agent ID)
  • role (str): Agent role - use one of the working roles above
  • receivesInvoice (bool): Whether the co-agent receives invoice
Optional Fields
  • opCityReferral (bool): Whether this is an OpCity referral (default: False)
  • optedInForEcp (bool): Whether opted in for ECP (default: False)
Note on Role Display

The role field accepts "REAL" but may be displayed differently in the response based on the transaction's representationType. For example, if representationType is "BUYER", a co-agent with role "REAL" may appear as "BUYERS_AGENT" in the response.

Working Examples
# ✅ Co-agent with REAL role (always works)
co_agent_info = {
    "agentId": "bd465129-b224-43e3-b92f-524ea5f53783",
    "role": "REAL",
    "receivesInvoice": False,
    "opCityReferral": False,
    "optedInForEcp": False
}
result = client.add_co_agent(transaction_id, co_agent_info)

# ✅ Co-agent with BUYERS_AGENT role (works with location data)
co_agent_info = {
    "agentId": "bd465129-b224-43e3-b92f-524ea5f53783",
    "role": "BUYERS_AGENT",
    "receivesInvoice": False
}
result = client.add_co_agent(transaction_id, co_agent_info)

# ❌ This FAILS (LISTING_AGENT role not supported)
co_agent_info = {
    "agentId": "bd465129-b224-43e3-b92f-524ea5f53783",
    "role": "LISTING_AGENT",  # This role fails
    "receivesInvoice": False
}
# Will return "Bad request: Invalid request"

Parameters:

Show table
Name Type Description Default
transaction_id str

Transaction builder ID

required
co_agent_info Dict[str, Any]

Co-agent information data

required

Returns:

Show table
Type Description
Dict[str, Any]

Transaction builder response data with updated co-agents list

Raises:

Show table
Type Description
ValidationError

If role is not supported or agent ID is invalid

Agent Roles:

Available Agent Roles

  • BUYERS_AGENT: Represents the buyer
  • SELLERS_AGENT: Represents the seller
  • LISTING_AGENT: Lists the property
  • DUAL_AGENT: Represents both parties

Co-Agent Examples

from typing import Dict, Any

from rezen import RezenClient

client: RezenClient = RezenClient()
transaction_id: str = "your-transaction-id-here"

co_agent_data: Dict[str, Any] = {
    "agent_id": "agent-uuid-here",
    "role": "BUYERS_AGENT"
}
client.transaction_builder.add_co_agent(transaction_id, co_agent_data)
from typing import Dict, Any

from rezen import RezenClient

client: RezenClient = RezenClient()
transaction_id: str = "your-transaction-id-here"

co_agent_data: Dict[str, Any] = {
    "agent_id": "seller-agent-uuid",
    "role": "SELLERS_AGENT"
}
client.transaction_builder.add_co_agent(transaction_id, co_agent_data)

Owner Agents

Update owner agent information for the transaction.

✅ WORKING SOLUTION ✅ This method now works correctly when called in the proper sequence.

🔄 REQUIRED SEQUENCE: 1. Create transaction (create_transaction_builder) 2. Add location info with ALL required fields (update_location_info) 3. Add price/date info with commission objects (update_price_and_date_info) 4. Add buyers/sellers (add_buyer/add_seller) 5. THEN add owner agent (this method) - ✅ WORKS!

📋 COMPLETE DATA REQUIREMENTS:

Location Info Must Include
  • street, city, state, zip (basic)
  • county: Required additional field
  • yearBuilt: Required additional field
  • mlsNumber: Required additional field

Price/Date Info Must Include: - dealType, propertyType, salePrice, representationType (basic) - listingCommission: Required commission object - saleCommission: Required commission object

Owner Agent Data Structure

owner_agent_info = { "ownerAgent": { "agentId": str, # User ID (same as agent ID in ReZEN) "role": str # "BUYERS_AGENT" or "SELLERS_AGENT" }, "officeId": str, # From user.offices[0].id "teamId": str # UUID of the team }

🎯 GETTING THE RIGHT IDS: - agentId: Use current user's ID (user["id"] from get_current_user()) - officeId: Use user["offices"][0]["id"] from get_current_user() - teamId: Use the team ID returned by get_user_teams_and_offices()

Role Matching

The role MUST match the representationType from price/date info: - representationType: "BUYER" → role: "BUYERS_AGENT" - representationType: "SELLER" → role: "SELLERS_AGENT"

💡 TIP: Use convenience methods instead of manual setup: - set_current_user_as_owner_agent() for default team - set_current_user_as_owner_agent_with_team() for specific team

Example - Complete Working Sequence
# 1. Create transaction
builder_id = client.transaction_builder.create_transaction_builder()

# 2. Add location with ALL required fields (REQUIRED FIRST)
client.transaction_builder.update_location_info(builder_id, {
    "street": "123 Main St",
    "city": "Salt Lake City",
    "state": "UTAH",
    "zip": "84101",
    "county": "Salt Lake",        # REQUIRED
    "yearBuilt": 2020,           # REQUIRED
    "mlsNumber": "MLS-123456"    # REQUIRED
})

# 3. Add price/date with commission objects (REQUIRED SECOND)
client.transaction_builder.update_price_and_date_info(builder_id, {
    "dealType": "SALE",
    "propertyType": "RESIDENTIAL",
    "salePrice": {"amount": 500000, "currency": "USD"},
    "representationType": "BUYER",
    "listingCommission": {       # REQUIRED
        "commissionPercent": 3.0,
        "percentEnabled": True,
        "negativeOrEmpty": False
    },
    "saleCommission": {          # REQUIRED
        "commissionPercent": 3.0,
        "percentEnabled": True,
        "negativeOrEmpty": False
    }
})

# 4. Add buyer (REQUIRED THIRD)
client.transaction_builder.add_buyer(builder_id, {
    "firstName": "John",
    "lastName": "Buyer",
    "email": "john@example.com",
    "phoneNumber": "1(801) 555-1234"  # Include country code!
})

# 5. Get user and office info
user = client.users.get_current_user()

# 6. NOW add owner agent (WORKS!)
owner_info = {
    "ownerAgent": {
        "agentId": user["id"],          # User ID = Agent ID
        "role": "BUYERS_AGENT"          # Must match representationType
    },
    "officeId": user["offices"][0]["id"],  # From user's offices
    "teamId": "your-team-uuid"              # Your team ID
}
result = client.transaction_builder.update_owner_agent_info(builder_id, owner_info)

Parameters:

Show table
Name Type Description Default
transaction_builder_id str

UUID of the transaction builder

required
owner_agent_info Dict[str, Any]

Dictionary containing owner agent details

required

Returns:

Show table
Type Description
Dict[str, Any]

Updated transaction builder data

Raises:

Show table
Type Description
ValidationError

If owner agent info is invalid or sequence not followed

NotFoundError

If transaction builder not found

Multiple Teams Support

✅ New Feature: Multiple Teams Support

Many ReZEN users belong to multiple teams. These convenience methods help handle team selection automatically:

Get current user's teams and offices with smart default selection.

✅ WORKING METHOD - Handles multiple team scenarios automatically.

This method helps handle users who belong to multiple teams by: 1. Fetching all teams the user belongs to 2. Determining a smart default team (prefers LEADER role over ADMIN) 3. Extracting office information from user profile 4. Providing clear guidance on team selection

🎯 SMART DEFAULT LOGIC: - If user has LEADER role in any team → that team becomes default - If user only has ADMIN roles → first ADMIN team becomes default - If user has only one team → that team becomes default

💡 USE CASES: - Check if user needs team selection before transaction creation - Get default team for automatic owner agent setup - Display available teams for user selection

Parameters:

Show table
Name Type Description Default
users_client Optional[Any]

Optional users client instance (uses parent client if None)

None

Returns:

Show table
Type Description
Dict[str, Any]

Dictionary containing:

Dict[str, Any]
  • user: Full user profile data with offices array
Dict[str, Any]
  • teams: List of teams user belongs to with roles
Dict[str, Any]
  • offices: List of offices user belongs to
Dict[str, Any]
  • default_team: Recommended team (smart selection)
Dict[str, Any]
  • has_multiple_teams: Boolean indicating if user has multiple teams
Dict[str, Any]
  • team_selection_needed: Boolean indicating if explicit selection recommended
Dict[str, Any]
  • agent_id: User's agent ID (same as user ID)
Dict[str, Any]
  • office_id: Primary office ID from user.offices[0].id
Example
info = client.transaction_builder.get_user_teams_and_offices()

print(f"Agent ID: {info['agent_id']}")
print(f"Office ID: {info['office_id']}")

if info["has_multiple_teams"]:
    print("\nAvailable teams:")
    for team in info["teams"]:
        role = team["role"]
        name = team["name"]
        is_default = team["id"] == info["default_team"]["id"]
        marker = " (DEFAULT)" if is_default else ""
        print(f"  - {name} (Role: {role}){marker}")

    # Use default team or let user choose
    selected_team = info["default_team"]
    print(f"\nUsing default team: {selected_team['name']}")
else:
    print(f"Single team: {info['default_team']['name']}")

# Ready-to-use IDs for transaction setup
team_id = info["default_team"]["id"]
office_id = info["office_id"]
agent_id = info["agent_id"]
Team Data Structure

Each team in the teams list contains: - id: Team UUID - name: Team name - role: User's role in the team ("LEADER", "ADMIN", etc.)

Raises:

Show table
Type Description
APIError

If user data cannot be retrieved

ValueError

If user has no offices (required for transactions)

Smart Default Logic: - Prefers teams where you have LEADER role - Falls back to ADMIN teams - Uses first available team as last resort

Set the current authenticated user as the owner agent with default team.

✅ WORKING CONVENIENCE METHOD

⚠️ MULTIPLE TEAMS WARNING ⚠️ If you belong to multiple teams, this method will use your DEFAULT team (prefers LEADER role). To specify a particular team, use set_current_user_as_owner_agent_with_team() instead.

This is a convenience method that automatically: 1. Gets current user information (user ID and office ID) 2. Determines default team using smart logic 3. Sets up owner agent with all required fields

🎯 SMART DEFAULT TEAM LOGIC: - Prefers teams where you have LEADER role - Falls back to teams where you have ADMIN role - Uses first available team as last resort

Parameters:

Show table
Name Type Description Default
transaction_builder_id str

UUID of the transaction builder

required
role str

Agent role ("BUYERS_AGENT" or "SELLERS_AGENT")

required
users_client Optional[Any]

Optional UsersClient instance. If None, will create one.

None

Returns:

Show table
Type Description
Dict[str, Any]

Updated transaction builder data

Raises:

Show table
Type Description
ValidationError

If owner agent info is invalid or user has no teams

NotFoundError

If transaction builder not found

AuthenticationError

If not authenticated

ValueError

If user has no offices

Example
# Simple case - uses default team automatically
result = client.transaction_builder.set_current_user_as_owner_agent(
    builder_id,
    "BUYERS_AGENT"
)

# For multiple teams - check first, then choose approach
teams_info = client.transaction_builder.get_user_teams_and_offices()

if teams_info["has_multiple_teams"]:
    print(f"You have {len(teams_info['teams'])} teams.")
    print(f"Will use default: {teams_info['default_team']['name']}")

    # Option 1: Use this method with default team
    result = client.transaction_builder.set_current_user_as_owner_agent(
        builder_id, "BUYERS_AGENT"
    )

    # Option 2: Specify team explicitly
    # result = client.transaction_builder.set_current_user_as_owner_agent_with_team(
    #     builder_id, "BUYERS_AGENT", teams_info["teams"][1]["id"]
    # )
else:
    # Single team - use this convenience method
    result = client.transaction_builder.set_current_user_as_owner_agent(
        builder_id, "BUYERS_AGENT"
    )

Best for: Users with single team or who want automatic team selection.

Set current user as owner agent with explicit team selection.

✅ WORKING CONVENIENCE METHOD

This method allows users to specify which team to use when they belong to multiple teams. This gives full control over team selection and is recommended when you need to be explicit about which team to use.

🎯 PERFECT FOR: - Users who belong to multiple teams - When you need specific team for business reasons - Programmatic team selection based on criteria

This method automatically: 1. Gets current user information (user ID and office ID) 2. Validates the user belongs to the specified team 3. Sets up owner agent with all required fields

Parameters:

Show table
Name Type Description Default
transaction_builder_id str

UUID of the transaction builder

required
role str

Agent role ("BUYERS_AGENT" or "SELLERS_AGENT")

required
team_id str

Specific team ID to use for the transaction

required
users_client Optional[Any]

Optional UsersClient instance. If None, will create one.

None

Returns:

Show table
Type Description
Dict[str, Any]

Updated transaction builder data

Raises:

Show table
Type Description
ValidationError

If user is not a member of the specified team

ValidationError

If team_id is invalid

NotFoundError

If transaction builder not found

AuthenticationError

If not authenticated

ValueError

If user has no offices

Example
# Option 1: Get available teams and choose
teams_info = client.transaction_builder.get_user_teams_and_offices()

if teams_info["has_multiple_teams"]:
    print("Available teams:")
    for team in teams_info["teams"]:
        print(f"  {team['name']} (ID: {team['id']}, Role: {team['role']})")

    # Choose a specific team (e.g., select LEADER team)
    leader_teams = [t for t in teams_info["teams"] if t["role"] == "LEADER"]
    selected_team_id = leader_teams[0]["id"] if leader_teams else teams_info["teams"][0]["id"]
else:
    selected_team_id = teams_info["default_team"]["id"]

# Set owner agent with specific team
result = client.transaction_builder.set_current_user_as_owner_agent_with_team(
    builder_id,
    role="BUYERS_AGENT",
    team_id=selected_team_id
)

# Option 2: Direct usage if you know the team ID
result = client.transaction_builder.set_current_user_as_owner_agent_with_team(
    builder_id,
    role="SELLERS_AGENT",
    team_id="12345678-1234-1234-1234-123456789012"
)

Best for: Users with multiple teams who need explicit control.

Prerequisites Required

CRITICAL: The owner agent endpoint requires the transaction to be properly set up BEFORE adding agents:

  1. Location info must be added first (update_location_info)
  2. Price and date info must be added second (update_price_and_date_info)
  3. Buyers/Sellers must be added third (add_buyer/add_seller)
  4. THEN owner agent can be added successfully

Owner Data Structure:

{
    "ownerAgent": {
        "agentId": "agent_uuid",
        "role": "BUYERS_AGENT"  # or "SELLERS_AGENT"
    },
    "officeId": "office_uuid", 
    "teamId": "team_uuid"
}

Multiple Teams Support

New in ReZEN: If you belong to multiple teams, use the enhanced methods:

  • get_user_teams_and_offices() - Discover available teams
  • set_current_user_as_owner_agent_with_team() - Specify exact team

See Multiple Teams Guide for details.

Complete Working Example

from typing import Dict, Any

from rezen import RezenClient

client: RezenClient = RezenClient()

# Step 1: Create transaction
builder_id = client.transaction_builder.create_transaction_builder()

# Step 2: Add location (REQUIRED FIRST)
location_data: Dict[str, Any] = {
    "street": "123 Main St",
    "city": "Salt Lake City", 
    "state": "UTAH",
    "zip": "84101"
}
client.transaction_builder.update_location_info(builder_id, location_data)

# Step 3: Add price/date info (REQUIRED SECOND)
price_data: Dict[str, Any] = {
    "dealType": "SALE",
    "propertyType": "RESIDENTIAL", 
    "salePrice": {"amount": 500000, "currency": "USD"},
    "representationType": "BUYER"  # Must match agent role
}
client.transaction_builder.update_price_and_date_info(builder_id, price_data)

# Step 4: Add clients (REQUIRED THIRD)
client.transaction_builder.add_buyer(builder_id, {
    "firstName": "John",
    "lastName": "Doe",
    "email": "john@example.com",
    "phoneNumber": "1(801) 555-1234"  # Include country code!
})

# Step 5: NOW add owner agent (will work!)
owner_data: Dict[str, Any] = {
    "ownerAgent": {
        "agentId": "your_agent_id",
        "role": "BUYERS_AGENT"  # Must match representationType
    },
    "officeId": "your_office_id",
    "teamId": "your_team_id"
}
client.transaction_builder.update_owner_agent_info(builder_id, owner_data)
from typing import Dict, Any

from rezen import RezenClient

client: RezenClient = RezenClient()

# Set up transaction (same steps 1-4 as above)
builder_id = client.transaction_builder.create_transaction_builder()
# ... add location, price, and clients ...

# Use convenience method for current user
client.transaction_builder.set_current_user_as_owner_agent(
    builder_id, 
    role="BUYERS_AGENT"
)

Role Matching

The role in ownerAgent must match the representationType in the price/date info:

  • representationType: "BUYER" → role: "BUYERS_AGENT"
  • representationType: "SELLER" → role: "SELLERS_AGENT"

Other Participants

Add a new participant to the transaction builder.

Parameters:

Show table
Name Type Description Default
transaction_id str

Transaction builder ID

required
participant_info Dict[str, Any]

Participant information data

required

Returns:

Show table
Type Description
Dict[str, Any]

Transaction builder response data

Multipart form-data

This endpoint uses multipart/form-data. The client automatically sends all provided key/value pairs as form fields and sets the correct X-API-KEY authentication header. Provide a plain dict like { "role": "OTHER_AGENT", "firstName": "Joshua", ... }.

Participant Types:

Show table
Type Description
INSPECTOR Property inspector
APPRAISER Property appraiser
LENDER Mortgage lender
TITLE_COMPANY Title company representative
ATTORNEY Legal counsel
CONTRACTOR Contractor or repair specialist

Service Provider Examples

from typing import Dict, Any

from rezen import RezenClient

client: RezenClient = RezenClient()
transaction_id: str = "your-transaction-id-here"

inspector_data: Dict[str, Any] = {
    "type": "INSPECTOR",
    "firstName": "Mike",  # Use camelCase
    "lastName": "Inspector",  # Use camelCase
    "company": "Quality Inspections Inc",
    "phoneNumber": "+1-555-INSPECT",  # Use camelCase
    "email": "mike@qualityinspections.com"
}
client.transaction_builder.add_participant(transaction_id, inspector_data)
from typing import Dict, Any

from rezen import RezenClient

client: RezenClient = RezenClient()
transaction_id: str = "your-transaction-id-here"

lender_data: Dict[str, Any] = {
    "type": "LENDER",
    "firstName": "Sarah",  # Use camelCase
    "lastName": "Banker",  # Use camelCase
    "company": "First National Bank",
    "phoneNumber": "+1-555-LOANS",  # Use camelCase
    "email": "sarah.banker@firstnational.com"
}
client.transaction_builder.add_participant(transaction_id, lender_data)

Property & Location Details

Location Information

Update location information.

⚠️ CRITICAL REQUIREMENT ⚠️ Basic address fields alone (street, city, state, zip) will FAIL. The API requires additional property details for successful location updates.

REQUIRED ADDITIONAL FIELDS (beyond basic address): - county (str): County name (e.g., "Salt Lake") - yearBuilt (int): Year the property was built (e.g., 2020) - mlsNumber (str): MLS listing number (e.g., "MLS123456")

Field Name Requirements
  • Use 'street' not 'address'
  • Use 'zip' not 'zipCode' or 'zip_code'
  • State must be ALL CAPS (e.g., 'UTAH', 'CALIFORNIA')
  • Use camelCase for: yearBuilt, mlsNumber, escrowNumber
Required Fields for Success
  • street (str): Property street address
  • city (str): City name
  • state (str): State name in ALL CAPS
  • zip (str): ZIP code
  • county (str): County name - REQUIRED
  • yearBuilt (int): Year built - REQUIRED
  • mlsNumber (str): MLS number - REQUIRED
Optional Fields
  • street2 (str): Secondary address line
  • unit (str): Unit number
  • escrowNumber (str): Escrow number
Working Example
# ✅ This WORKS (includes required additional fields)
location_info = {
    "street": "123 Main Street",
    "city": "Salt Lake City",
    "state": "UTAH",
    "zip": "84101",
    "county": "Salt Lake",        # REQUIRED
    "yearBuilt": 2020,           # REQUIRED
    "mlsNumber": "MLS123456",    # REQUIRED
    "escrowNumber": "ESC-2024-001"  # Optional
}

# ❌ This FAILS (missing required additional fields)
location_info = {
    "street": "123 Main Street",
    "city": "Salt Lake City",
    "state": "UTAH",
    "zip": "84101"
    # Missing county, yearBuilt, mlsNumber - API returns "Bad request: Invalid request"
}

Parameters:

Show table
Name Type Description Default
transaction_id str

Transaction builder ID

required
location_info Dict[str, Any]

Location information data with ALL required fields

required

Returns:

Show table
Type Description
Dict[str, Any]

Transaction builder response data

Raises:

Show table
Type Description
InvalidFieldNameError

If using wrong field names (address, zipCode, etc.)

InvalidFieldValueError

If state is not in ALL CAPS

ValidationError

If missing required additional fields

Backward Compatibility

You can also use put_location_to_draft() which is an alias for update_location_info().

Property Location Examples

from typing import Dict, Any

from rezen import RezenClient

client: RezenClient = RezenClient()
transaction_id: str = "your-transaction-id-here"

location_data: Dict[str, Any] = {
    "street": "123 Maple Street",  # Use 'street' not 'address'
    "street2": "",
    "city": "Springfield",
    "state": "UTAH",  # Must be UTAH (all caps)
    "zip": "84101",  # Use 'zip' not 'zipCode'
    "county": "Salt Lake",
    "unit": "Unit 2A",  # For condos/apartments
    "subdivision": "Maple Grove",
    "yearBuilt": 2020,  # Use camelCase
    "mlsNumber": "MLS123",  # Use camelCase
    "escrowNumber": ""
}

# Using new method name
client.transaction_builder.update_location_info(transaction_id, location_data)

# Or using backward compatibility alias
client.transaction_builder.put_location_to_draft(transaction_id, location_data)
from typing import Dict, Any

from rezen import RezenClient

client: RezenClient = RezenClient()
transaction_id: str = "your-transaction-id-here"

location_data: Dict[str, Any] = {
    "street": "456 Business Blvd",  # Use 'street' not 'address'
    "street2": "",
    "city": "Commerce City",
    "state": "UTAH",  # Must be UTAH (all caps)
    "zip": "84111",  # Use 'zip' not 'zipCode'
    "county": "Salt Lake",
    "yearBuilt": 2018,
    "mlsNumber": "COM456",
    "escrowNumber": "",
    "building_name": "Commerce Center",
    "floor": "15th Floor"
}
client.transaction_builder.update_location_info(transaction_id, location_data)

Pricing & Dates

Update price and date information.

⚠️ CRITICAL REQUIREMENT ⚠️ Basic price/date fields alone will FAIL with "Bad request: Invalid request". The API requires BOTH commission objects for successful price/date updates.

REQUIRED COMMISSION FIELDS

Both listingCommission AND saleCommission objects are REQUIRED together. You cannot provide just one - the API needs both.

Field Structure Requirements
  • salePrice MUST be an object with 'amount' and 'currency', NOT a simple number
  • All dates use camelCase format: acceptanceDate, closingDate, etc.
  • representationType determines valid agent roles (BUYER → BUYERS_AGENT, SELLER → SELLERS_AGENT)
Required Fields for Success
  • dealType (str): Deal type - use "SALE" for standard transactions
    • "SALE": Standard sale transaction (recommended)
    • "COMPENSATING": May cause 500 errors on submission (deprecated)
    • "NON_COMPENSATING": May cause 500 errors on submission (deprecated)
  • propertyType (str): "RESIDENTIAL", "COMMERCIAL", etc.
  • salePrice (dict): {"amount": 500000, "currency": "USD"}
  • representationType (str): "BUYER" or "SELLER" - affects owner agent role
  • listingCommission (dict): Commission object - REQUIRED
  • saleCommission (dict): Commission object - REQUIRED
Optional Fields
  • acceptanceDate (str): Date in "YYYY-MM-DD" format
  • closingDate (str): Date in "YYYY-MM-DD" format
  • earnestMoney (float): Earnest money amount
  • downPayment (float): Down payment amount
  • loanAmount (float): Loan amount
Working Example
# ✅ This WORKS (includes both required commission objects)
price_date_info = {
    "dealType": "SALE",
    "propertyType": "RESIDENTIAL",
    "salePrice": {
        "amount": 565000,
        "currency": "USD"
    },
    "representationType": "BUYER",
    "listingCommission": {       # REQUIRED
        "commissionPercent": 3.0,
        "percentEnabled": True,
        "negativeOrEmpty": False
    },
    "saleCommission": {          # REQUIRED
        "commissionPercent": 3.0,
        "percentEnabled": True,
        "negativeOrEmpty": False
    },
    "acceptanceDate": "2024-01-15",
    "closingDate": "2024-02-28"
}

# ❌ This FAILS (missing commission objects)
price_date_info = {
    "dealType": "SALE",
    "propertyType": "RESIDENTIAL",
    "salePrice": {"amount": 500000, "currency": "USD"},
    "representationType": "BUYER"
    # Missing both commission objects - API returns "Bad request: Invalid request"
}

# ❌ This ALSO FAILS (only one commission object)
price_date_info = {
    "dealType": "SALE",
    "propertyType": "RESIDENTIAL",
    "salePrice": {"amount": 500000, "currency": "USD"},
    "representationType": "BUYER",
    "listingCommission": {       # Only one commission
        "commissionPercent": 3.0,
        "percentEnabled": True,
        "negativeOrEmpty": False
    }
    # Missing saleCommission - API still returns "Bad request: Invalid request"
}

Parameters:

Show table
Name Type Description Default
transaction_id str

Transaction builder ID

required
price_date_info Dict[str, Any]

Price and date information data with BOTH commission objects

required

Returns:

Show table
Type Description
Dict[str, Any]

Transaction builder response data

Raises:

Show table
Type Description
ValidationError

If missing required fields or commission objects

InvalidFieldValueError

If salePrice format is incorrect or representationType invalid

Backward Compatibility

You can also use put_price_and_date_to_draft() which is an alias for update_price_and_date_info().

Key Date Fields:

Show table
Field Format Description
contractDate YYYY-MM-DD Date contract was signed (camelCase)
closingDate YYYY-MM-DD Expected closing date (camelCase)
inspectionDate YYYY-MM-DD Property inspection date (camelCase)
appraisalDate YYYY-MM-DD Appraisal completion date (camelCase)
acceptanceDate YYYY-MM-DD Offer acceptance date (camelCase)

Pricing Information

from typing import Dict, Any

from rezen import RezenClient

client: RezenClient = RezenClient()
transaction_id: str = "your-transaction-id-here"

price_date_data: Dict[str, Any] = {
    "salePrice": {  # Use camelCase and object structure
        "amount": 750000,
        "currency": "USD"
    },
    "earnestMoney": 15000,  # Use camelCase
    "downPayment": 150000,  # Use camelCase
    "loanAmount": 600000,  # Use camelCase
    "contractDate": "2024-02-01",  # Use camelCase
    "closingDate": "2024-03-15",  # Use camelCase
    "inspectionDate": "2024-02-10",  # Use camelCase
    "appraisalDate": "2024-02-20"  # Use camelCase
}

client.transaction_builder.update_price_and_date_info(
    transaction_id,
    price_date_data
)

⚠️ Critical: Updating Dates on Existing Transactions

When adding or updating dates (acceptanceDate, closingDate) on a transaction that already has pricing information, you CANNOT send just the date fields. The API requires the complete price/date structure for any update to this endpoint.

❌ THIS FAILS:

# Trying to add just dates to existing transaction
date_update = {
    "acceptanceDate": "2025-06-16",
    "closingDate": "2025-07-16"
}
client.transaction_builder.update_price_and_date_info(transaction_id, date_update)
# Returns: "Missing required fields: dealType, propertyType, salePrice, representationType, listingCommission, saleCommission..."

✅ THIS WORKS:

# Must include ALL price/date fields, even if just updating dates
price_date_update = {
    "dealType": "SALE",
    "propertyType": "RESIDENTIAL",
    "salePrice": {"amount": 500000, "currency": "USD"},
    "representationType": "BUYER",
    "listingCommission": {           # REQUIRED even for date updates
        "commissionPercent": 3.0,
        "percentEnabled": True,
        "negativeOrEmpty": False
    },
    "saleCommission": {              # REQUIRED even for date updates
        "commissionPercent": 3.0,
        "percentEnabled": True,
        "negativeOrEmpty": False
    },
    "acceptanceDate": "2025-06-16",  # New date
    "closingDate": "2025-07-16"      # New date
}
client.transaction_builder.update_price_and_date_info(transaction_id, price_date_update)

💡 Tip: If you need to update dates on an existing transaction, first retrieve the current price/date info, then update the date fields while keeping all other required fields intact.

Helper Method: prepare_price_and_date_data

To simplify creating properly formatted price/date data with all required fields, use the prepare_price_and_date_data helper method:

Prepare price and date data with required commission objects.

This helper method ensures all required fields are included with proper formatting, particularly the commission objects that must always be present with the critical negativeOrEmpty field set to false.

⚠️ CRITICAL FIELDS ⚠️ Both commission objects MUST include negativeOrEmpty: false or submission will fail!

Parameters:

Show table
Name Type Description Default
sale_price Union[int, float]

The sale price amount

required
representation_type str

"BUYER" or "SELLER"

required
listing_commission_percent float

Listing commission percentage (default: 3.0)

3.0
sale_commission_percent float

Sale commission percentage (default: 3.0)

3.0
deal_type str

Deal type (default: "SALE", NOT "COMPENSATING"!)

'SALE'
property_type str

Property type (default: "RESIDENTIAL")

'RESIDENTIAL'
acceptance_date Optional[str]

Acceptance date in "YYYY-MM-DD" format

None
closing_date Optional[str]

Closing date in "YYYY-MM-DD" format

None
earnest_money Optional[float]

Earnest money amount

None
down_payment Optional[float]

Down payment amount

None
loan_amount Optional[float]

Loan amount

None

Returns:

Show table
Type Description
Dict[str, Any]

Dict with properly formatted price/date data including both commission objects

Dict[str, Any]

with all required fields including negativeOrEmpty: false

Example
# Simple usage with defaults
price_data = client.prepare_price_and_date_data(
    sale_price=500000,
    representation_type="BUYER",
    acceptance_date="2024-06-16",
    closing_date="2024-07-16"
)
# This will include:
# - dealType: "SALE" (not "COMPENSATING")
# - propertyType: "RESIDENTIAL"
# - Both commissions with negativeOrEmpty: false

result = client.update_price_and_date_info(transaction_id, price_data)

Benefits of Using the Helper

  • ✅ Automatically includes both commission objects with negativeOrEmpty: false
  • ✅ Properly formats the sale price as an object with amount and currency
  • ✅ Ensures all required fields are present
  • ✅ Provides sensible defaults for commission percentages (3%)
  • ✅ Optional fields are only included when provided

Using the Helper Method

from rezen import RezenClient

client = RezenClient()
transaction_id = "your-transaction-id"

# Simple usage with defaults
price_data = client.transaction_builder.prepare_price_and_date_data(
    sale_price=500000,
    representation_type="BUYER",
    acceptance_date="2024-06-16",
    closing_date="2024-07-16"
)

# Update the transaction
result = client.transaction_builder.update_price_and_date_info(transaction_id, price_data)
# Custom commission percentages
price_data = client.transaction_builder.prepare_price_and_date_data(
    sale_price=750000,
    representation_type="SELLER",
    listing_commission_percent=2.5,  # Custom 2.5%
    sale_commission_percent=2.5,     # Custom 2.5%
    acceptance_date="2024-06-16",
    closing_date="2024-07-16"
)

result = client.transaction_builder.update_price_and_date_info(transaction_id, price_data)
# All optional fields included
price_data = client.transaction_builder.prepare_price_and_date_data(
    sale_price=1000000,
    representation_type="BUYER",
    listing_commission_percent=2.75,
    sale_commission_percent=2.75,
    deal_type="SALE",               # Default is "SALE"
    property_type="COMMERCIAL",     # Default is "RESIDENTIAL"
    acceptance_date="2024-06-16",
    closing_date="2024-07-16",
    earnest_money=25000,
    down_payment=200000,
    loan_amount=800000
)

result = client.transaction_builder.update_price_and_date_info(transaction_id, price_data)

💡 Tip: This helper method is especially useful when you need to update dates on an existing transaction, as it ensures all required fields are included.

Title Information

Update title details for a transaction builder.

Important: Use camelCase for field names: - firstName (not first_name) - lastName (not last_name) - phoneNumber (not phone_number)

Example

title_info = { "company": "Premier Title Company", "firstName": "Sarah", "lastName": "Johnson", "email": "sarah@premiertitle.com", "phoneNumber": "(555) 555-5555" }

Parameters:

Show table
Name Type Description Default
transaction_id str

Transaction builder ID

required
title_info Dict[str, Any]

Title information data with camelCase fields

required

Returns:

Show table
Type Description
Dict[str, Any]

Transaction builder response data

Update Real Title

Update real title (alias for update_title_info).

Parameters:

Show table
Name Type Description Default
transaction_id str

Transaction builder ID

required
title_info Dict[str, Any]

Title information data

required

Returns:

Show table
Type Description
Dict[str, Any]

Transaction builder response data

Alias Method

This is an alias for update_title_info() provided for backward compatibility.

Title Company Details

from typing import Dict, Any

from rezen import RezenClient

client: RezenClient = RezenClient()
transaction_id: str = "your-transaction-id-here"

title_data: Dict[str, Any] = {
    "company": "Premier Title Co",  # Use 'company' not 'title_company'
    "firstName": "Sarah",  # Use camelCase
    "lastName": "Johnson",  # Use camelCase
    "phoneNumber": "+1-555-789-0123",  # Use camelCase
    "email": "sarah@premiertitle.com",
    "address": "789 Title Lane, Title City, TC 54321",
    "policyNumber": "PT-2024-001234"  # Use camelCase
}

# Using either method works the same
client.transaction_builder.update_title_info(transaction_id, title_data)
# or
client.transaction_builder.update_real_title(transaction_id, title_data)

Personal Deal Information

Update personal deal information.

Sets whether this transaction is a personal deal (agent buying/selling own property).

Required Fields
  • isPersonalDeal (bool): Whether this is a personal deal
Example
deal_info = {
    "isPersonalDeal": True  # Agent is buying/selling their own property
}
client.update_personal_deal_info(transaction_id, deal_info)

Parameters:

Show table
Name Type Description Default
transaction_id str

Transaction builder ID

required
deal_info Dict[str, Any]

Personal deal information data

required

Returns:

Show table
Type Description
Dict[str, Any]

Transaction builder response data

Update Personal Deal

Update personal deal (alias for update_personal_deal_info).

Parameters:

Show table
Name Type Description Default
transaction_id str

Transaction builder ID

required
deal_info Dict[str, Any]

Personal deal information data

required

Returns:

Show table
Type Description
Dict[str, Any]

Transaction builder response data

Alias Method

This is an alias for update_personal_deal_info() provided for backward compatibility.


Financial Management

Commission Splits

Update commission splits information.

⚠️ CRITICAL: Commission splits require PARTICIPANT IDs, not AGENT IDs! ⚠️

After adding agents (owner agent, co-agents) to the transaction, each agent gets a PARTICIPANT ID. You must use these participant IDs for commission splits.

🔄 REQUIRED WORKFLOW: 1. Create transaction and add all basic info (location, price/dates, buyers/sellers) 2. Add owner agent and any co-agents 3. Call get_transaction_builder() to retrieve the participant IDs 4. Use the participant IDs (NOT agent IDs) for commission splits

Commission Split Structure

Each split should contain: - participantId (str): The participant ID from transaction data (NOT agent ID!) - commission (dict): Commission data object with: - commissionPercent (float): Percentage (e.g., 50.0 for 50%) - percentEnabled (bool): Always True for percentage-based - negativeOrEmpty (bool): Always False for valid commissions

WORKING EXAMPLE
# Step 1: Get the transaction to find participant IDs
transaction = client.transaction_builder.get_transaction_builder(transaction_id)

# Step 2: Extract participant IDs from agents
owner_participant_id = None
co_agent_participant_id = None

# From owner agents
for agent in transaction["agentsInfo"]["ownerAgent"]:
    if agent["agentId"] == "your-agent-uuid":
        owner_participant_id = agent["id"]  # This is the participant ID!

# From co-agents
for agent in transaction["agentsInfo"]["coAgents"]:
    if agent["agentId"] == "co-agent-uuid":
        co_agent_participant_id = agent["id"]  # This is the participant ID!

# Step 3: Create commission splits using PARTICIPANT IDs
commission_splits = [
    {
        "participantId": owner_participant_id,  # NOT agentId!
        "commission": {
            "commissionPercent": 80.0,
            "percentEnabled": True,
            "negativeOrEmpty": False
        }
    },
    {
        "participantId": co_agent_participant_id,  # NOT agentId!
        "commission": {
            "commissionPercent": 20.0,
            "percentEnabled": True,
            "negativeOrEmpty": False
        }
    }
]

# Step 4: Submit commission splits
client.update_commission_splits(transaction_id, commission_splits)

❌ COMMON MISTAKE: Using agent IDs instead of participant IDs will fail with "Bad request"

Parameters:

Show table
Name Type Description Default
transaction_id str

Transaction builder ID

required
commission_splits List[Dict[str, Any]]

List of commission split data with PARTICIPANT IDs

required

Returns:

Show table
Type Description
Dict[str, Any]

Transaction builder response data

Raises:

Show table
Type Description
ValidationError

If using agent IDs instead of participant IDs

⚠️ CRITICAL: Use PARTICIPANT IDs, not Agent IDs!

Commission splits require PARTICIPANT IDs, not agent IDs. After adding agents to the transaction, each agent gets a unique participant ID. You MUST retrieve the transaction to get these IDs before creating commission splits.

Commission Split Examples

from typing import Dict, List, Any

from rezen import RezenClient

client: RezenClient = RezenClient()
transaction_id: str = "your-transaction-id-here"

# Step 1: Get the transaction to find participant IDs
transaction = client.transaction_builder.get_transaction_builder(transaction_id)

# Step 2: Extract participant IDs from agents
owner_participant_id = None
co_agent_participant_id = None

# From owner agents
for agent in transaction["agentsInfo"]["ownerAgent"]:
    if agent["agentId"] == "your-agent-uuid":
        owner_participant_id = agent["id"]  # This is the participant ID!

# From co-agents  
for agent in transaction["agentsInfo"]["coAgents"]:
    if agent["agentId"] == "co-agent-uuid":
        co_agent_participant_id = agent["id"]  # This is the participant ID!

# Step 3: Create commission splits using PARTICIPANT IDs
commission_splits = [
    {
        "participantId": owner_participant_id,  # NOT agentId!
        "commission": {
            "commissionPercent": 80.0,
            "percentEnabled": True,
            "negativeOrEmpty": False
        }
    },
    {
        "participantId": co_agent_participant_id,  # NOT agentId!
        "commission": {
            "commissionPercent": 20.0,
            "percentEnabled": True,
            "negativeOrEmpty": False
        }
    }
]

# Step 4: Submit commission splits
client.transaction_builder.update_commission_splits(transaction_id, commission_splits)
from typing import Dict, List, Any

from rezen import RezenClient

client: RezenClient = RezenClient()
transaction_id: str = "your-transaction-id-here"

# Get transaction to find participant ID
transaction = client.transaction_builder.get_transaction_builder(transaction_id)

# Find owner agent participant ID
owner_participant_id = None
for agent in transaction["agentsInfo"]["ownerAgent"]:
    owner_participant_id = agent["id"]  # Participant ID, not agentId!
    break

# Create commission split
commission_splits = [{
    "participantId": owner_participant_id,
    "commission": {
        "commissionPercent": 100.0,
        "percentEnabled": True,
        "negativeOrEmpty": False
    }
}]

client.transaction_builder.update_commission_splits(transaction_id, commission_splits)

Commission Payers

Add commission payer information.

IMPORTANT: This endpoint requires multipart/form-data format. The method automatically handles the conversion for you.

⚠️ CRITICAL FOR SUBMISSION ⚠️ Commission payer (usually title company) is REQUIRED before transaction submission! Without it, submission will fail.

Required Fields
  • role (str): Commission payer role. Common values:
    • "TITLE" - Title company (most common)
    • "SELLER" - Seller pays commission
    • "LANDLORD" - Landlord (for rental transactions)
    • "OTHER_AGENT" - Another agent pays
    • "REAL" - Real (company) pays
  • firstName (str): First name of the commission payer
  • lastName (str): Last name of the commission payer
  • email (str): Email address of the commission payer
  • phoneNumber (str): Phone number with country code (e.g., "1(555) 123-4567")
  • companyName (str): Company name of the commission payer
Optional Fields
  • receivesInvoice (bool): Whether the payer receives invoice (default: False)
  • opCityReferral (bool): Whether this is an OpCity referral (default: False)
  • optedInForEcp (bool): Whether opted in for ECP (default: False)
  • participantId (str): If provided, validation for other fields is bypassed
  • address (str): Address of the commission payer
  • ein (str): Employer Identification Number
Special Notes
  1. If you provide a participantId, the validation for other required fields is ignored. This is useful when referencing an existing participant.
  2. The role "TITLE" is most commonly used for title companies.
  3. Some role values like "NA", "LISTING_AGENT", "BUYERS_AGENT" may not work as they are not valid enum values for commission payer roles.

Working Example (Title Company):

# Title company as commission payer (most common)
commission_info = {
    "role": "TITLE",
    "firstName": "ABC",
    "lastName": "Title",
    "email": "closing@abctitle.com",
    "phoneNumber": "1(801) 555-5555",  # Include country code!
    "companyName": "ABC Title Company",
    "receivesInvoice": True,
    "opCityReferral": False,
    "optedInForEcp": False
}
result = client.add_commission_payer(transaction_id, commission_info)

# Using existing participant ID (bypasses validation)
commission_info = {
    "role": "TITLE",
    "participantId": "existing-participant-uuid",
    "receivesInvoice": True
}
result = client.add_commission_payer(transaction_id, commission_info)

Parameters:

Show table
Name Type Description Default
transaction_id str

Transaction builder ID

required
commission_info Dict[str, Any]

Commission payer information data

required

Returns:

Show table
Type Description
Dict[str, Any]

Transaction builder response data with commissionPayerInfo populated

Multipart form-data

This endpoint requires multipart/form-data. Pass a dictionary and the client will format it correctly and use the X-API-KEY header. Do not send JSON.

Payer Types:

Show table
Type Description
SELLER Seller pays commission
BUYER Buyer pays commission
BOTH Split between buyer and seller

Commission Payer Configuration

from typing import Dict, Any

from rezen import RezenClient

client: RezenClient = RezenClient()
transaction_id: str = "your-transaction-id-here"

payer_data: Dict[str, Any] = {
    "payerType": "SELLER",  # Use camelCase
    "commissionRate": 6.0,  # 6% commission, use camelCase
    "flatFee": False  # Percentage-based, not flat fee, use camelCase
}

# Using either method works the same
client.transaction_builder.add_commission_payer(transaction_id, payer_data)
# or
client.transaction_builder.update_commission_payer(transaction_id, payer_data)

Field Name Requirements

Critical Field Name Requirements

The ReZEN API has specific field name requirements that must be followed exactly:

Location Fields: - ✅ Use street NOT address - ✅ Use zip NOT zipCode - ✅ State must be UTAH (all caps) - ✅ Use camelCase: yearBuilt, mlsNumber, escrowNumber

Contact Fields: - ✅ Use firstName NOT first_name - ✅ Use lastName NOT last_name - ✅ Use phoneNumber NOT phone

Price Fields: - ✅ salePrice must be an object with amount and currency - ✅ Use camelCase: earnestMoney, downPayment, loanAmount

Date Fields: - ✅ Use camelCase: contractDate, closingDate, acceptanceDate - ✅ Format: YYYY-MM-DD

Commission Fields: - ✅ Use camelCase: agentId, splitPercentage, commissionAmount


Backward Compatibility

Legacy Method Names

The library provides backward compatibility aliases for users migrating from older versions:

Show table
Old Method Name New Method Name
put_buyer_to_draft() add_buyer()
put_seller_to_draft() add_seller()
put_location_to_draft() update_location_info()
put_price_and_date_to_draft() update_price_and_date_info()
update_commission_payer() add_commission_payer()
update_personal_deal() update_personal_deal_info()
update_real_title() update_title_info()

Using Backward Compatibility

from rezen import RezenClient

client = RezenClient()
transaction_id = "your-transaction-id"

# These method pairs do the same thing:

# Add buyer
client.transaction_builder.add_buyer(transaction_id, buyer_data)
client.transaction_builder.put_buyer_to_draft(transaction_id, buyer_data)

# Add seller
client.transaction_builder.add_seller(transaction_id, seller_data)
client.transaction_builder.put_seller_to_draft(transaction_id, seller_data)

# Update location
client.transaction_builder.update_location_info(transaction_id, location_data)
client.transaction_builder.put_location_to_draft(transaction_id, location_data)

# Update price and date
client.transaction_builder.update_price_and_date_info(transaction_id, price_data)
client.transaction_builder.put_price_and_date_to_draft(transaction_id, price_data)

Query & Search Operations

List Transaction Builders

Get a paginated list of transaction builders.

Parameters:

Show table
Name Type Description Default
limit int

Maximum number of results to return

required
from_offset int

Starting offset for pagination

required
yenta_id str

User ID

required
builder_type str

Type of builder ('TRANSACTION' or 'LISTING')

'TRANSACTION'

Returns:

Show table
Type Description
Dict[str, Any]

Paginated list of transaction builders

Advanced Filtering

builders = client.transaction_builder.get_transaction_builders(
    limit=20,
    from_offset=0
)

print(f"Found {len(builders)} transaction builders")
for builder in builders:
    print(f"ID: {builder['id']}, Status: {builder['status']}")
# Get builders for specific user
user_builders = client.transaction_builder.get_transaction_builders(
    limit=50,
    from_offset=0,
    yenta_id="user-uuid-here",
    builder_type="TRANSACTION"
)
# Get only listing builders
listings = client.transaction_builder.get_transaction_builders(
    limit=25,
    from_offset=0,
    builder_type="LISTING"
)

Error Handling

Enhanced Error Messages

The Transaction Builder now includes enhanced error handling that catches common mistakes before they reach the API.

New Error Types

  • InvalidFieldNameError: Catches incorrect field names (e.g., address instead of street)
  • InvalidFieldValueError: Validates field formats (e.g., state must be uppercase)
  • TransactionSequenceError: Identifies when operations are called in wrong order
  • ValidationError: General validation failures with detailed messages

Common Field Name Errors

Field Name Validation

from rezen.exceptions import InvalidFieldNameError

try:
    # Using wrong field name
    location_data = {
        "address": "123 Main St",  # ❌ Wrong! Should be 'street'
        "city": "Salt Lake City",
        "state": "UTAH",
        "zipCode": "84101"  # ❌ Wrong! Should be 'zip'
    }
    client.transaction_builder.update_location_info(transaction_id, location_data)
except InvalidFieldNameError as e:
    print(f"Field name error: {e}")
    print(f"Use '{e.correct_name}' instead of '{e.field_name}'")

Field Value Validation

Field Value Validation

from rezen.exceptions import InvalidFieldValueError

try:
    # Wrong state format
    location_data = {
        "street": "123 Main St",
        "city": "Salt Lake City",
        "state": "utah",  # ❌ Wrong! Must be uppercase
        "zip": "84101"
    }
    client.transaction_builder.update_location_info(transaction_id, location_data)
except InvalidFieldValueError as e:
    print(f"Invalid value for '{e.field_name}': {e.value}")
    print(f"Expected: {e.expected_format}")

Transaction Sequence Errors

Sequence Requirements

The owner agent endpoint requires specific setup steps in order:

from rezen.exceptions import TransactionSequenceError

try:
    # Trying to add owner agent without proper setup
    client.transaction_builder.update_owner_agent_info(builder_id, owner_data)
except TransactionSequenceError as e:
    print(f"Sequence error: {e}")
    # Error message includes required steps:
    # 1. Create transaction (create_transaction_builder)
    # 2. Add location info (update_location_info) - REQUIRED FIRST
    # 3. Add price/date info (update_price_and_date_info) - REQUIRED SECOND
    # 4. Add buyers/sellers (add_buyer/add_seller) - REQUIRED THIRD
    # 5. THEN add owner agent (update_owner_agent_info)

Price Structure Validation

Price Field Validation

from rezen.exceptions import InvalidFieldValueError, ValidationError

try:
    price_data = {
        "dealType": "SALE",
        "propertyType": "RESIDENTIAL",
        "salePrice": 500000,  # ❌ Wrong! Must be object
        "representationType": "BUYERS_AGENT"  # ❌ Wrong! Should be 'BUYER'
    }
    client.transaction_builder.update_price_and_date_info(transaction_id, price_data)
except InvalidFieldValueError as e:
    # Catches: "Invalid value for 'salePrice': 500000. 
    # Expected: Object with 'amount' and 'currency' fields"
    print(f"Error: {e}")
except ValidationError as e:
    # Catches missing required fields
    print(f"Validation error: {e}")

Best Practices

Error Handling Best Practices

  • Catch Specific Exceptions: Use specific exception types for better error handling
  • Check Field Names: The enhanced validation catches common camelCase vs snake_case errors
  • Validate Before Submission: Required fields are now validated before API calls
  • Follow Sequence Requirements: Especially important for owner agent endpoints
  • Use Error Details: Exception objects contain helpful properties like field_name and correct_name

Step-by-Step Transaction Creation

Interactive Transaction Building

In real-world scenarios, transaction information is often gathered incrementally. This example shows how to build a transaction step by step as information becomes available.

from rezen import RezenClient
from datetime import datetime, timedelta

client = RezenClient()

# Create empty transaction
transaction_id = client.transaction_builder.create_transaction_builder()
print(f"✅ Created transaction: {transaction_id}")

# Check initial status
transaction = client.transaction_builder.get_transaction_builder(transaction_id)
print(f"📊 Status: Empty transaction ready for data")
# Location information becomes available
location_data = {
    "street": "2207 E Wilson Ave",
    "city": "Salt Lake City",
    "state": "UTAH",             # Must be ALL CAPS
    "zip": "84108",
    "county": "Salt Lake",        # REQUIRED
    "yearBuilt": 1950,           # REQUIRED
    "mlsNumber": "n/a"           # REQUIRED (can use "n/a" if not available)
}

client.transaction_builder.update_location_info(transaction_id, location_data)
print("✅ Location added")

# Transaction now has: ✓ Location | ○ Price/Date | ○ Participants
# Price information becomes available
price_data = {
    "dealType": "SALE",
    "propertyType": "RESIDENTIAL",
    "salePrice": {"amount": 500000, "currency": "USD"},
    "representationType": "BUYER",   # You're representing the buyer
    "listingCommission": {            # REQUIRED even if just setting price
        "commissionPercent": 3.0,
        "percentEnabled": True,
        "negativeOrEmpty": False
    },
    "saleCommission": {               # REQUIRED even if just setting price
        "commissionPercent": 3.0,
        "percentEnabled": True,
        "negativeOrEmpty": False
    }
}

client.transaction_builder.update_price_and_date_info(transaction_id, price_data)
print("✅ Price information added")

# Transaction now has: ✓ Location | ✓ Price | ○ Dates | ○ Participants
# Dates are confirmed - but we need to include ALL price/date fields!
today = datetime.now().date()
closing_date = today + timedelta(days=30)

# Must include ALL fields from price_data when updating dates
price_date_update = {
    "dealType": "SALE",
    "propertyType": "RESIDENTIAL", 
    "salePrice": {"amount": 500000, "currency": "USD"},
    "representationType": "BUYER",
    "listingCommission": {            # Still REQUIRED for date updates
        "commissionPercent": 3.0,
        "percentEnabled": True,
        "negativeOrEmpty": False
    },
    "saleCommission": {               # Still REQUIRED for date updates
        "commissionPercent": 3.0,
        "percentEnabled": True,
        "negativeOrEmpty": False
    },
    "acceptanceDate": today.strftime("%Y-%m-%d"),
    "closingDate": closing_date.strftime("%Y-%m-%d")
}

client.transaction_builder.update_price_and_date_info(transaction_id, price_date_update)
print("✅ Dates added")

# Transaction now has: ✓ Location | ✓ Price/Date | ○ Participants
# Check current transaction status
transaction = client.transaction_builder.get_transaction_builder(transaction_id)

print(f"\n📊 Transaction Status:")
print(f"ID: {transaction['id']}")
print(f"Property: {transaction['address']['street']}, {transaction['address']['city']}")
print(f"Price: ${transaction['salePrice']['amount']:,}")
print(f"Type: {transaction['dealType']} - {transaction['propertyType']}")
print(f"Representation: {transaction['agentsInfo']['representationType']}")
print(f"Acceptance: {transaction['acceptanceDate']}")
print(f"Closing: {transaction['estimatedClosingDate']}")

# Ready to add participants when their info becomes available
# Add buyer when their information is available
buyer_data = {
    "firstName": "Demo",
    "lastName": "Buyer",
    "email": "demo.buyer@example.com",
    "phoneNumber": "1(801) 555-0123"  # MUST include country code!
}
client.transaction_builder.add_buyer(transaction_id, buyer_data)
print("✅ Buyer added")

# Add seller
seller_data = {
    "firstName": "John",
    "lastName": "Seller", 
    "email": "john.seller@example.com",
    "phoneNumber": "1(801) 555-9876"  # MUST include country code!
}
client.transaction_builder.add_seller(transaction_id, seller_data)
print("✅ Seller added")

# Transaction now has: ✓ Location | ✓ Price/Date | ✓ Buyer | ✓ Seller

Key Learnings:

  • ✅ Transactions can be built incrementally as information becomes available
  • ✅ Location requires additional fields: county, yearBuilt, mlsNumber
  • ✅ Price updates always require both commission objects
  • ⚠️ Date-only updates still require the complete price/date structure
  • ✅ Use get_transaction_builder() to check progress at any time

Complete Workflow Example

End-to-End Transaction Creation

from rezen import RezenClient
from rezen.exceptions import RezenError
import logging

def create_complete_transaction():
    """Create a complete transaction with all participants and details."""

    try:
        client = RezenClient()

        # Step 1: Create transaction builder
        print("Creating transaction builder...")
        response = client.transaction_builder.create_transaction_builder()
        transaction_id = response['id']
        print(f"✅ Created transaction: {transaction_id}")

        # Step 2: Add buyer
        print("Adding buyer...")
        buyer_data = {
            "firstName": "John",  # Use camelCase
            "lastName": "Doe",  # Use camelCase
            "email": "john.doe@email.com",
            "phoneNumber": "+1-555-123-4567"  # Use camelCase
        }
        client.transaction_builder.add_buyer(transaction_id, buyer_data)
        print("✅ Added buyer")

        # Step 3: Add seller
        print("Adding seller...")
        seller_data = {
            "firstName": "Jane",  # Use camelCase
            "lastName": "Smith",  # Use camelCase
            "email": "jane.smith@email.com",
            "phoneNumber": "+1-555-987-6543"  # Use camelCase
        }
        client.transaction_builder.add_seller(transaction_id, seller_data)
        print("✅ Added seller")

        # Step 4: Add property location
        print("Setting property location...")
        location_data = {
            "street": "123 Dream House Lane",  # Use 'street' not 'address'
            "street2": "",
            "city": "Salt Lake City",
            "state": "UTAH",  # Must be UTAH (all caps)
            "zip": "84101",  # Use 'zip' not 'zipCode'
            "county": "Salt Lake",
            "unit": "",
            "yearBuilt": 2020,  # Use camelCase
            "mlsNumber": "MLS123456",  # Use camelCase
            "escrowNumber": ""
        }
        client.transaction_builder.update_location_info(transaction_id, location_data)
        print("✅ Set property location")

        # Step 5: Set pricing and dates
        print("Setting pricing and dates...")
        price_data = {
            "salePrice": {  # Use camelCase and object structure
                "amount": 850000,
                "currency": "USD"
            },
            "earnestMoney": 17000,  # Use camelCase
            "acceptanceDate": "2024-02-01",  # Use camelCase
            "closingDate": "2024-03-15"  # Use camelCase
        }
        client.transaction_builder.update_price_and_date_info(transaction_id, price_data)
        print("✅ Set pricing and dates")

        # Step 6: Add service providers
        print("Adding service providers...")
        inspector_data = {
            "type": "INSPECTOR",
            "firstName": "Mike",  # Use camelCase
            "lastName": "Inspector",  # Use camelCase
            "company": "Quality Inspections Inc",
            "phoneNumber": "+1-555-INSPECT",  # Use camelCase
            "email": "mike@qualityinspections.com"
        }
        client.transaction_builder.add_participant(transaction_id, inspector_data)
        print("✅ Added inspector")

        # Step 7: Submit transaction
        print("Submitting transaction...")
        submit_response = client.transaction_builder.submit_transaction(transaction_id)
        print("✅ Transaction submitted successfully!")

        return {
            "success": True,
            "transaction_id": transaction_id,
            "submit_response": submit_response
        }

    except RezenError as e:
        logging.error(f"ReZEN API error: {e}")
        return {
            "success": False,
            "error": str(e),
            "transaction_id": transaction_id if 'transaction_id' in locals() else None
        }
    except Exception as e:
        logging.error(f"Unexpected error: {e}")
        return {
            "success": False,
            "error": str(e)
        }

# Run the example
result = create_complete_transaction()
if result["success"]:
    print(f"🎉 Transaction {result['transaction_id']} created successfully!")
else:
    print(f"❌ Failed to create transaction: {result['error']}")

Next Steps

Complete Transaction Submission Workflow

Critical: Commission Splits and Submission Requirements

The following example shows the EXACT workflow proven to work in production, including all critical requirements for successful transaction submission.

# COMPLETE WORKING TRANSACTION SUBMISSION EXAMPLE
# Based on production-proven workflow

from rezen import RezenClient

client = RezenClient()

# Step 1: Create transaction builder
builder_response = client.transaction_builder.create_transaction_builder()
transaction_id = builder_response["id"]

# Step 2: Add location info (ALL fields required)
location_info = {
    "street": "123 Main Street",
    "city": "Salt Lake City",
    "state": "UTAH",  # Must be ALL CAPS
    "zip": "84101",
    "county": "Salt Lake",      # REQUIRED
    "yearBuilt": 2020,         # REQUIRED
    "mlsNumber": "MLS123456"   # REQUIRED
}
client.transaction_builder.update_location_info(transaction_id, location_info)

# Step 3: Add price/date info with BOTH commissions
price_data = {
    "dealType": "SALE",  # NOT "COMPENSATING"!
    "propertyType": "RESIDENTIAL",
    "salePrice": {"amount": 500000, "currency": "USD"},
    "representationType": "BUYER",
    "listingCommission": {  # REQUIRED even for buyer deals
        "commissionPercent": 3.0,
        "percentEnabled": True,
        "negativeOrEmpty": False  # CRITICAL!
    },
    "saleCommission": {  # REQUIRED even for buyer deals
        "commissionPercent": 3.0,
        "percentEnabled": True,
        "negativeOrEmpty": False  # CRITICAL!
    },
    "acceptanceDate": "2024-01-15",
    "closingDate": "2024-02-28"
}
client.transaction_builder.update_price_and_date_info(transaction_id, price_data)

# Step 4: Add buyer
buyer_info = {
    "firstName": "John",
    "lastName": "Buyer",
    "email": "john@example.com",
    "phoneNumber": "1(801) 555-1234"  # Country code required!
}
client.transaction_builder.add_buyer(transaction_id, buyer_info)

# Step 5: Add seller (REQUIRED even for buyer representation!)
seller_info = {
    "firstName": "Jane",
    "lastName": "Seller",
    "email": "jane@example.com",
    "phoneNumber": "1(801) 555-9876"  # Country code required!
}
client.transaction_builder.add_seller(transaction_id, seller_info)

# Step 6: Add owner agent
user = client.users.get_current_user()
owner_info = {
    "ownerAgent": {
        "agentId": user["id"],
        "role": "BUYERS_AGENT"  # Must match representationType
    },
    "officeId": user["offices"][0]["id"],
    "teamId": "your-team-uuid"
}
client.transaction_builder.update_owner_agent_info(transaction_id, owner_info)

# Step 7: Get transaction to find participant IDs (CRITICAL!)
transaction = client.transaction_builder.get_transaction_builder(transaction_id)

# Find owner agent participant ID
owner_participant_id = None
for agent in transaction["agentsInfo"]["ownerAgent"]:
    if agent["agentId"] == user["id"]:
        owner_participant_id = agent["id"]  # This is participant ID!
        break

# Step 8: Add commission splits using PARTICIPANT IDs
commission_splits = [{
    "participantId": owner_participant_id,  # NOT agentId!
    "commission": {
        "commissionPercent": 100.0,
        "percentEnabled": True,
        "negativeOrEmpty": False
    }
}]
client.transaction_builder.update_commission_splits(transaction_id, commission_splits)

# Step 9: Add commission payer (title company)
commission_payer = {
    "role": "TITLE",
    "firstName": "ABC",
    "lastName": "Title",
    "email": "closing@abctitle.com",
    "phoneNumber": "1(801) 555-5555",
    "companyName": "ABC Title Company",
    "receivesInvoice": True
}
client.transaction_builder.add_commission_payer(transaction_id, commission_payer)

# Step 10: Submit transaction
result = client.transaction_builder.submit_transaction(transaction_id)

# The transaction is now created!
# result contains the preview data of the submitted transaction

Common Submission Failures

  1. "commissionSplitsInfo cannot be empty" - You MUST add commission splits before submission
  2. "Bad request: Invalid request" - Check that you're using participant IDs, not agent IDs
  3. Missing commission payer - Title company or other payer is required
  4. Wrong commission structure - Each split needs the nested commission object

Known Issues

  1. Date-only updates require complete price/date structure - You cannot update dates without including all price and commission fields
  2. Team selection on owner agent - Currently, the API does not properly set the teamId field on the owner agent object, even when using explicit team selection methods. The team ID is only stored at the agentsInfo level, which prevents transaction submission. This is a limitation in the current API implementation.
  3. All phone numbers must include country code - Phone numbers without the country code prefix (e.g., starting with "1" for US) will fail validation
  4. Commission splits require participant IDs - You must retrieve the transaction after adding agents to get their participant IDs for commission splits
  5. Both buyer AND seller required - Even for buyer-only representation, you must add both a buyer and seller to the transaction for successful submission