← Notes

How to send WooCommerce shipping updates on WhatsApp

Connect a WooCommerce fulfillment event to the bitbybit Messaging API. Handle split parcels, virtual orders and replays before sending a WhatsApp update.

A WooCommerce order can contain two physical items that leave on different days. If the Fulfillments feature is enabled, connect a fulfilled record to an approved WhatsApp template and track each fulfillment separately. For stores with a warehouse plugin, establish which event actually records dispatch. A checkout draft, a payment and an order marked Completed can all occur without a parcel leaving. Build your first test around a split order and a digital purchase.

When should WooCommerce trigger the message?

Ask the warehouse to show you where staff record the first parcel of a split order. If WooCommerce Fulfillments is enabled and the team marks records fulfilled at dispatch, a site plugin can listen to woocommerce_fulfillment_after_fulfill. It can queue the fulfillment ID and order ID for a worker. Fulfillment records carry item quantities and can carry tracking. If your staff mark fulfillment at label creation, word the message accordingly or wait for a later carrier signal. Fulfillment overview · Fulfillment hooks

If another extension owns dispatch, verify its documented event with the warehouse. A store can also configure an Order updated webhook in WooCommerce → Settings → Advanced → Webhooks. Verify its signature over the original request body, then read the relevant order and confirm the store’s dispatch condition. An order update alone is too broad. Block checkout can create draft orders, and paid virtual, downloadable orders may reach Completed automatically. Webhook delivery · Order statuses

How do you connect the fulfillment to bitbybit?

The worker reads the fulfillment in WooCommerce, checks that the buyer can receive this update, and sends a template through bitbybit. Keep both credentials on the server. The WooCommerce key reads store data and the bitbybit key authorizes messaging.

  1. Retrieve the order through WooCommerce’s order API or wc_get_order in a plugin. For the built-in fulfillment path, read the matching record under /wp-json/wc/v3/orders/{order_id}/fulfillments. Use a read-only WooCommerce REST key if an external worker needs access. WooCommerce’s order objects work with High-Performance Order Storage. REST authentication · HPOS guidance
  2. Read the allocated line items and confirm at least one requires shipping. Downloadable items can auto-fulfill. Skip any digital-only fulfillment, then match this parcel to its parent order and the buyer who agreed to service updates. Store a unique send record using store, fulfillment ID and notification type. Include only the fulfilled lines and quantities. An empty tracking field calls for an approved template that works without a tracking link.
  3. From the server, call POST /whatsapp/open/v1/messages/send-template on https://api.bitbybit.studio with the workspace’s x-api-key. Use the international recipient digits in to, CRM in template_source, the approved template ID in template_name, and body values in placeholder order in params. Keep the send result with the fulfillment ID and reconcile uncertain outcomes before replaying. bitbybit API authentication · Template request

What should a test order prove?

Fulfill one of two physical items. Expect one message naming only that parcel. Replay the event and expect no extra send. Fulfill the second item and expect a second message. Run a virtual-only order and a physical order with no messaging permission through the same worker. Both should produce zero shipping messages.

How should you map a two-parcel order?

Suppose order W-104 has two beanies and one scarf. The first fulfillment contains one beanie. Give the buyer a reference to W-104 and describe one beanie in that update. Read quantities from the fulfillment record even if the order-level read still shows all three items. When the warehouse packs the remaining beanie and scarf in a second fulfillment, its distinct ID allows one more dispatch update. If the warehouse records label creation and handoff separately, choose the event its staff can consistently verify.

Use a test recipient who can reply. If the buyer asks why the scarf is missing, staff should be able to trace the message to the first fulfillment and see the open line items. The WooCommerce chat setup covers handing that kind of question to a person.

Explore all WooCommerce integration guides.