Preflight Product Change
Preview a product change
Dry run of proposing a product change: the diff, change types and what the approval rules would decide. Nothing is stored.
HTTPBearerAuthorizationBearer <token>application/json- body
internal_product_id*Internal Product Iduuidstore_id*Store Idpatch*The change a client proposes, on the fields of InternalProductUpdateRequest:
null leaves a field alone, a list replaces the whole list. Metafields are not in
the product document, so they are set or deleted one namespace.key at a time.
delete removes the product and stands alone.
reason?|Why the change is proposed; shown to the user who decides.
Successful Response
application/json- response
What creating the change would answer; nothing is stored.
result*Result"pending""auto_approved"change_types*array<>diff*product_change.diff: old and new value of every field the change touches,
computed against base_revision_number; variants and images per element.
base_revision_number*Base Revision Numberrisk_level*|nullevaluation*product_change.evaluation and the rule result of pchange.api.evaluate.
risk_level is null for auto_approve; order_data_missing marks an
auto_approve lowered to manual_low because the store has no order data.
curl -X POST 'https://app.copyhero.app/api/v1/product-changes/preflight' \ -H 'Content-Type: application/json' \ -d '{ "internal_product_id": "17d65d0a-2bba-46da-af25-e6db2fc23598", "store_id": 0, "patch": {}}'{ "result": "pending", "change_types": [ "price" ], "diff": { "fields": [ { "field": "title", "old": null, "new": null } ], "variants": [ { "ref": { "key": "string", "sku": "string", "option_values": [ { "name": "string", "value": "string" } ], "create": true }, "old": { "sku": "string", "price": "string", "compare_at_price": "string", "option_values": [ { "name": "string", "value": "string" } ], "image_src": "string", "metafields": [ { "namespace": "string", "key": "string", "type": "string", "value": "string" } ] }, "new": { "sku": "string", "price": "string", "compare_at_price": "string", "option_values": [ { "name": "string", "value": "string" } ], "image_src": "string", "metafields": [ { "namespace": "string", "key": "string", "type": "string", "value": "string" } ] } } ], "images": [ { "ref": { "key": "string", "shopify_id": "string", "url": "string", "create": true }, "old": { "src": "string", "position": 0, "alt_text": "string" }, "new": { "src": "string", "position": 0, "alt_text": "string" } } ] }, "base_revision_number": 0, "risk_level": "low", "evaluation": { "outcome": "auto_approve", "risk_level": "low", "order_data_missing": true, "change_types": [ { "change_type": "price", "outcome": "auto_approve", "winner_rule_id": "a0d63d6e-eec1-49e2-b3f1-596e5cd260a6", "rules": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "outcome": "auto_approve", "change_types": [ "price" ], "conditions": { "v": 1, "all": [ { "field": "string", "op": "string", "value": null } ] } } ] } ] }}List Product Changes GET
List product changes Product changes of the organization, newest first. A user's decision shows as `pending` until it can no longer be undone (35 seconds).
Read Product Change GET
Read a product change One product change. A user's decision shows as `pending` until it can no longer be undone (35 seconds).