---
title: Get a deep diff between two entity versions or draft vs published.
slug: api-documentation/get-a-deep-diff-between-two-entity-versions-or-draft-vs-published
docTags: 
createdAt: 2026-08-27T17:04:59.993Z
---

{
  "id": "Hs_nFPqqylEOnuJ6tx1LR",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.upstartcommerce.com/pim/diff",
    "servers": [
      {
        "url": "https://api.upstartcommerce.com/pim/diff"
      }
    ],
    "name": "Get a deep diff between two entity versions or draft vs published.",
    "description": "<p>Returns a deep diff between two versions of a product or variant, or between the latest published version and the current draft.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [
        {
          "kind": "required",
          "name": "entity_type",
          "type": "string",
          "description": "Type of entity to diff.",
          "enum": [
            "product",
            "variant"
          ]
        },
        {
          "kind": "required",
          "name": "entity_id",
          "type": "string",
          "description": "ID of the product or variant."
        },
        {
          "kind": "required",
          "name": "mode",
          "type": "string",
          "description": "<p>Diff mode - compare two versions or draft vs latest published.</p>",
          "enum": [
            "version",
            "draft"
          ]
        },
        {
          "kind": "optional",
          "name": "from_version",
          "type": "integer",
          "description": "<p>Base (older) version number. Required when mode=version.</p>",
          "minimum": 1
        },
        {
          "kind": "optional",
          "name": "to_version",
          "type": "integer",
          "description": "<p>Target (newer) version number. Required when mode=version.</p>",
          "minimum": 1
        },
        {
          "kind": "optional",
          "name": "fields",
          "type": "string",
          "description": "<p>Comma-separated list of fields to include in the diff.</p>"
        },
        {
          "kind": "optional",
          "name": "ignore_fields",
          "type": "string",
          "description": "<p>Comma-separated list of fields to exclude from the diff.</p>"
        },
        {
          "kind": "optional",
          "name": "page",
          "type": "integer",
          "description": "Page number for pagination.",
          "default": 1,
          "minimum": 1
        },
        {
          "kind": "optional",
          "name": "page_size",
          "type": "integer",
          "description": "Number of diff entries per page.",
          "default": 50,
          "minimum": 1,
          "maximum": 200
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "NoChannelPortalAccess",
          "name": "NoChannelPortalAccess",
          "kind": "optional",
          "type": "http",
          "description": "<p>(DEPRECATED) This authentication is required for clients to interact with any of the management APIs. Similar to 'LoggedIn', it indicates that the user has actually logged into the system, but in this case with a management role.</p>",
          "scheme": "bearer"
        },
        {
          "id": "ApiKeyAccess",
          "name": "X-Upstart-Api-Key",
          "kind": "optional",
          "type": "apiKey",
          "description": "Api key based authorization.",
          "in": "header"
        },
        {
          "id": "SessionIdAccess",
          "name": "X-Upstart-Session-Id",
          "kind": "optional",
          "type": "apiKey",
          "description": "<p>Session based authorization. This authentication is required for clients to interact with any of the management APIs. Similar to 'LoggedIn', it indicates that the user has actually logged into the system, but in this case with a management role.</p>",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Diff result.",
        "jsonExample": "",
        "isExpanded": true,
        "headers": [
          {
            "kind": "optional",
            "name": "Allow",
            "description": ""
          },
          {
            "kind": "optional",
            "name": "ETag",
            "description": ""
          },
          {
            "kind": "optional",
            "name": "Cache-Control",
            "description": ""
          },
          {
            "kind": "optional",
            "name": "Content-Type",
            "description": ""
          },
          {
            "kind": "optional",
            "name": "Location",
            "description": ""
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "422",
        "description": "Unprocessable entity.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [],
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "cjQYq8lTM_73tu514dHKg",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url 'https://api.upstartcommerce.com/pim/diff?entity_type=product&entity_id=string&mode=version&page=1&page_size=50' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "WunEdVrAQqxjD230Me5ZG",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.upstartcommerce.com/pim/diff?entity_type=product&entity_id=string&mode=version&page=1&page_size=50\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "aNoqnAnNgHQ53Zx1I1qP2",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.upstartcommerce.com/pim/diff?entity_type=product&entity_id=string&mode=version&page=1&page_size=50\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "JsHqMdxsSckA7oIACLR88",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.upstartcommerce.com/pim/diff?entity_type=product&entity_id=string&mode=version&page=1&page_size=50\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "cjQYq8lTM_73tu514dHKg"
    },
    "results": {
      "languages": [
        {
          "id": "5abOGgt75PbAPMpjWHADy",
          "language": "200",
          "code": "// Diff result.\n{}"
        },
        {
          "id": "aazzloC8POwv0OoRx738T",
          "language": "422",
          "code": "// Unprocessable entity.\n{}"
        }
      ],
      "selectedLanguageId": "5abOGgt75PbAPMpjWHADy"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}