There's a new version of the HubSpot API

As of November 30, 2022, HubSpot API keys are no longer a supported authentication method for accessing HubSpot APIs. Instead, you should use a private app access token or OAuth to authenticate API calls. Learn more about this change and how to migrate an API key integration to use a private app instead.

Create a group of line items

Last updated May 31, 2023

POST /crm-objects/v1/objects/line_items/batch-create

Method Details

HTTP Methods:

POST

Content Type:

application/json

Response Format:

json

Requires Authentication?

Yes

Rate Limited?

Yes

Headers

User-Agent

Products:

Sales Professional

Required Scope:

e-commerce

Create a group of line items. Up to 100 line items can be created in a single request. This would allow you to create all of the line items for an entire order (or multiple orders) in a single request.

The request body will be an array, with each entry being a list of properties you want to set for each new line item. Please see the example for more details.

You must set the hs_product_id property when creating a line item. This property needs to be the objectId of a product object, and represents the product being sold.

Required Parameters How to use Description
OAuth access token or private app access token Authorization: Bearer {token} header  Used to authenticate the request. Please see this page for more details about authentication.
Product ID "hs_product_id"
Used in the request JSON
The objectId of a product object.

Optional Parameters How to use Description
Any line item properties Used in the request JSON Any properties you want to set for each line item being created.