Integrations
Coming soonWhatsApp order notifications for WooCommerce
Tell customers their order is confirmed, shipped or cancelled in the app they already read, from a number they can reply to.
The Oxtro plugin for WooCommerce is built but not yet listed in the WordPress plugin directory, so you cannot install it today. Until it is listed, the snippet on this page sends the same messages through the Oxtro API.
One message per order status
Write a template for each status you care about, such as confirmed, completed or cancelled, with variables like {{customer_name}} and {{order_number}}. When WooCommerce changes an order status, the matching template goes out.
No duplicate messages
WooCommerce hooks can fire more than once. Each send carries an idempotency key built from the order ID and the status, so a repeat is recognised and nothing is sent twice.
Checkout is never held up
Oxtro queues the message and answers straight away. If the API cannot be reached, the order still goes through.
Customers can reply
Messages come from your own WhatsApp number, linked by QR code. Replies land in the shared team inbox, where your team can answer.
What the plugin will add
A settings screen instead of code: a message per order status with placeholders, an opt-in box at checkout, background sending with retries, and the result written to the order notes.
Phone verification, too
The plugin can also ask customers to confirm their number with a WhatsApp code before they place an order, and let them log in with one.
How it works
Link your number
Create an Oxtro workspace and scan the QR code with the phone that owns your store number.
Write your templates
Add one template per order status in Oxtro, using the variable names from the snippet.
Add the snippet
Put your API key and connection ID in wp-config.php and add the hook to a small plugin.
Works today: a WooCommerce hook
This uses the standard woocommerce_order_status_changed action and the WordPress HTTP API. Billing phone numbers must include the country code.
<?php
// In a small custom plugin, or your theme's functions.php.
// Define OXTRO_API_KEY and OXTRO_CONNECTION_ID in wp-config.php.
add_action('woocommerce_order_status_changed', function ($order_id, $from, $to, $order) {
// Order status => name of a template saved in Oxtro.
$templates = [
'processing' => 'order_confirmed',
'completed' => 'order_completed',
'cancelled' => 'order_cancelled',
];
$phone = $order->get_billing_phone(); // must include the country code
if (!isset($templates[$to]) || !$phone) {
return;
}
wp_remote_post('https://api.getoxtro.com/v1/messages', [
'blocking' => false, // never hold up checkout or the admin screen
'timeout' => 5,
'headers' => [
'Authorization' => 'Bearer ' . OXTRO_API_KEY,
'Content-Type' => 'application/json',
// The same order and status never sends twice, even if the hook fires again.
'Idempotency-Key' => "wc-order-{$order_id}-{$to}",
],
'body' => wp_json_encode([
'connection_id' => OXTRO_CONNECTION_ID,
'to' => $phone,
'template' => [
'name' => $templates[$to],
'variables' => [
'customer_name' => $order->get_billing_first_name(),
'order_number' => $order->get_order_number(),
'total' => $order->get_total() . ' ' . $order->get_currency(),
],
],
]),
]);
}, 10, 4);Questions about WooCommerce
Is there an Oxtro plugin for WooCommerce?
Not yet. The plugin is built and waiting to be listed in the WordPress plugin directory. Today you can send order notifications by adding a short PHP snippet that calls the Oxtro API when an order status changes.
Do I need the WhatsApp Business API or approved templates?
No. You link a WhatsApp number you already own by scanning a QR code. Templates are your own text with variables and need no review. Oxtro is not the official WhatsApp Business Platform, and WhatsApp terms still apply to your number.
What happens if a customer phone number has no country code?
Send numbers in international format. If your checkout collects local numbers, add the country code before calling the API, or the message may be rejected or go to the wrong country.
Will a failed WhatsApp message block an order?
No. The snippet sends without waiting for a response, and Oxtro queues messages instead of sending them during the request. A failure never stops checkout.
Related
Connect your first number today
Create a workspace, scan the QR code and send a message.