Skip to main content

Undo Lifecycle Change

POST 

/api/v2/products/lifecycle/transitions/:transition/undo

Reverse a lifecycle change and restore the previous state, reason, note and dates. The whole change is undone together: every product moved by the same operation (a matrix parent and the variants that moved with it, or a variant and its re-derived parent) is reverted in one step, or none is. Matrix parents of the reverted products that were not part of the change are re-derived afterwards. A history entry with source undo is recorded for each product. No body.

Required scope: products:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Refused with 422 (field transition) when, for the given change or any product in it (messages about another product start with "Another product in this change (<SKU>): "):

  • "An undo cannot itself be undone. Change the lifecycle instead."
  • "This change cannot be undone. Change its lifecycle instead."
  • "This change moved the product out of a state that was deleted, so it cannot be undone. Change its lifecycle instead."
  • "This change has already been undone."
  • "Changes can only be undone within 24 hours."
  • "The product has changed again since, so this change can no longer be undone. Change its lifecycle instead."
  • "The sell-out action has already run for this product, so it cannot be undone. Reactivate it instead."
  • "The sell-out action has already ended at least one of its listings, so this change cannot be undone. Reactivate it instead."
  • "The state this change would return to ("<key>") no longer exists. Change the lifecycle instead."
  • "This change no longer exists." / "A product in this change no longer exists, so it cannot be undone."
  • "The sell-out action is running for <SKU> right now, so its lifecycle cannot change yet. Try again in a few minutes."

Response: data is the undo transition of the requested change's product (id, product_id, product_sku, from_state, from_state_label, to_state, to_state_label, reason, reason_label, note, source, source_label, user, on_hand_units, on_hand_value, tracked_job_id, created_at, undone_at, undoable); product next to it is the product's updated lifecycle (same fields as Get Product Lifecycle).

Requires a Bearer token with the products read/write scope and the products.manage_lifecycle permission.

Request​

Responses​

OK

Response Headers
    Content-Type