curl --request POST \
--url https://api.hubapi.com/crm-objects/v1/objects/line_items/batch-create
"\nExample POST URL:\nhttps://api.hubapi.com/crm-objects/v1/objects/line_items/batch-create\n\nExample POST JSON (creating two line items):\n[\n [\n {\n \"name\": \"hs_product_id\",\n \"value\": \"1645342\"\n },\n {\n \"name\": \"quantity\",\n \"value\": \"25\"\n },\n {\n \"name\": \"name\",\n \"value\": \"A custom name for the product for this line item.\"\n }\n ],\n [\n {\n \"name\": \"hs_product_id\",\n \"value\": \"1645187\"\n },\n {\n \"name\": \"quantity\",\n \"value\": \"25\"\n },\n {\n \"name\": \"price\",\n \"value\": \"9.00\"\n },\n {\n \"name\": \"name\",\n \"value\": \"Widgets, special discount price\"\n }\n ]\n]\n\nExample response:\n[\n {\n \"objectType\": \"LINE_ITEM\",\n \"portalId\": 62515,\n \"objectId\": 9845651,\n \"properties\": {\n \"amount\": {\n \"versions\": [\n {\n \"name\": \"amount\",\n \"value\": \"687.50\",\n \"timestamp\": 0,\n \"sourceId\": \"LineItemAmountCalculator\",\n \"source\": \"CALCULATED\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"687.50\",\n \"timestamp\": 0,\n \"source\": \"CALCULATED\",\n \"sourceId\": \"LineItemAmountCalculator\"\n },\n \"quantity\": {\n \"versions\": [\n {\n \"name\": \"quantity\",\n \"value\": \"25\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"25\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceId\": null\n },\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\": \"27.50\",\n \"timestamp\": 1525299376761,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"27.50\",\n \"timestamp\": 1525299376761,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"name\": {\n \"versions\": [\n {\n \"name\": \"name\",\n \"value\": \"A custom name for the product for this line item.\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"A custom name for the product for this line item.\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"createdate\": {\n \"versions\": [\n {\n \"name\": \"createdate\",\n \"value\": \"0\",\n \"timestamp\": 0,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"0\",\n \"timestamp\": 0,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"description\": {\n \"versions\": [\n {\n \"name\": \"description\",\n \"value\": \"A description of this product.\",\n \"timestamp\": 1525299376761,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"A description of this product.\",\n \"timestamp\": 1525299376761,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"hs_product_id\": {\n \"versions\": [\n {\n \"name\": \"hs_product_id\",\n \"value\": \"1645342\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"1645342\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"recurringbillingfrequency\": {\n \"versions\": [\n {\n \"name\": \"recurringbillingfrequency\",\n \"value\": \"quarterly\",\n \"timestamp\": 1525299376761,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"quarterly\",\n \"timestamp\": 1525299376761,\n \"source\": \"API\",\n \"sourceId\": null\n }\n },\n \"version\": 0,\n \"isDeleted\": false\n },\n {\n \"objectType\": \"LINE_ITEM\",\n \"portalId\": 62515,\n \"objectId\": 9867373,\n \"properties\": {\n \"amount\": {\n \"versions\": [\n {\n \"name\": \"amount\",\n \"value\": \"-275.00\",\n \"timestamp\": 0,\n \"sourceId\": \"LineItemAmountCalculator\",\n \"source\": \"CALCULATED\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"-275.00\",\n \"timestamp\": 0,\n \"source\": \"CALCULATED\",\n \"sourceId\": \"LineItemAmountCalculator\"\n },\n \"quantity\": {\n \"versions\": [\n {\n \"name\": \"quantity\",\n \"value\": \"25\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"25\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceId\": null\n },\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\": \"9.00\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"9.00\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"name\": {\n \"versions\": [\n {\n \"name\": \"name\",\n \"value\": \"Widgets, special discount price\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"Widgets, special discount price\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"createdate\": {\n \"versions\": [\n {\n \"name\": \"createdate\",\n \"value\": \"0\",\n \"timestamp\": 0,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"0\",\n \"timestamp\": 0,\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 \"description\": {\n \"versions\": [\n {\n \"name\": \"description\",\n \"value\": \"A description of yet another product.\",\n \"timestamp\": 1525289943771,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"A description of yet another product.\",\n \"timestamp\": 1525289943771,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"hs_product_id\": {\n \"versions\": [\n {\n \"name\": \"hs_product_id\",\n \"value\": \"1645187\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"1645187\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"recurringbillingfrequency\": {\n \"versions\": [\n {\n \"name\": \"recurringbillingfrequency\",\n \"value\": \"annually\",\n \"timestamp\": 1525289943771,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"annually\",\n \"timestamp\": 1525289943771,\n \"source\": \"API\",\n \"sourceId\": null\n }\n },\n \"version\": 0,\n \"isDeleted\": false\n }\n]"
Update a group of existing line items. Up to 100 line items can be updated in a single request. The request body will be an array, with each element containing the ID of the line item to update and a list of properties to update for that line item. See the examples for details.
curl --request POST \
--url https://api.hubapi.com/crm-objects/v1/objects/line_items/batch-create
"\nExample POST URL:\nhttps://api.hubapi.com/crm-objects/v1/objects/line_items/batch-create\n\nExample POST JSON (creating two line items):\n[\n [\n {\n \"name\": \"hs_product_id\",\n \"value\": \"1645342\"\n },\n {\n \"name\": \"quantity\",\n \"value\": \"25\"\n },\n {\n \"name\": \"name\",\n \"value\": \"A custom name for the product for this line item.\"\n }\n ],\n [\n {\n \"name\": \"hs_product_id\",\n \"value\": \"1645187\"\n },\n {\n \"name\": \"quantity\",\n \"value\": \"25\"\n },\n {\n \"name\": \"price\",\n \"value\": \"9.00\"\n },\n {\n \"name\": \"name\",\n \"value\": \"Widgets, special discount price\"\n }\n ]\n]\n\nExample response:\n[\n {\n \"objectType\": \"LINE_ITEM\",\n \"portalId\": 62515,\n \"objectId\": 9845651,\n \"properties\": {\n \"amount\": {\n \"versions\": [\n {\n \"name\": \"amount\",\n \"value\": \"687.50\",\n \"timestamp\": 0,\n \"sourceId\": \"LineItemAmountCalculator\",\n \"source\": \"CALCULATED\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"687.50\",\n \"timestamp\": 0,\n \"source\": \"CALCULATED\",\n \"sourceId\": \"LineItemAmountCalculator\"\n },\n \"quantity\": {\n \"versions\": [\n {\n \"name\": \"quantity\",\n \"value\": \"25\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"25\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceId\": null\n },\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\": \"27.50\",\n \"timestamp\": 1525299376761,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"27.50\",\n \"timestamp\": 1525299376761,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"name\": {\n \"versions\": [\n {\n \"name\": \"name\",\n \"value\": \"A custom name for the product for this line item.\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"A custom name for the product for this line item.\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"createdate\": {\n \"versions\": [\n {\n \"name\": \"createdate\",\n \"value\": \"0\",\n \"timestamp\": 0,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"0\",\n \"timestamp\": 0,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"description\": {\n \"versions\": [\n {\n \"name\": \"description\",\n \"value\": \"A description of this product.\",\n \"timestamp\": 1525299376761,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"A description of this product.\",\n \"timestamp\": 1525299376761,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"hs_product_id\": {\n \"versions\": [\n {\n \"name\": \"hs_product_id\",\n \"value\": \"1645342\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"1645342\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"recurringbillingfrequency\": {\n \"versions\": [\n {\n \"name\": \"recurringbillingfrequency\",\n \"value\": \"quarterly\",\n \"timestamp\": 1525299376761,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"quarterly\",\n \"timestamp\": 1525299376761,\n \"source\": \"API\",\n \"sourceId\": null\n }\n },\n \"version\": 0,\n \"isDeleted\": false\n },\n {\n \"objectType\": \"LINE_ITEM\",\n \"portalId\": 62515,\n \"objectId\": 9867373,\n \"properties\": {\n \"amount\": {\n \"versions\": [\n {\n \"name\": \"amount\",\n \"value\": \"-275.00\",\n \"timestamp\": 0,\n \"sourceId\": \"LineItemAmountCalculator\",\n \"source\": \"CALCULATED\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"-275.00\",\n \"timestamp\": 0,\n \"source\": \"CALCULATED\",\n \"sourceId\": \"LineItemAmountCalculator\"\n },\n \"quantity\": {\n \"versions\": [\n {\n \"name\": \"quantity\",\n \"value\": \"25\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"25\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceId\": null\n },\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\": \"9.00\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"9.00\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"name\": {\n \"versions\": [\n {\n \"name\": \"name\",\n \"value\": \"Widgets, special discount price\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"Widgets, special discount price\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"createdate\": {\n \"versions\": [\n {\n \"name\": \"createdate\",\n \"value\": \"0\",\n \"timestamp\": 0,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"0\",\n \"timestamp\": 0,\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 \"description\": {\n \"versions\": [\n {\n \"name\": \"description\",\n \"value\": \"A description of yet another product.\",\n \"timestamp\": 1525289943771,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"A description of yet another product.\",\n \"timestamp\": 1525289943771,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"hs_product_id\": {\n \"versions\": [\n {\n \"name\": \"hs_product_id\",\n \"value\": \"1645187\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"1645187\",\n \"timestamp\": 1525369755209,\n \"source\": \"API\",\n \"sourceId\": null\n },\n \"recurringbillingfrequency\": {\n \"versions\": [\n {\n \"name\": \"recurringbillingfrequency\",\n \"value\": \"annually\",\n \"timestamp\": 1525289943771,\n \"source\": \"API\",\n \"sourceVid\": []\n }\n ],\n \"value\": \"annually\",\n \"timestamp\": 1525289943771,\n \"source\": \"API\",\n \"sourceId\": null\n }\n },\n \"version\": 0,\n \"isDeleted\": false\n }\n]"
Successful response - Update a group of existing line items
The response is of type object
.
Was this page helpful?