Skip to main content

Documentation 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.

The 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.
All write operations (createProduct, editProduct, delProducts, and collection management functions) require the connected account to be a WhatsApp Business account. Read operations such as getProducts and getProductById work from any account type.

Reading products

getMyCatalog()

Returns the catalog store entry for the currently connected business account.
const catalog = await WPP.catalog.getMyCatalog();
console.log(catalog);
returns
CatalogStore entry
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.
chatId
string
required
The WhatsApp ID of the business contact whose catalog you want to query, e.g. 5521985625689@c.us.
qnt
number
default:"10"
Maximum number of products to return. Defaults to 10 if omitted or falsy.
// Fetch up to 20 products from a business contact
const products = await WPP.catalog.getProducts('5521985625689@c.us', 20);
products.forEach((p) => console.log(p.name, p.price));
returns
any[]
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.
chatId
string
required
The WhatsApp ID of the business contact who owns the product.
productId
number
required
The numeric product identifier.
const product = await WPP.catalog.getProductById(
  '5521985565656@c.us',
  68685985868923
);
console.log(product.name, product.currency, product.price);
returns
object

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.
params
object
required
const product = await WPP.catalog.createProduct({
  name: 'Annual Plan',
  image: 'data:image/jpeg;base64,/9j/4AAQSkZJRgAB...',
  description: 'Full access for 12 months.',
  price: 89.90,
  currency: 'BRL',
  isHidden: false,
  url: 'https://wppconnect.io/plans',
  retailerId: 'PLAN-ANNUAL-001',
});
console.log('Created product ID:', product.id);
returns
ProductModel
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.
productId
string
required
The ID of the product to edit.
params
object
required
const updated = await WPP.catalog.editProduct('5498255476885590', {
  name: 'Annual Plan — Updated',
  price: 79990,
  description: 'Now with extra features included.',
  isHidden: false,
  url: 'https://wppconnect.io/plans/annual',
  retailerId: 'PLAN-ANNUAL-002',
});
returns
ProductModel
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.
productsIds
string | string[]
required
A single product ID or an array of product IDs to delete.
// Delete a single product
await WPP.catalog.delProducts('6104203702939361');

// Delete multiple products at once
const result = await WPP.catalog.delProducts([
  '6104203702939361',
  '6104289702939361',
]);
console.log(result.status); // 200 on success, 500 on error
returns
object

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.
productId
any
required
The ID of the product whose visibility you want to change.
isHidden
boolean
required
Pass true to hide the product, false to make it visible.
// Hide a product
await WPP.catalog.setProductVisibility(54985569989897, true);

// Make a product visible again
await WPP.catalog.setProductVisibility(54985569989897, false);
returns
ProductModel
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.
productId
string
required
The ID of the product to update.
content
string
required
Base64-encoded image string or data URL.
await WPP.catalog.addProductImage(
  '686859858689',
  'data:image/jpeg;base64,/9j/4AAQSkZJRgAB...'
);

changeProductImage(productId, content)

Replaces the product’s main (cover) image. To add secondary images instead, use addProductImage.
productId
string
required
The ID of the product to update.
content
string
required
Base64-encoded image string or data URL for the new main image.
await WPP.catalog.changeProductImage(
  '686859858689',
  'data:image/jpeg;base64,/9j/4AAQSkZJRgAB...'
);

removeProductImage(productId, index)

Removes an entry from the product’s additionalImageCdnUrl array by index. This does not affect the main image.
productId
string
required
The ID of the product to update.
index
string
required
Zero-based string index of the image to remove from the additionalImageCdnUrl array.
// Remove the first additional image (index 0)
await WPP.catalog.removeProductImage('68685985868923', '0');
returns
ProductModel
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.
chatId
string
required
The WhatsApp ID of the business contact.
qnt
number
default:"10"
Maximum number of collections to return.
productsCount
number
default:"10"
Maximum number of products to include within each collection.
// Get up to 20 collections, each with up to 10 products
const collections = await WPP.catalog.getCollections(
  '552198554578@c.us',
  20,
  10
);
collections.forEach((c) => console.log(c.name));
returns
ProductCollModel[]
An array of collection models.

createCollection(collectionName, productsId)

Creates a new collection in your catalog and populates it with an initial set of products.
collectionName
string
required
Display name for the new collection.
productsId
string[]
required
Array of product IDs to include in the collection.
const collection = await WPP.catalog.createCollection(
  'Summer Deals',
  ['565656589898', '565656589899']
);
console.log('Collection ID:', collection.id);

editCollection(collectionId, params)

Updates an existing collection’s name or its member products.
collectionId
string
required
The ID of the collection to update.
params
object
required
await WPP.catalog.editCollection('565656589898', {
  name: 'Summer Deals 2025',
  productsToAdd: ['6104203702939361'],
  productsToRemove: ['565656589899'],
});

deleteCollection(collectionId)

Permanently deletes a collection. The products themselves are not deleted, only the grouping.
collectionId
string
required
The ID of the collection to delete.
await WPP.catalog.deleteCollection('377095767832354');
returns
string
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.
enabled
boolean
required
Pass true to enable the cart, false to disable it.
// Enable cart for your catalog
await WPP.catalog.updateCartEnabled(true);

// Disable cart
await WPP.catalog.updateCartEnabled(false);
Use updateCartEnabled(false) when your catalog is in a read-only or browse-only mode (for example, during a product refresh or maintenance window) to prevent incomplete orders from being submitted.

Full workflow example

The following example shows how to set up a product from scratch, including creation, image management, and collection assignment.
// 1. Create the product
const product = await WPP.catalog.createProduct({
  name: 'Premium Widget',
  image: 'data:image/jpeg;base64,/9j/4AAQSkZJRgAB...',
  description: 'A high-quality widget for every use case.',
  price: 49.99,
  currency: 'USD',
  retailerId: 'WIDGET-PREM-001',
});

// 2. Add a secondary gallery image
await WPP.catalog.addProductImage(
  product.id,
  'data:image/jpeg;base64,/9j/4AAQSkZJRgAB...'
);

// 3. Add it to a collection
await WPP.catalog.editCollection('existing-collection-id', {
  productsToAdd: [product.id],
});

// 4. Make it visible
await WPP.catalog.setProductVisibility(product.id, false);

console.log('Product is live:', product.id);

Build docs developers (and LLMs) love