View Categories

Add EAN and GTIN to the WooCommerce REST API

Adding EAN to the WooCommerce REST API lets external systems (ERPs, mobile apps, point of sale, or your own scripts) read and search products and orders by their GTIN. EAN for WooCommerce exposes four free REST API options, all found in the General section.

This is a free feature.

Where to find it #

Go to WPFactory > EAN (also reachable at WooCommerce > Settings > EAN), open the General section, and scroll to the REST API group.

Options #

Label Option ID Default What it does
Products: Add EAN to each product object alg_wc_ean_product_rest No Adds the EAN to each product in product REST responses, for example /wp-json/wc/v3/products/123.
Products: Search by EAN alg_wc_ean_product_search_rest No Enables the ean query parameter, for example /wp-json/wc/v3/products?ean=7980441417892.
Orders: Add EAN to each order object alg_wc_ean_order_items_meta_rest No Adds the EAN to each order in order REST responses, for example /wp-json/wc/v3/orders/465.
Orders: Search by EAN alg_wc_ean_order_items_meta_search_rest No Enables the ean query parameter on orders, for example /wp-json/wc/v3/orders?ean=7980441417892.

Steps #

  1. Tick the options you need in the REST API group.
  2. Click Save changes.
  3. Call the WooCommerce REST API with your API keys. The EAN now appears in the response, and the ean parameter filters results.

Note: to search orders by EAN, the Orders > Add EAN to new order items meta option (alg_wc_ean_order_items_meta) must be enabled first, so the EAN is stored on order items. You can also search products with the standard search parameter once frontend search is on.

Good to know #

  • The EAN is stored in product meta under the _alg_ean key, so other tools that read product meta can also use it.
  • The meta key is configurable at Advanced > Meta key (alg_wc_ean_meta_key) if you need to match another system.

Get more from EAN for WooCommerce #

REST API access is free. EAN for WooCommerce Pro adds 1D and 2D barcode images, PDF label printing, and extra identifier fields per product. See what Pro unlocks.