Rest API Introduction

API & Webhooks Integration
Updated Nov 8, 20262 min read

The REST API PRO lets another system, such as a warehouse system, a till (POS) or an ERP, read and change your stock and prices per store. It uses ordinary web requests, so most tools can connect to it. The free plugin has no API.

The basics

  • Base address: https://example.com/wp-json/mulopimfwc/v1, shown on the settings screen as API Base URL.
  • Key: send it in the X-API-Key header.
  • Webhook: one route also accepts the webhook secret, in X-Webhook-Secret.
API and Webhooks Configuration with API Base URL and API Key

The routes

Method and routeWhat it doesGuide
GET /locationsLists your stores.Get locations
GET /productsLists products.Get products
GET /inventory/exportExports stock and prices per store.JSON export, CSV export
POST /inventory/updateChanges one product at one store.Single update
POST /inventory/bulk-syncChanges many at once.Bulk sync
POST /webhook/inventory-updateLets another system push stock.Webhook

A full OpenAPI 3 description is linked on the settings screen as “OpenAPI 3 specification (JSON)”.

The fields you can send

FieldWhat it is
product_id or skuThe product. For a variable product, use the variation’s ID or SKU, not the parent’s.
location_id or location_slugThe store.
stockThe stock at that store.
regular_price, sale_pricePrices at that store.
backordersWhether that store allows backorders.
disabledTurns the product off at that store.
assignedAdds or removes the product from that store.

A good way to start

  1. Create an API key.
  2. Call GET /locations to get your store IDs or slugs.
  3. Call GET /inventory/export to get product and variation IDs.
  4. Try a single update on a staging copy of your site.
  5. Move on to bulk sync or the webhook.

A bulk request can hold up to 1000 items. If more than half are invalid, nothing is changed, so a bad file cannot damage your stock.

Errors use the WordPress format: {"code":"...","message":"...","data":{"status":400}}. A wrong or missing key always returns 403, with the code rest_forbidden.

Common errors

StatusUsual cause
403Wrong header name, or a wrong, revoked or missing key.
400A product or store was not found, or a value is not valid.
404A wrong address. Check /wp-json/mulopimfwc/v1/.

To see webhook requests, tick Log Webhooks while you troubleshoot. Logs are under WooCommerce > Status > Logs.