CopyHero

Amend Product Change

PATCH
/api/v1/product-changes/{change_id}

Amend a pending product change

Replace the patch and reason of a pending product change; it is diffed and evaluated anew, and approval rules may approve it now. Any API key of the organization may amend; the amending caller becomes the change's proposer, and approval rules judge the amended change by it. 409 when it is no longer pending.

In the patch a null field stays as it is and a list replaces the whole list: variants and images name every variant and image the product keeps, each variant with its full state; options change only together with variants; delete: true stands alone. Prices are decimal strings.

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Path Parameters

change_id*Change Id
Formatuuid

Request Body

application/json
  1. body

Replaces the patch and the reason of an open change.

patch*

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?|null

Response Body

Successful Response

application/json
  1. response

auto_approved: an approval rule approved the change and the apply is on its way; pending: the change waits for a user's decision.

result*Result
Value in"pending""auto_approved"
change*

A product change as an MCP client sees it. A decision by a user stays hidden (pending, no decision fields) until it can no longer be undone. apply_error is set for failed only.

Example Request
curl -X PATCH 'https://app.copyhero.app/api/v1/product-changes/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{  "patch": {}}'
Example Response
{  "result": "pending",  "change": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "status": "pending",    "internal_product_id": "17d65d0a-2bba-46da-af25-e6db2fc23598",    "store_id": 0,    "product_store_link_id": "f7d0a9a7-e8e4-4f5e-9e00-7ea8f5e3b61b",    "change_types": [      "price"    ],    "patch": {      "title": "string",      "body_html": "string",      "vendor": "string",      "product_type": "string",      "tags": [        "string"      ],      "seo_title": "string",      "seo_description": "string",      "options": [        {          "name": "string",          "position": 0,          "values": [            {              "value": "string",              "position": 0            }          ]        }      ],      "variants": [        {          "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": [        {          "src": "string",          "position": 0,          "alt_text": "string"        }      ],      "metafields": [        {          "namespace": "string",          "key": "string",          "type": "string",          "value": "string"        }      ],      "status": "active",      "delete": false    },    "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,    "reason": "string",    "proposer": {      "kind": "api_key",      "api_key_id": "string",      "api_key_name": "string",      "user_id": 0    },    "amended_at": "2019-08-24T14:15:22Z",    "amend_count": 0,    "risk_level": "low",    "risk_raised_from": "low",    "risk_raised_at": "2019-08-24T14:15:22Z",    "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                  }                ]              }            }          ]        }      ]    },    "decided_by_kind": "user",    "decided_at": "2019-08-24T14:15:22Z",    "decline_feedback": "string",    "applied_at": "2019-08-24T14:15:22Z",    "apply_error": "string",    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z"  }}