Message Fields#

class pywa.types.others.Reaction#

Represents a reaction to a message.

Variables:
  • message_id (str) – The ID of the message that was reacted to.

  • emoji (str | None) – The emoji that was used to react to the message (optional, None if removed).

class pywa.types.others.Location#

Represents a location.

Variables:
  • latitude (float) – The latitude of the location.

  • longitude (float) – The longitude of the location.

  • name (str | None) – The name of the location (optional).

  • address (str | None) – The address of the location (optional).

  • url (str | None) – The URL of the location (optional).

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 pywa.types.others.Product#

Represents a product in an order.

Variables:
  • sku (str) – Unique identifier of the product in a catalog (also referred to as Content ID or Retailer ID).

  • quantity (int) – Number of items ordered.

  • price (float) – Price of the item.

  • currency (str) – Currency of the price.

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.System#

Represents a system update (A customer has updated their phone number or profile information).

Variables:
  • type (str) – The type of the system update (customer_changed_number or customer_identity_changed).

  • body (str) – Describes the change to the customer’s identity or phone number.

  • identity (str) – Hash for the identity fetched from server.

  • wa_id (str) – 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.

Variables:
  • wa_id (str) – The WhatsApp ID of the user (The phone number with the country code).

  • name (str | None) – The name of the user (None on MessageStatus).

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.

class pywa.types.others.Metadata#

Represents the metadata of a message.

Variables:
  • display_phone_number (str) – The phone number to which the message was sent.

  • phone_number_id (str) – The ID of the phone number to which the message was sent.

class pywa.types.message_status.Conversation#

Represents a conversation.

Variables:
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.