How to sync stock levels and order statuses from keyCRM to WordPress

Learn how to send stock levels and order status changes from keyCRM to your WooCommerce store and check the plugin logs.
Written by keyCRM
Updated 1 week ago

Sync stock levels and order statuses to keep your WooCommerce store up to date, prevent sales errors, and automate order processing.

Check your plugin version. Make sure you have version 1.0.24 or later of the WooCommerce plugin. Update the plugin if you have an earlier version.

Update order statuses in WooCommerce from keyCRM

keyCRM maps its order status groups to the standard WooCommerce statuses.

Note: The plugin updates the order status directly in the database. Standard WooCommerce events and hooks do not run. Any actions you have set up to run on a status change, such as email notifications, will not run either. You can set up automatic emails in keyCRM.

To set up order status updates:

  1. In the plugin settings, go to Webhook settings → Order status updates and select Enable order status webhook.
  2. Copy the URL from the Webhook URL field and save the plugin settings.Order status webhook settings in the WooCommerce plugin
  3. Create a trigger in keyCRM and configure it as follows:
    • Event: Select Order → Status change.
    • Value: Select the statuses that should trigger an update on your website.
    • Time: Select Immediately.
    • Conditions: Select the order source for your WooCommerce store.
    • Action: Select Send HTTP request. Paste the URL you copied in step 2 into the webhook URL field, and select POST as the HTTP method.

    You can add more actions if needed.

Save the trigger. When an order from the selected source moves to one of the statuses you selected in Value, keyCRM sends the update to your store.

Update stock levels in WooCommerce from keyCRM

Stock updates use SKUs. Before you start, make sure the SKUs for products and variants match in WooCommerce and keyCRM. Enable stock management in WooCommerce for each product, or at the variant level for products with variants.

To set up stock updates:

  1. In the plugin settings, go to Webhook settings → Stock updates and select Enable stock update webhook.
  2. Copy the URL from the Webhook URL field and save the plugin settings.Stock update webhook settings in the WooCommerce plugin
  3. In keyCRM, go to Settings → Products → Stocks. In the Webhooks section, click + Add Webhook and complete these fields:
    • Name: Enter a name that identifies the store receiving the updates.
    • Webhook URL: Paste the URL you copied in step 2.
    • Warehouses: Select the warehouse you want to send stock levels from. If you select multiple warehouses, keyCRM adds their stock levels together. Leave the field blank to send the total across all warehouses.
    Click Add to add the webhook to the list. You can edit or delete it there. Click Save at the bottom of the page to start sending stock updates.

Check the order status and stock update logs

Go to WooCommerce → Status → Logs to see the changes recorded by the plugin. The plugin creates a daily keycrm log. Open the log for the day when the stock update was sent or the product or variant was created.

Example log entries:

  • Order 1296 status updated to 'completed' shows the WooCommerce order number and the new status. The status in quotes depends on the update sent.
  • Stock update completed. Updated: 0, Failed: 2 shows how many stock updates succeeded and how many failed.
Note: If updates do not reach WooCommerce and the logs show no incoming requests, your server or a security service such as Cloudflare may be blocking the webhook. Add an allow rule for /wp-json/keycrm/v1/webhook. If someone else manages your site security, ask your developer or hosting provider to add the rule.

Example WooCommerce plugin logs

Your WooCommerce store can now receive current order statuses and stock levels from keyCRM.

Tags: order status sync, order status updates, WordPress, WooCommerce, stock levels, stock updates, inventory sync, stock API, product sync, webhooks
Did this answer your question?