Skip to main content
The business API allows you to fetch business profiles for WhatsApp Business accounts, including their description, contact information, categories, and business hours.

Access

Business profile operations are available directly on the Client:
let profile = client.get_business_profile(&jid).await?;

Methods

get_business_profile

Fetch the business profile for a WhatsApp Business account.
pub async fn get_business_profile(
    &self,
    jid: &Jid,
) -> Result<Option<BusinessProfile>, IqError>
Parameters:
  • jid - JID of the account to query
Returns:
  • Some(BusinessProfile) if the account is a business with a profile
  • None if the account is not a business or has no profile
Example:
let jid: Jid = "15551234567@s.whatsapp.net".parse()?;

if let Some(profile) = client.get_business_profile(&jid).await? {
    println!("Description: {}", profile.description);
    
    if let Some(email) = &profile.email {
        println!("Email: {}", email);
    }
    
    for site in &profile.website {
        println!("Website: {}", site);
    }
    
    if let Some(addr) = &profile.address {
        println!("Address: {}", addr);
    }
    
    for category in &profile.categories {
        println!("Category: {} (ID: {})", category.name, category.id);
    }
    
    if let Some(tz) = &profile.business_hours.timezone {
        println!("Timezone: {}", tz);
    }
    
    if let Some(configs) = &profile.business_hours.business_config {
        for config in configs {
            println!(
                "  {:?}: {:?} ({}–{})",
                config.day_of_week,
                config.mode,
                config.open_time,
                config.close_time,
            );
        }
    }
} else {
    println!("Not a business account");
}

Types

BusinessProfile

pub struct BusinessProfile {
    pub wid: Option<Jid>,
    pub description: String,
    pub email: Option<String>,
    pub website: Vec<String>,
    pub categories: Vec<BusinessCategory>,
    pub address: Option<String>,
    pub business_hours: BusinessHours,
}

BusinessCategory

pub struct BusinessCategory {
    pub id: String,
    pub name: String,
}

BusinessHours

pub struct BusinessHours {
    pub timezone: Option<String>,
    pub business_config: Option<Vec<BusinessHoursConfig>>,
}

BusinessHoursConfig

pub struct BusinessHoursConfig {
    pub day_of_week: DayOfWeek,
    pub mode: BusinessHourMode,
    pub open_time: u32,
    pub close_time: u32,
}

DayOfWeek

pub enum DayOfWeek {
    Sunday,       // "sun"
    Monday,       // "mon"
    Tuesday,      // "tue"
    Wednesday,    // "wed"
    Thursday,     // "thu"
    Friday,       // "fri"
    Saturday,     // "sat"
    Other(String),
}

BusinessHourMode

pub enum BusinessHourMode {
    Open24H,          // "open_24h"
    SpecificHours,    // "specific_hours"
    AppointmentOnly,  // "appointment_only"
    Other(String),
}

Business events

Business account changes are reported through the event system. Subscribe to BusinessStatusUpdate events to track changes:
use wacore::types::events::{Event, BusinessStatusUpdate, BusinessUpdateType};

match event {
    Event::BusinessStatusUpdate(update) => {
        match update.update_type {
            BusinessUpdateType::VerifiedNameChanged => {
                println!("Verified name: {:?}", update.verified_name);
            }
            BusinessUpdateType::ProfileUpdated => {
                println!("Business profile updated for {}", update.jid);
            }
            BusinessUpdateType::RemovedAsBusiness => {
                println!("{} is no longer a business account", update.jid);
            }
            BusinessUpdateType::ProductsUpdated => {
                println!("Products updated: {:?}", update.product_ids);
            }
            BusinessUpdateType::CollectionsUpdated => {
                println!("Collections updated: {:?}", update.collection_ids);
            }
            BusinessUpdateType::SubscriptionsUpdated => {
                println!("Subscriptions: {:?}", update.subscriptions);
            }
            _ => {}
        }
    }
    _ => {}
}
See Events for the full BusinessStatusUpdate type.

Checking if a contact is a business

You can check if a contact is a business account using the contacts API:
let results = client.contacts().is_on_whatsapp(&[Jid::pn("15551234567")]).await?;

for result in &results {
    if result.is_business {
        println!("{} is a business account", result.jid);
    }
}
See Contacts API for details.

Automatic business stanza detection

When sending interactive business messages (native-flow buttons for payments, CTAs, catalogs, etc.), the library automatically injects a <biz> stanza child node on the outgoing message. This means you can send InteractiveMessage with NativeFlowMessage content through send_message or send_message_with_options without manually constructing business protocol nodes. See Send API - Automatic business node detection for the full list of supported button-to-flow mappings.

See also