When a product is attached to a deal, it becomes a line item. The line items endpoints allow you to manage and sync this data.
crm.objects.line_items.read
: provides access to retrieve line item data.crm.objects.line_items.write
: provides access to create and update line items.tax_rates.read
: provides access to retrieve tax rates you’ve configured in your account.POST
request to /crm/v3/objects/line_items
. In the post body, include the line item’s details, such as name, quantity, and price. You may also want to include additional data in the request body:
hs_product_id
in the post body.hs_tax_rate_group_id
within the properties
field of the request body.associations
array in the post body. For example, the post body below would create a line item named “New standalone line item” that’s associated with a deal (ID: 12345
).price
specified within the properties
field cannot be negative.hs_recurring_billing_period
) accepts ISO-8601 period formats of PnYnMnD and PnW.GET
request to /crm/v3/objects/line_items/{lineItemId}
where lineItemId
is the ID of the line item.GET
request to /crm/v3/objects/line_items
.Parameter | Description |
---|---|
properties | A comma separated list of the properties to be returned in the response. If a requested property isn’t defined, it won’t be included in the response. If a requested property is defined but a line item doesn’t have a value, it will be returned as null . |
propertiesWithHistory | A comma separated list of the properties to be returned along with their history of previous values. If a requested property isn’t defined, it won’t be included in the response. If a requested property is defined but a line item doesn’t have a value, it will be returned as null . |
PATCH
request to /crm/v3/objects/line_items/{lineItemId}
, where lineItemId
is the ID of the line item.
In the post body, include the property values that you want to update. You cannot update associations through this method. Instead you’ll need to use the associations API.
For example, your request body might look similar to the following:
DELETE
request to /crm/v3/objects/line_items/{lineItemId}
, where lineItemId
is the ID of the line item.
GET
request to /crm/v3/properties/line_item
. Learn more about using the properties API.
Property name | Label in UI | Description |
---|---|---|
name | Name | The name of the line item. |
description | Description | Full description of the product |
hs_sku | SKU | Unique product identifier |
hs_recurring_billing_start_date | Billing start date | Recurring billing start date for a line item |
hs_recurring_billing_end_date | Billing end date | Recurring billing end date for a line item |
recurringbillingfrequency | Billing frequency | How often a line item with recurring billing is billed. It informs the pricing calculation for deals and quotes. Line items with one-time billing aren’t included. |
quantity | Quantity | How many units of a product are included in this line item |
price | Unit price | The cost of the product |
amount | Net price | The total cost of the line item (i.e., the quantity times the unit price). |
hs_line_item_currency_code | Currency | Currency code for the line item |
GET
request to /tax-rates/v1/tax-rates
to fetch all tax rates, or /tax-rates/v1/tax-rates/{taxRateId}
to fetch a tax rate by its ID. Your app will need to authorize the tax_rates.read
scope to make this request.
The resulting response will resemble the following:
Property name | Description |
---|---|
name | The internal descriptor for the tax rate. |
percentageRate | The value of the tax rate, expressed as a percentage. |
label | The buyer-facing descriptor of the tax rate, shown on the quote, invoice, or other parent objects. |
active | A boolean that denotes whether the tax rate can be applied to a new quote or invoice. You might set this to false for a previous year’s tax rate that’s no longer applicable. |
id | The ID of the tax rate. |
createdAt | An ISO 8601 timestamp denoting when the tax rate was created. |
updatedAt | An ISO 8601 timestamp denoting when the tax rate was last updated. |
id
for the hs_tax_rate_group_id
within the properties
field when creating a line item. Learn more about creating line items in the section above.