QuackAPI with WooCommerce

There is no QuackAPI plugin. WooCommerce fires a PHP action when an order changes status, and one HTTP call sends the message.

Snippet

  • Add it with a code-snippets plugin or your child theme's functions.php.
  • Define QUACKAPI_KEY in wp-config.php so the key is not in the snippet.
  • The billing phone must include the country code. Collect it that way at checkout.
PHP
add_action('woocommerce_order_status_processing', function ($order_id) {
  $order = wc_get_order($order_id);
  $phone = preg_replace('/\D/', '', $order->get_billing_phone());
  if (!$phone) return;
  wp_remote_post('https://quackapi.com/v1/messages/chat', [
    'headers' => ['x-api-key' => QUACKAPI_KEY, 'Content-Type' => 'application/json'],
    'body' => wp_json_encode([
      'deviceId' => 1,
      'to' => $phone,
      'body' => 'Hi ' . $order->get_billing_first_name() . ', we received order #' . $order->get_order_number() . '. Thank you!',
    ]),
    'timeout' => 15,
  ]);
});

Other statuses

Use woocommerce_order_status_completed for a shipped or delivered message. WooCommerce also has built-in webhooks under Settings, Advanced, Webhooks. Those post to a URL you control, so pair them with n8n, Make or Zapier if you prefer no code.

Keep in mind

Only message customers who gave their number for order updates. Keep the message useful and short, and do not use it for unrelated promotion.

Related

Last reviewed 2026-11-09. QuackAPI is an unofficial linked-device service. Acceptable use