DEV Community

Cover image for Import WooCommerce prices with their currency minor units intact
Tim Zinin
Tim Zinin

Posted on

Import WooCommerce prices with their currency minor units intact

A catalog importer can fetch the right product and still display the wrong price. Store APIs may represent monetary amounts using integer-like strings plus a currency minor-unit scale. Applying a fixed division by one hundred to every currency makes an assumption the source did not authorize.

WooCommerce Product Catalog Scraper reads bounded public Store API product collections from explicitly permitted origins. It preserves raw prices, currency metadata, stock information and embedded variation identities. It does not accept a WooCommerce consumer key or access the authenticated administration API.

Start with a bounded product sample

The installed schema uses the previously reviewed Porter & York public origin as its example. The input below is illustrative. It does not assert that a new sample was fetched for this article or authorize unrelated use of a store's content. For your own import, supply a store you control or have permission to process.

{
  "storeUrls": [
    "https://porterandyork.com"
  ],
  "maxProductsPerStore": 2,
  "includeDescriptions": false
}
Enter fullscreen mode Exit fullscreen mode

storeUrls accepts one through three origins. A path to a product page is not interchangeable with an origin allowlist entry. maxProductsPerStore ranges from one through one hundred, so the configured result scope remains bounded even for a large catalog.

Preserve raw money before formatting it

Store the raw amount string, currency code and currencyMinorUnit together. Derive a human display value using the supplied scale and a decimal representation suitable for money. Do not replace the raw fields with an imprecise floating-point approximation.

Apply the same policy consistently to current, regular and sale price fields. A missing value should remain missing rather than becoming zero. The consumer can then explain the displayed amount from the source fields instead of relying on an undocumented currency assumption.

Keep parent products and variations separate

The paid result unit is a complete parent product. Embedded variation metadata can describe variation identities and attributes without becoming a separate live quotation for every option. Do not multiply the result count by the number of embedded variation records.

Retain the source product ID and permitted store origin together. Product IDs may collide across stores. If your internal PIM has different identifiers, create an explicit mapping instead of assuming that a source ID is globally unique.

Observe the source boundary

The Actor uses the fixed public products collection route and robots policy checks. Product permalinks and image URLs are evidence fields, not instructions to fetch additional pages. The contract excludes cart, checkout, customer and order access.

When includeDescriptions is enabled, descriptions remain untrusted HTML strings from the API. Treat them as data and apply your application's rendering policy before showing them. Disabling descriptions is a useful default when only price and stock evidence are needed.

Distinguish a sample from a complete catalog

Complete products can remain useful when the selected cap or a later source problem leaves more catalog scope unprocessed. Keep the separate partial notice. A two-product sample proves what those two records contained, not that the store has only two products.

Before replacing a complete internal catalog, require the coverage evidence your own integration needs. Otherwise stage the bounded import as a sample or an enrichment feed. The result is a monetary and identity model that remains inspectable even when the surrounding source coverage is intentionally limited.

Cost and verification scope

The current FREE-tier result price is $0.001 for the documented unit: One WooCommerce product from the public Store API with prices and images. The listing also has a $0.003 start event, charged per GB of Actor memory with a minimum of one event. A free diagnostic row does not refund that start event. Discounted platform tiers have their own rates; inspect your applicable tier before estimating a batch. These are listing prices read on 21 October 2026, not a receipt or a claim about customer spending.

The contract for this draft was checked against installed build 0.1.4 (5ffellfwbcrTy0TGg). The input above is an illustrative schema example, not a newly executed run. Current source responses and useful output still need inspection when you choose to run it. No new cloud build or run was made to prepare this article.

Open the Actor and inspect its input and pricing.

AI-assisted draft; publication requires independent technical review.

Top comments (0)