CopyHero

Create Product Changes

POST
/api/v1/product-changes/batch

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.

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Request Body

application/json
  1. body
entries*array<>
Items1 <= items <= 50

Response Body

Successful Response

application/json
  1. response
results*array<>
Example Request
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": {}    }  ]}'
Example Response
{  "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"        }      }    }  ]}