Create Product Changes
Propose several product changes
Propose several product changes; each entry becomes its own change and gets its own result, so a failing entry leaves the others stored.
HTTPBearerAuthorizationBearer <token>application/json- body
entries*array<>1 <= items <= 50Successful Response
application/json- response
results*array<>curl -X POST 'https://app.copyhero.app/api/v1/product-changes/batch' \ -H 'Content-Type: application/json' \ -d '{ "entries": [ { "internal_product_id": "17d65d0a-2bba-46da-af25-e6db2fc23598", "store_id": 0, "patch": {} } ]}'{ "results": [ { "index": 0, "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" }, "error": { "code": "not_found", "message": "string", "open_change_id": "7d4506b7-a63b-48c7-9842-d6c0c941e898", "mapping": { "element": "variant", "key": "string", "reason": "no_match" } } } ]}Create Product Change POST
Propose a product change Propose a change to one product in one store. Approval rules decide: `auto_approved` means the change is applied to Shopify now, `pending` that it waits for a user in Pending changes. 409 carries the id of the open change (one per product and store: amend or withdraw it); 422 with `mapping_ambiguous` names the element Shopify cannot match. 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.
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).