Message Fields#
- class pywa.types.others.Reaction#
Represents a reaction to a message.
- Variables:
- class pywa.types.others.Location#
Represents a location.
- Variables:
- class pywa.types.others.Contact#
Represents a contact.
- Variables:
name (Name) β The name of the contact.
birthday (str | None) β The birthday of the contact (in
YYYY-MM-DD
format, optional).phones (Iterable[Phone]) β The phone numbers of the contact.
emails (Iterable[Email]) β The email addresses of the contact.
urls (Iterable[Url]) β The URLs of the contact.
addresses (Iterable[Address]) β The addresses of the contact.
org (Org | None) β The organization of the contact (optional).
- class Name(formatted_name: str, first_name: str | None = None, last_name: str | None = None, middle_name: str | None = None, suffix: str | None = None, prefix: str | None = None)#
Represents a contactβs name.
At least one of the optional parameters needs to be included along with the formatted_name parameter.
- Variables:
formatted_name (str) β The formatted name of the contact.
first_name (str | None) β The first name of the contact (optional).
last_name (str | None) β The last name of the contact (optional).
middle_name (str | None) β The middle name of the contact (optional).
suffix (str | None) β The suffix of the contact (optional).
prefix (str | None) β The prefix of the contact (optional).
- class Phone(phone: str | None = None, type: str | None = None, wa_id: str | None = None)#
Represents a contactβs phone number.
- class Email(email: str | None = None, type: str | None = None)#
Represents a contactβs email address.
- class Org(company: str | None = None, department: str | None = None, title: str | None = None)#
Represents a contactβs organization.
- class Address(street: str | None = None, city: str | None = None, state: str | None = None, zip: str | None = None, country: str | None = None, country_code: str | None = None, type: str | None = None)#
Represents a contactβs address.
- Variables:
street (str | None) β The street number and name of the address (optional).
city (str | None) β The city name of the address (optional).
state (str | None) β State abbreviation.
zip (str | None) β Zip code of the address (optional).
country (str | None) β Full country name.
country_code (str | None) β Two-letter country abbreviation (e.g. US, GB, IN. optional).
type (str | None) β The type of the address (Standard Values are WORK and HOME. optional).
- class pywa.types.others.Product#
Represents a product in an order.
- Variables:
- class pywa.types.others.Order#
Represents an order.
- Variables:
catalog_id (str) β The ID for the catalog the ordered item belongs to.
products (tuple[pywa.types.others.Product, ...]) β The ordered products.
text (str | None) β Text message from the user sent along with the order (optional).
- Properties:
total_price: Total price of the order.
- class pywa.types.others.ReferredProduct#
Represents a product this message is referring to.
- class pywa.types.others.System#
Represents a system update (A customer has updated their phone number or profile information).
- Variables:
type (str | None) β The type of the system update (
customer_changed_number
orcustomer_identity_changed
).body (str | None) β Describes the change to the customerβs identity or phone number.
identity (str | None) β Hash for the identity fetched from server.
wa_id (str | None) β The WhatsApp ID for the customer prior to the update.
new_wa_id (str | None) β New WhatsApp ID for the customer when their phone number is updated.
- class pywa.types.others.User#
Represents a WhatsApp user.
- class pywa.types.others.ReplyToMessage#
Represents a message that was replied to.
- Variables:
message_id (str) β The ID of the message that was replied to.
from_user_id (str) β The ID of the user who sent the message that was replied to.
referred_product (pywa.types.others.ReferredProduct | None) β Referred product describing the product the user is requesting information about.
- class pywa.types.others.Metadata#
Represents the metadata of a message.
- class pywa.types.message_status.Conversation#
Represents a conversation.
- Variables:
id (str) β The ID of the conversation.
category (pywa.types.message_status.ConversationCategory) β The category of the conversation.
expiration (datetime.datetime | None) β The expiration date of the conversation (Optional, only for sent updates).
- class pywa.types.message_status.ConversationCategory#
Conversation category.
- Variables:
AUTHENTICATION β The conversation is related to authentication.
MARKETING β The conversation is related to marketing.
UTILITY β The conversation is related to utility.
SERVICE β The conversation is related to service.
REFERRAL_CONVERSION β The conversation is related to referral conversion.
UNKNOWN β The conversation category is unknown.