Preview a base unit replacement
Compute, without writing anything, what happens when a product is replaced by a new one with a different base unit, and mint the impact_token that confirms THAT exact change.
- The base unit of a product with history (stock, movements, presentations, supplier offers or variants with stock) cannot be edited in place: its
base_unit_change.modeisreplacementand the way to change it is to replace the product. - It is a READ — asking twice over the same catalog returns the same token — but it requires
products:write, because the only thing its answer does is authorise an irreversible write. - Send
target_base_unit(one of the nine measure units; a packaging unit such asXPKorXBXcan only be a presentation),equivalence(how many units of the CURRENT base equal ONE unit of the NEW base, e.g.0.001when moving from kg to g because 1 g = 0.001 kg; required between a count unit and a measure unit, in either direction; calculated by itself inside the same measure family; there is none between two different measure families), an optionalbase_priceto confirm, andpresentationswith akeeporretiredecision per presentation of the old product (the ones you omit get the proposed decision). - The answer lists every element of the plan in
items, each with itsbefore, itsafter, itsgroup(review,convertedorcarried) and itsflags(precision_loss,no_equivalence,fraction);items[].refis the public id of the affected element, andnullfor the product itself and for price-list entries and pack components, which have no public id. pending_documentslists the unissued sales documents that will keep pointing at the old product.- The token is a fingerprint of the plan, not a credential: if the catalog, the price lists or the packs change before you confirm, the confirmation is rejected with 422
base_unit_replacement_preview_staleand you ask for a fresh preview. - A product of another company returns 404
product_not_found.
In: header
Path Parameters
Headers
Pin the API version (YYYY-MM-DD, Stripe-style date versioning) for this request; omit to use the key's pinned version, or the latest if none. Unsupported version → 400 unsupported_api_version; malformed → 400 parameter_invalid_format. The effective version is echoed in the Factuarea-Version response header. See the Versioning guide.
dateOperate on behalf of a child company (gestoría master key): pass its public id (UUID v7) and the request runs against that child's data without changing the key's scope, tier or environment (omit to use the key's own company). Invalid UUID → 400 parameter_invalid_uuid; unknown or non-owned id → 404 profile_not_found. See the Acting on behalf guide.
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json