Describe the bug
A clear and concise description of what the bug is.
When using getBusinessProfilesProducts to get my own products, undefined is returned
Steps to Reproduce
Steps to reproduce the behavior:
getMe() when the session is startedgetBusinessProfilesProducts results, using my own wid as parameter.create() code
This is the code you use to create the client. e.g
const start = async (client) {
try {
const me = await client.getMe();
const prods = await client.getBusinessProfilesProducts(me.wid)
console.log(prods)
} catch (err) {
console.log(err)
process.exit(1)
}
}
create(this.session,
{
executablePath: 'google-chrome',
qrRefreshS: 30,
autoRefresh: true,
useChrome: true,
throwErrorOnTosBlock: true,
}
).then(client => start(client))
.catch((err) => {
console.log("Ha ocurrido un error :: ", err)
process.exit(1)
})
Expected behavior
A clear and concise description of what you expected to happen.
All the the products from my account should be shown in console, but undefined is returned
DEBUG INFO
This is the info printed to the console when you start your app. It should look like this
Debug Info {
WA_VERSION: '2.2025.6',
PAGE_UA: 'WhatsApp/2.2019.8 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36',
WA_AUTOMATE_VERSION: '1.9.91',
BROWSER_VERSION: 'HeadlessChrome/83.0.4103.116'
}
Screenshots
If applicable, add screenshots to help explain your problem. Use headless: false to get screenshots
On the browser console, using WAPI, the result is different.

Host (please complete the following information):
Additional context
If the wid passed to getBusinessProfilesProducts is not a business account, an error is thrown. Shouldn't give an empty array?
@dogcalas I've made some changes to WAPI and tried your code. it is working. I've added some error handling. If it's not a business account it will return false, if there are no products it will return []
@github-actions run
âš¡ Release! âš¡
(async () => {
function exec(cmd) {
console.log(execSync(cmd).toString());
}
// Config
const gitUserEmail = "github-actions[bot]@users.noreply.github.com";
const gitUserName = "github-actions[bot]";
exec(`echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc`);
exec(`git config --global user.email "${gitUserEmail}"`);
exec(`git config --global user.name "${gitUserName}"`);
exec(`npm i`);
exec(`npm run release-ci`);
//comment on the issue
var result = execSync(`npx auto-changelog -o ./tempchangelog.txt --commit-limit false --template ./compact-keepachangelog.hbs --stdout`).toString();
await postComment(result);
//create changelog image
exec(`npm run release-image`);
exec(`git commit -a -m 'updated release-image'`);
exec(`git push --force`);
})();
#609#615#616#600#601#602#6172fe1f55303b9f2c1e2726c875deb@dogcalas let me know if this is working now thanks
Now is working and solve my problem. Thanks @smashah
Though, it took a lot of time to get just one product.
console.time();
const prods = await client.getBusinessProfilesProducts(me.wid)
console.log(prods)
console.timeEnd()
In console:
default: 100693.2021484375ms <-- More than one minute.
If I look into web browser console, I can see a lot of requests to resources(images) which belongs to products from other users.
Hmm, try commenting out this line
Maybe it's not necessary any more.
Done!!!, Working fast and perfect!!!
Most helpful comment
Done!!!, Working fast and perfect!!!