BOOKBEYWhatsApp API

Magento / Adobe Commerce

Overview

A Magento 2 module that messages the customer on WhatsApp when an order enters Processing or Complete. Configured entirely from the admin, with encrypted key storage.

Requirements

  • Magento 2.4+ / Adobe Commerce
  • PHP 7.4+
  • SSH/CLI access to run bin/magento
  • An API key and active plan

Download

Get it from Client area → Downloads → Magento Extension. The zip contains the Bookbey/WhatsApp module tree.

Upload

Copy the module into your Magento source tree:

app/code/Bookbey/WhatsApp/

So that registration.php sits at app/code/Bookbey/WhatsApp/registration.php.

Enable the module

From the Magento root, run:

bin/magento module:enable Bookbey_WhatsApp
bin/magento setup:upgrade
bin/magento setup:di:compile      # production mode only
bin/magento cache:flush

Configuration

In the admin: Stores → Configuration → BOOKBEY → WhatsApp. Set Enable = Yes, paste the API key (stored encrypted) and API base URL (https://bookbey.com/public/api), a default country code, toggle Processing/Complete and edit the messages. Save, then flush cache.

Message placeholders

{name}, {order}, {total}, {site} are substituted per order.

Phone number format

Phone numbers are digits only, in international format without a leading + or spaces — country code followed by the number, e.g. 9198XXXXXXXX for India. Modules that take orders will prefix a configurable default country code to any local number that is missing one.

How it works

An observer on sales_order_save_after detects the state transition to Processing or Complete, normalises the billing telephone, fills your message and calls the API. On success it adds a comment to the order's status history.

Error handling

Errors are returned as JSON with ok:false, a machine-readable error code and a human message. The HTTP status reflects the error class.

HTTPerror codeMeaning & fix
401unauthorized / invalid_api_keyKey missing, wrong, or revoked. Re-copy it from API Keys.
402no_active_planNo active plan on the account. Buy or renew a plan.
403account_suspendedAccount suspended. Contact support / clear dues.
422invalid_jsonBody was not valid JSON. Check Content-Type and payload.
422invalid_numberDestination number malformed. Use country code + number, digits only.
429quota_exceeded / rate_limitedMonthly quota used up, or sending too fast. Check status.php; retry with backoff.
500server_errorTransient server error. Retry; if it persists, contact support.

Troubleshooting

  • Module not visible: run setup:upgrade and confirm bin/magento module:status Bookbey_WhatsApp shows enabled.
  • Config not saving key: the field is encrypted; ensure your crypt key is set (default in app/etc/env.php).
  • No message: confirm the order really transitioned to Processing/Complete and the billing address has a phone.
  • Changes not showing: cache:flush; in production run setup:di:compile after copying the module.

FAQ

Does it edit core? No — it's a self-contained module using standard DI + observers. Multi-store? Config is store-scoped, so you can enable per store view. Where are the messages logged? Successes appear in the order's status history.

Need help? Open a ticket from Client area → Support. Your API base URL is https://bookbey.com/public/api.