Hi,
We're building a custom importer that creates WooCommerce products/variations via the REST API, and we need to set the purchase price on variations through the API. However, the "purchase_price" field never shows up anywhere for us.
I found an older forum answer stating this is usually caused by either (a) the Purchase Orders module being disabled, or (b) the requesting user lacking permission. I checked both before posting, and neither applies here:
Module disabled? No — "ATUM API" and "Purchase Orders" are both enabled under ATUM Settings >> Modules. I also activated "Purchase Orders PRO" to rule that out too — same result.
User without permission? No — I confirmed via GET /wp-json/wp/v2/users/me?context=edit that the authenticated user has role "administrator" and both of these capabilities are true:
- atum_view_purchase_price
- atum_edit_purchase_price
Despite that, "purchase_price" does not appear anywhere in the variation schema. I checked this with a full OPTIONS request (not just searching for the field name), against both API versions:
OPTIONS /wp-json/wc/v3/products/<id>/variations/<id>
OPTIONS /wp-json/wc/v2/products/<id>/variations/<id>
Both return the full property list (90 fields total), including other ATUM fields like "barcode", "supplier_id", "supplier_sku", "atum_controlled", "atum_stock_status" — but no "purchase_price" or "cost_price" field at all, in either API version.
Setup / what we tested:
- WooCommerce REST API, authenticated with a WooCommerce Consumer Key/Secret (Shop Manager account) — no purchase_price.
- Same endpoints re-tested with WP Application Password Basic Auth on an actual Administrator account — same result, still no purchase_price.
- ATUM Free + Purchase Orders PRO (just activated for this test).
Since both of the usual causes are ruled out, is there anything else that could hide this field from the schema, or a way to debug/log this further on our end? Happy to provide more details (site URL, plugin versions, etc.) if useful.
Thanks!