TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/wppconnect-team/wa-js/llms.txt
Use this file to discover all available pages before exploring further.
WPP.catalog module exposes WhatsApp Business catalog internals through the global WPP object. You can read your own catalog, browse other businesses’ products, create and edit listings, manage product images, organize products into collections, and toggle cart availability — all from within an injected WhatsApp Web session.
Reading products
getMyCatalog()
Returns the catalog store entry for the currently connected business account.
The raw catalog model for the logged-in business account, as stored internally by WhatsApp Web.
getProducts(chatId, qnt)
Fetches product listings from any business contact’s catalog.
The WhatsApp ID of the business contact whose catalog you want to query, e.g.
5521985625689@c.us.Maximum number of products to return. Defaults to
10 if omitted or falsy.An array of product objects from the queried catalog.
getProductById(chatId, productId)
Fetches a single product by its numeric ID from a business contact’s catalog.
The WhatsApp ID of the business contact who owns the product.
The numeric product identifier.
Creating and editing products
createProduct(params)
Creates a new product in your connected business account’s catalog. The image is uploaded to WhatsApp’s CDN before the product record is created.
The newly created product model returned by WhatsApp’s internal API.
editProduct(productId, params)
Updates fields on an existing product in your catalog. Only the fields you pass are changed; undefined keys are stripped before the update is sent.
The ID of the product to edit.
The updated product model.
delProducts(productsIds)
Deletes one or more products from your catalog. Accepts a single ID string or an array of IDs. Returns a status object rather than throwing on failure.
A single product ID or an array of product IDs to delete.
Product visibility
setProductVisibility(productId, isHidden)
Shows or hides a product without deleting it. When isHidden is true the product is invisible to customers browsing your catalog.
The ID of the product whose visibility you want to change.
Pass
true to hide the product, false to make it visible.The product model after the visibility change is applied.
Product images
WhatsApp Business products support one main image and multiple additional images. The functions below target each category separately.addProductImage(productId, content)
Appends an additional image to a product’s image gallery. To replace the main image, use changeProductImage instead.
The ID of the product to update.
Base64-encoded image string or data URL.
changeProductImage(productId, content)
Replaces the product’s main (cover) image. To add secondary images instead, use addProductImage.
The ID of the product to update.
Base64-encoded image string or data URL for the new main image.
removeProductImage(productId, index)
Removes an entry from the product’s additionalImageCdnUrl array by index. This does not affect the main image.
The ID of the product to update.
Zero-based string index of the image to remove from the
additionalImageCdnUrl array.The updated product model after the image is removed.
Collections
Collections group related products together for easier browsing. They are only available on WhatsApp Business accounts.getCollections(chatId, qnt?, productsCount?)
Fetches collections from a business contact’s catalog.
The WhatsApp ID of the business contact.
Maximum number of collections to return.
Maximum number of products to include within each collection.
An array of collection models.
createCollection(collectionName, productsId)
Creates a new collection in your catalog and populates it with an initial set of products.
Display name for the new collection.
Array of product IDs to include in the collection.
editCollection(collectionId, params)
Updates an existing collection’s name or its member products.
The ID of the collection to update.
deleteCollection(collectionId)
Permanently deletes a collection. The products themselves are not deleted, only the grouping.
The ID of the collection to delete.
Returns the string
"Collection deleted sucessful" on success.Cart settings
updateCartEnabled(enabled)
Enables or disables the cart feature for your WhatsApp Business catalog. When disabled, customers cannot add products to a cart or send order messages.
Pass
true to enable the cart, false to disable it.