Use the fees API to create and manage fees that can be included in invoices and legacy quotes.Fees are used in conjunction with discounts and taxes when determining the pricing totals. Any discounts you associate with your quote will be applied first, followed by associated fees, then any associated taxes.
Currently, fees cannot be associated with CPQ quotes.
To create one fee, make a POST request to /crm/v3/objects/fees.
To create multiple fees, make a POST request to /crm/v3/objects/fees/batch/create.
In the request body, include your fee data in a properties object. You can also add an associations object to associate the fee with existing objects (e.g., invoices, quotes).
For batch create actions, you can enable multi-status errors which tell you which records were successfully created and which were not. Learn more about setting up multi-status error handling.
When creating a fee, you must include a set of fee properties to store the fee’s details.For example, to create a new fee, your request may look similar to the following:
To associate a fee with another object at the time of creation, you can include an associations array in the request body. In the associations array, include an object for each association you want to create, which will specify the type of object you want to associate the fee with and the type of association.You can also associate fees with other objects at a later time by updating the fee’s associations.The following request body would create a fee and associate it with a quote (ID of 123456):
The object you want to associate the fee with, specified by its ID.
typesRequired
Array
The type of association between the fee and the object. This array contains the following fields: associationCategory (the type of association, either HUBSPOT_DEFINED or USER_DEFINED) and associationTypeId (a unique identifier to indicate the association type between the fee and the other object).
To create multiple fees with one request, make a POST request to /crm/v3/objects/fees/batch/create.In the request body, include an inputs array with each fee’s properties and associations. For example, the following request body would batch create two fees, one fixed fee of $25 and one percentage-based fee of 5%:
The fees API provides endpoints for retrieving individual fees, all fees, and batches of fees. You can also search for fees that meet a specific set of criteria.When retrieving fees, you can include the parameters below in the request. When retrieving all fees or individual fees, include them as query parameters in the request URL. When retrieving batches of fees, include them in the request body.
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 fee doesn’t have a value, it will be returned as null.
propertiesWithHistory
A comma separated list of the current and historical 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 fee doesn’t have a value, it will be returned as null.
associations
A comma separated list of objects to retrieve associated IDs for. Any specified associations that don’t exist will not be returned in the response. Learn more about the associations API.
To retrieve an individual fee, make a GET request to /crm/v3/objects/fees/{feeId}, where {feeId} is the ID of the fee you want to retrieve.The response will include a set of default properties, including the create date and last modified date.
To return specific properties, include a properties query parameter in the request URL along with comma-separated property names. For example:/crm/v3/objects/fees/512?properties=hs_label,hs_type,hs_value
To retrieve all fees, make a GET request to /crm/v3/objects/fees.You can retrieve up to 100 fees in one request.
To retrieve a specific amount under 100, add a value to the limit parameter (e.g., ?limit=50).
To retrieve additional fees in subsequent requests (i.e. the fees after the limit was reached in your request), include the after parameter with the after value returned from the previous request (e.g., ?after=123456).
For example, to retrieve 50 fees, your request URL would be GET/crm/v3/objects/fees?limit=50. In your response, under the paging object below the list of returned fees, the after value is the id of the next fee that would’ve been returned. To request 50 more fees, starting with the next returned value, make a GET request to /crm/v3/objects/fees?limit=50&after={id}.
To retrieve multiple fees by their IDs, make a POST request to /crm/v3/objects/fees/batch/read.In the request body, include the IDs of the fees you want to retrieve along with the properties you want returned:
You can use the search endpoint to retrieve fees that meet a specific set of filter criteria. Make a POST request to /crm/v3/objects/fees/search and include your filter criteria in the request body.For example, to search for all percentage-based fees:
To update an individual fee, make a PATCH request to /crm/v3/objects/fees/{feeId}. In the request body, include a properties object containing the properties that you want to update.Note that you cannot update the fee’s associations using this endpoint. Instead, you’ll need to use the associations API to update the fee’s associations.For example, to update a fee’s value:
Report incorrect code
Copy
Ask AI
{ "properties": { "hs_value": "15" }}
The response will include a set of default properties along with the property that you updated:
To update multiple fees at once, make a POST request to /crm/v3/objects/fees/batch/update.In the request body, include an inputs array with the ID and updated properties for each fee:
To associate an existing fee with other objects, you can set the association via the associations API by making a PUT request to:/crm/v4/objects/fees/{feeId}/associations/default/{toObjectType}/{toObjectId}/
Parameter
Description
feeId
The ID of the fee you want to associate.
toObjectType
The type of object that you want to associate the fee with (e.g., quote).
toObjectId
The ID of the individual object that you want to associate the fee with.
For example, if you wanted to associate a fee with a specific quote, your request URL would look like the following:/crm/v4/objects/fees//associations/default/quote/The response will return the details of the association, including the association details of each direction (quote-to-fee and fee-to-quote).
To remove an association between a fee and another object, make a DELETE request to /crm/v3/objects/fees/{feeId}/associations/{toObjectType}/{toObjectId}/{associationTypeId}.To retrieve the associationTypeId value, refer to this list of default values, or make a GET request to /crm/v4/associations///labels.
Parameter
Description
feeId
The ID of the fee you want to remove the association from.
toObjectType
The type of object that you want to remove the association from (e.g., quote).
toObjectId
The ID of the individual object that you want to remove the association from.
associationTypeId
The ID of the association type you want to remove.
To delete multiple fees with one request, make a POST request to /crm/v3/objects/fees/batch/archive.In the request body, include an inputs array with the IDs of the fees you want to delete:
Report incorrect code
Copy
Ask AI
{ "inputs": [ { "id": "512" }, { "id": "513" } ]}
A successful request returns a 204 response with no body.