Add product lines to a product
POST /accounting/products/{id}/product-lines
Group: Accounting › Products › Product Lines · Operation ID: addAccountingProductLines
Adds one or more product lines (with optional pricing) to an existing product, in the same transaction. Same nested shape as productLinesToCreate on POST accounting/products — see that endpoint's explanation for the full rules (Prepaid/Usage pairing, price-book/billable-component/tax-entity resolution, CommitWithOverage rejection).
id must resolve to an existing product or the call fails with NOT_FOUND.
Open in the interactive reference
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Api-Version |
header | "v1" |
yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version v1. |
Idempotency-Key |
header | string | no | An opaque caller-chosen string (1-255 characters) that makes this request safe to retry. Repeating the same key with an identical request body replays the original response instead of re-executing - but only once that original request succeeded; a failed attempt re-executes on retry. Repeating the key with a different body is answered with 422. A key still in flight is answered with 409 - as is a key whose original request was interrupted before it finished, for a few minutes afterwards, until that attempt is presumed dead. A completed response stays replayable for 24 hours. The key is scoped to the caller, not to the action: reusing it for a different action is answered with 409 or 422 rather than treated independently. On read actions this header is ignored. On write actions that cannot offer the guarantee it is answered with 400 IDEMPOTENCY_NOT_SUPPORTED rather than silently ignored. |
id |
path | string | yes | Id of the product to add lines to (a UUID); bound from the :id path segment. |
Request body
Required, application/json: addAccountingProductLinesInput.
| Field | Type | Required | Description |
|---|---|---|---|
productLines |
array of object | yes | Product lines to create, with optional pricing. A Prepaid line automatically also creates a paired Usage line. |
productLines[].lineType |
string | yes | Type of product line. One of 'recurring', 'oneTime', 'usage', 'prepaid', 'billableTime', 'billableTravelExpense', 'billablePassThrough'. CommitWithOverage is not supported on this endpoint. |
productLines[].priceModel |
string | yes | How this product line is priced. One of 'flat', 'perUnit', 'tiered', 'volume', 'stairstep', 'rateCard', 'thresholdBased'. |
productLines[].unitOfMeasure |
string | yes | Unit of measure quantities of this product line are tracked in. One of 'instance', 'gigabyte', 'terabyte', 'user', 'seat', 'minute', 'hour', 'day', 'month', 'each', 'license', 'activeUser', 'megabyte', 'message', 'text', 'platform', 'employee', 'personnel', 'credit', 'currency', 'package', 'case', 'word', 'record'. |
productLines[].name |
string | no | Human-readable name for the product line. Omit to let the platform auto-generate one. |
productLines[].pricingTerm |
string | no | Pricing term of the product line. One of 'monthly', 'biMonthly', 'once', 'quarterly', 'semiAnnually', 'annually'. |
productLines[].enforceListPrice |
boolean | no | When true, sales transactions on this product line cannot override the list price. |
productLines[].invoiceFrequency |
string | no | How often this product line is invoiced. One of 'monthly', 'biMonthly', 'quarterly', 'semiAnnually', 'annually', 'once', 'custom', 'template', 'milestone', 'allAtOnce', 'termEnd'. |
productLines[].prepaidBalanceOverConsumptionBehavior |
string | no | Controls what happens when usage exceeds the prepaid balance. Accepted values: allowNegative (balance goes negative; reconciled at renewal) and overage (switches to PAYG invoicing when balance hits 0). |
productLines[].prepaidBalanceRolloverAtRenewal |
boolean | no | Whether the remaining prepaid balance rolls over at renewal. |
productLines[].crmProductId |
string | no | CRM system's own identifier for this product line, when integrating from one. |
productLines[].dataSource |
string | no | Identifier of the upstream system or import job that produced this product line. E.g. 'Salesforce', 'NetSuite', 'Stripe' — the domain is tenant-configurable and not exhaustively enumerable here. |
productLines[].productLineTaxes |
array of object | no | Tax records to attach to this product line. Provide only when a tax provider is configured. |
productLines[].productLineTaxes[].taxCode |
string | yes | Tax code as defined by the configured tax provider. |
productLines[].productLineTaxes[].entityId |
string | yes | Id of the legal entity this tax record applies under (a UUID). |
productLines[].productLineTaxes[].engine |
string | yes | Identifier of the tax engine used to compute this tax. One of 'avalara', 'anrok', 'everestTaxEngine', 'manualTax', 'none'. |
productLines[].productLineTaxes[].country |
string | no | ISO 3166-1 country code the tax record applies in. |
productLines[].priceBookHeadersToCreate |
array of object | no | Pricing headers to create alongside this product line. |
productLines[].priceBookHeadersToCreate[].priceBookId |
string | yes | Id of the price book this header belongs to (a UUID). |
productLines[].priceBookHeadersToCreate[].currency |
string | yes | ISO 4217 three-letter currency code the prices in this header are denominated in. |
productLines[].priceBookHeadersToCreate[].validFrom |
string (date) | yes | First date on which this header's prices are effective (inclusive). Format: YYYY-MM-DD. |
productLines[].priceBookHeadersToCreate[].validTo |
string (date) | no | Last date on which this header's prices are effective (inclusive). Omit for an open-ended header. |
productLines[].priceBookHeadersToCreate[].priceBookEntries |
array of object | yes | |
productLines[].priceBookHeadersToCreate[].priceBookEntries[].listPrice |
string (decimal) | no | List price as a decimal amount in the header currency. Required for non-tiered, non-rate-card entries. |
productLines[].priceBookHeadersToCreate[].priceBookEntries[].fromQuantity |
string (decimal) | no | Inclusive lower bound of this tier's quantity range. Provide only on tiered entries. |
productLines[].priceBookHeadersToCreate[].priceBookEntries[].toQuantity |
string (decimal) | no | Inclusive upper bound of this tier's quantity range. Omit on the top, open-ended tier. |
productLines[].priceBookHeadersToCreate[].priceBookEntries[].priceModel |
string | no | How this tier prices quantity. Provide only on tiered entries. One of 'flat', 'perUnit'. |
productLines[].priceBookHeadersToCreate[].priceBookEntries[].rateCardEntry |
object | no | Rate-card entry to attach. Provide only on rate-card-priced entries. |
productLines[].priceBookHeadersToCreate[].priceBookEntries[].rateCardEntry.billableComponentId |
string | no | Id of the billable component this rate-card entry prices (a UUID). |
productLines[].priceBookHeadersToCreate[].priceBookEntries[].rateCardEntry.unitOfMeasure |
string | yes | Unit of measure the rate is quoted in. One of 'instance', 'gigabyte', 'terabyte', 'user', 'seat', 'minute', 'hour', 'day', 'month', 'each', 'license', 'activeUser', 'megabyte', 'message', 'text', 'platform', 'employee', 'personnel', 'credit', 'currency', 'package', 'case', 'word', 'record'. |
productLines[].priceBookHeadersToCreate[].priceBookEntries[].rateCardEntry.description |
string | no | Free-form qualifier distinguishing this rate-card entry from siblings on the same billable component. |
productLines[].priceBookHeadersToCreate[].priceBookEntries[].rateCardEntry.usageType |
string | no | How usage is measured against this entry. One of 'consumption', 'overage', 'thresholdCounter'. |
productLines[].priceBookHeadersToCreate[].priceBookEntries[].rateCardEntry.billableUnitOfMeasure |
string | no | Unit of measure used when billing this entry. One of 'instance', 'gigabyte', 'terabyte', 'user', 'seat', 'minute', 'hour', 'day', 'month', 'each', 'license', 'activeUser', 'megabyte', 'message', 'text', 'platform', 'employee', 'personnel', 'credit', 'currency', 'package', 'case', 'word', 'record'. |
productLines[].priceBookHeadersToCreate[].priceBookEntries[].rateCardEntry.conversion |
string (decimal) | no | Multiplier applied to convert unitOfMeasure quantities into billableUnitOfMeasure quantities. |
productLines[].priceBookHeadersToCreate[].priceBookEntries[].rateCardEntry.invoiceFrequency |
string | no | How often usage on this entry is invoiced. One of 'monthly', 'biMonthly', 'quarterly', 'semiAnnually', 'annually', 'once', 'custom', 'template', 'milestone', 'allAtOnce', 'termEnd'. |
productLines[].priceBookHeadersToCreate[].priceBookEntries[].rateCardEntry.priceModel |
string | no | How this rate-card entry computes a price (rate-card specific). One of 'flat', 'perUnit', 'tiered', 'volume', 'stairstep', 'rateCard', 'thresholdBased'. |
productLines[].priceBookHeadersForUsage |
array of object | no | Pricing for the auto-created paired Usage line. Provide only when lineType is Prepaid; ignored otherwise. |
productLines[].priceBookHeadersForUsage[].priceBookId |
string | yes | Id of the price book the Usage-line header belongs to (a UUID). |
productLines[].priceBookHeadersForUsage[].currency |
string | yes | ISO 4217 three-letter currency code. |
productLines[].priceBookHeadersForUsage[].validFrom |
string (date) | yes | First date on which the Usage-line header's prices are effective. Format: YYYY-MM-DD. |
productLines[].priceBookHeadersForUsage[].validTo |
string (date) | no | Last date on which the Usage-line header's prices are effective. |
productLines[].priceBookHeadersForUsage[].rateCardEntries |
array of object | yes | Rate-card entries on the Usage-line header. Usage-line pricing is always rate-card-based. |
productLines[].priceBookHeadersForUsage[].rateCardEntries[].billableComponentId |
string | no | Id of the billable component this rate-card entry prices (a UUID). |
productLines[].priceBookHeadersForUsage[].rateCardEntries[].usageType |
string | yes | How usage is measured against this entry. One of 'consumption', 'overage', 'thresholdCounter'. |
productLines[].priceBookHeadersForUsage[].rateCardEntries[].unitOfMeasure |
string | yes | Unit of measure the rate is quoted in. One of 'instance', 'gigabyte', 'terabyte', 'user', 'seat', 'minute', 'hour', 'day', 'month', 'each', 'license', 'activeUser', 'megabyte', 'message', 'text', 'platform', 'employee', 'personnel', 'credit', 'currency', 'package', 'case', 'word', 'record'. |
productLines[].priceBookHeadersForUsage[].rateCardEntries[].billableUnitOfMeasure |
string | no | Unit of measure used when billing this entry. One of 'instance', 'gigabyte', 'terabyte', 'user', 'seat', 'minute', 'hour', 'day', 'month', 'each', 'license', 'activeUser', 'megabyte', 'message', 'text', 'platform', 'employee', 'personnel', 'credit', 'currency', 'package', 'case', 'word', 'record'. |
productLines[].priceBookHeadersForUsage[].rateCardEntries[].conversion |
string (decimal) | no | Multiplier applied to convert unitOfMeasure quantities into billableUnitOfMeasure quantities. |
productLines[].priceBookHeadersForUsage[].rateCardEntries[].listPrice |
string (decimal) | no | The list price for this rate card entry, in the price book currency. |
Example:
{
"productLines": [
{
"lineType": "<lineType>",
"priceModel": "<priceModel>",
"unitOfMeasure": "<unitOfMeasure>",
"name": "<name>",
"pricingTerm": "<pricingTerm>",
"enforceListPrice": true,
"invoiceFrequency": "<invoiceFrequency>",
"prepaidBalanceOverConsumptionBehavior": "<prepaidBalanceOverConsumptionBehavior>",
"prepaidBalanceRolloverAtRenewal": true,
"crmProductId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"dataSource": "<dataSource>",
"productLineTaxes": [
{
"taxCode": "<taxCode>",
"entityId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"engine": "<engine>",
"country": "<country>"
}
],
"priceBookHeadersToCreate": [
{
"priceBookId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"currency": "<currency>",
"validFrom": "2026-01-15",
"validTo": "2026-01-15",
"priceBookEntries": [
{
"listPrice": null,
"fromQuantity": null,
"toQuantity": null,
"priceModel": null,
"rateCardEntry": null
}
]
}
],
"priceBookHeadersForUsage": [
{
"priceBookId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"currency": "<currency>",
"validFrom": "2026-01-15",
"validTo": "2026-01-15",
"rateCardEntries": [
{
"billableComponentId": null,
"usageType": null,
"unitOfMeasure": null,
"billableUnitOfMeasure": null,
"conversion": null,
"listPrice": null
}
]
}
]
}
]
}
Response
200 Success
Under data (addAccountingProductLinesOutput):
| Field | Type | Required | Description |
|---|---|---|---|
createdProductLineIds |
array of string | yes | Ids of the product lines created (each a UUID), in the same order as the input entries. |
Response headers
Idempotency-Replayed— Present andtrueonly when this response replays a previously stored one for the same Idempotency-Key, rather than reflecting a live execution. Absent on a live response - never sent asfalse.
Errors
| Code | Status |
|---|---|
INVALID_ID |
400 |
NOT_FOUND |
400 |
UNKNOWN_PRICE_BOOK_IDS |
400 |
UNKNOWN_BILLABLE_COMPONENT_IDS |
400 |
UNKNOWN_TAX_ENTITY_IDS |
400 |
UNSUPPORTED_LINE_TYPE |
400 |
VALIDATION_FAILED |
400 |
IDEMPOTENCY_KEY_CONFLICT |
409 |
IDEMPOTENCY_PAYLOAD_MISMATCH |
422 |
Statuses
400— Invalid request or business failure. Codes: INVALID_ID, NOT_FOUND, UNKNOWN_PRICE_BOOK_IDS, UNKNOWN_BILLABLE_COMPONENT_IDS, UNKNOWN_TAX_ENTITY_IDS, UNSUPPORTED_LINE_TYPE, VALIDATION_FAILED401— Missing or invalid access token403— Not authorized404— Not found409— The Idempotency-Key is still being processed by another request.422— The Idempotency-Key was already used with a different request payload.429— Too many requests500— Internal server error