curl --request POST \
--url https://api.hubapi.com/crm-objects/v1/objects/products/batch-update
"\nExample POST URL:\nhttps://api.hubapi.com/crm-objects/v1/objects/products/batch-update\n\nExample POST data (updating 2 properties each for 2 products):\n[\n {\n \"objectId\": 1642796,\n \"properties\": [\n {\n \"name\": \"price\",\n \"value\": \"85.00\"\n },\n {\n \"name\": \"description\",\n \"value\": \"This is an updated product, it's getting a price change.\"\n }\n ]\n },\n {\n \"objectId\": 1645187,\n \"properties\": [\n {\n \"name\": \"name\",\n \"value\": \"Updated product name now with discount\"\n },\n {\n \"name\": \"discount\",\n \"value\": \"20\"\n }\n ]\n }\n]\n\nExample Response:\n[\n {\n \"objectType\": \"PRODUCT\",\n \"portalId\": 62515,\n \"objectId\": 1642796,\n \"properties\": {\n \"hs_lastmodifieddate\": {\n \"versions\": [\n {\n \"name\": \"hs_lastmodifieddate\",\n \"value\": \"0\",\n \"timestamp\": 0,\n \"source\": \"CALCULATED\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"0\",\n \"timestamp\": 0,\n \"source\": \"CALCULATED\",\n \"sourceId\": null\n },\n \"price\": {\n \"versions\": [\n {\n \"name\": \"price\",\n \"value\": \"85.00\",\n \"timestamp\": 1525292253568,\n \"source\": \"API\",\n \"sourceVid\": []\n },\n {\n \"name\": \"price\",\n \"value\": \"75.00\",\n \"timestamp\": 1525289943771,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"85.00\",\n \"timestamp\": 1525292253568,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"description\": {\n \"versions\": [\n {\n \"name\": \"description\",\n \"value\": \"This is an updated product, it's getting a price change.\",\n \"timestamp\": 1525292253568,\n \"source\": \"API\",\n \"sourceVid\": []\n },\n {\n \"name\": \"description\",\n \"value\": \"A description the second new product.\",\n \"timestamp\": 1525289943771,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"This is an updated product, it's getting a price change.\",\n \"timestamp\": 1525292253568,\n \"source\": \"API\",\n \"sourceId\": null\n }\n },\n \"version\": 0,\n \"isDeleted\": false\n },\n {\n \"objectType\": \"PRODUCT\",\n \"portalId\": 62515,\n \"objectId\": 1645187,\n \"properties\": {\n \"hs_lastmodifieddate\": {\n \"versions\": [\n {\n \"name\": \"hs_lastmodifieddate\",\n \"value\": \"0\",\n \"timestamp\": 0,\n \"source\": \"CALCULATED\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"0\",\n \"timestamp\": 0,\n \"source\": \"CALCULATED\",\n \"sourceId\": null\n },\n \"name\": {\n \"versions\": [\n {\n \"name\": \"name\",\n \"value\": \"Updated product name now with discount\",\n \"timestamp\": 1525292253568,\n \"source\": \"API\",\n \"sourceVid\": []\n },\n {\n \"name\": \"name\",\n \"value\": \"Another new product\",\n \"timestamp\": 1525289943771,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"Updated product name now with discount\",\n \"timestamp\": 1525292253568,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"discount\": {\n \"versions\": [\n {\n \"name\": \"discount\",\n \"value\": \"20\",\n \"timestamp\": 1525292253568,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"20\",\n \"timestamp\": 1525292253568,\n \"source\": \"API\",\n \"sourceId\": null\n }\n },\n \"version\": 0,\n \"isDeleted\": false\n }\n]"
Update an existing product by its ID. The request body must be a list of properties you want to update, with each entry including the internal name of the property you want to update, and the new value for that property. See the example for details.
curl --request POST \
--url https://api.hubapi.com/crm-objects/v1/objects/products/batch-update
"\nExample POST URL:\nhttps://api.hubapi.com/crm-objects/v1/objects/products/batch-update\n\nExample POST data (updating 2 properties each for 2 products):\n[\n {\n \"objectId\": 1642796,\n \"properties\": [\n {\n \"name\": \"price\",\n \"value\": \"85.00\"\n },\n {\n \"name\": \"description\",\n \"value\": \"This is an updated product, it's getting a price change.\"\n }\n ]\n },\n {\n \"objectId\": 1645187,\n \"properties\": [\n {\n \"name\": \"name\",\n \"value\": \"Updated product name now with discount\"\n },\n {\n \"name\": \"discount\",\n \"value\": \"20\"\n }\n ]\n }\n]\n\nExample Response:\n[\n {\n \"objectType\": \"PRODUCT\",\n \"portalId\": 62515,\n \"objectId\": 1642796,\n \"properties\": {\n \"hs_lastmodifieddate\": {\n \"versions\": [\n {\n \"name\": \"hs_lastmodifieddate\",\n \"value\": \"0\",\n \"timestamp\": 0,\n \"source\": \"CALCULATED\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"0\",\n \"timestamp\": 0,\n \"source\": \"CALCULATED\",\n \"sourceId\": null\n },\n \"price\": {\n \"versions\": [\n {\n \"name\": \"price\",\n \"value\": \"85.00\",\n \"timestamp\": 1525292253568,\n \"source\": \"API\",\n \"sourceVid\": []\n },\n {\n \"name\": \"price\",\n \"value\": \"75.00\",\n \"timestamp\": 1525289943771,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"85.00\",\n \"timestamp\": 1525292253568,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"description\": {\n \"versions\": [\n {\n \"name\": \"description\",\n \"value\": \"This is an updated product, it's getting a price change.\",\n \"timestamp\": 1525292253568,\n \"source\": \"API\",\n \"sourceVid\": []\n },\n {\n \"name\": \"description\",\n \"value\": \"A description the second new product.\",\n \"timestamp\": 1525289943771,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"This is an updated product, it's getting a price change.\",\n \"timestamp\": 1525292253568,\n \"source\": \"API\",\n \"sourceId\": null\n }\n },\n \"version\": 0,\n \"isDeleted\": false\n },\n {\n \"objectType\": \"PRODUCT\",\n \"portalId\": 62515,\n \"objectId\": 1645187,\n \"properties\": {\n \"hs_lastmodifieddate\": {\n \"versions\": [\n {\n \"name\": \"hs_lastmodifieddate\",\n \"value\": \"0\",\n \"timestamp\": 0,\n \"source\": \"CALCULATED\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"0\",\n \"timestamp\": 0,\n \"source\": \"CALCULATED\",\n \"sourceId\": null\n },\n \"name\": {\n \"versions\": [\n {\n \"name\": \"name\",\n \"value\": \"Updated product name now with discount\",\n \"timestamp\": 1525292253568,\n \"source\": \"API\",\n \"sourceVid\": []\n },\n {\n \"name\": \"name\",\n \"value\": \"Another new product\",\n \"timestamp\": 1525289943771,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"Updated product name now with discount\",\n \"timestamp\": 1525292253568,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"discount\": {\n \"versions\": [\n {\n \"name\": \"discount\",\n \"value\": \"20\",\n \"timestamp\": 1525292253568,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"20\",\n \"timestamp\": 1525292253568,\n \"source\": \"API\",\n \"sourceId\": null\n }\n },\n \"version\": 0,\n \"isDeleted\": false\n }\n]"
Successful response - Update an existing product by its ID
The response is of type object
.
Was this page helpful?