Add pricing headers to a product line
POST /accounting/products/{id}/product-lines/{productLineId}/pricing
Group: Accounting › Products › Product Lines · Operation ID: createAccountingProductLinePricing
Adds one or more pricing headers (with entries) to an existing product line, in the same transaction. Same nested shape as priceBookHeadersToCreate on the product-line endpoints — see POST accounting/products for the full rules on tiers vs. rate cards.
id and productLineId must resolve to an existing product line under that 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 the line belongs to (a UUID); bound from the :id path segment. |
productLineId |
path | string | yes | Id of the product line to add pricing to (a UUID); bound from the :productLineId path segment. |
Request body
Required, application/json: createAccountingProductLinePricingInput.
| Field | Type | Required | Description |
|---|---|---|---|
headers |
array of object | yes | Pricing headers to create. |
headers[].priceBookId |
string | yes | Id of the price book this header belongs to (a UUID). |
headers[].currency |
string | yes | ISO 4217 three-letter currency code the prices in this header are denominated in. |
headers[].validFrom |
string (date) | yes | First date on which this header's prices are effective (inclusive). Format: YYYY-MM-DD. |
headers[].validTo |
string (date) | no | Last date on which this header's prices are effective (inclusive). Omit for an open-ended header. |
headers[].priceBookEntries |
array of object | yes | |
headers[].priceBookEntries[].listPrice |
string (decimal) | no | List price as a decimal amount in the header currency. Required for non-tiered, non-rate-card entries. |
headers[].priceBookEntries[].fromQuantity |
string (decimal) | no | Inclusive lower bound of this tier's quantity range. Provide only on tiered entries. |
headers[].priceBookEntries[].toQuantity |
string (decimal) | no | Inclusive upper bound of this tier's quantity range. Omit on the top, open-ended tier. |
headers[].priceBookEntries[].priceModel |
string | no | How this tier prices quantity. Provide only on tiered entries. One of 'flat', 'perUnit'. |
headers[].priceBookEntries[].rateCardEntry |
object | no | Rate-card entry to attach. Provide only on rate-card-priced entries. |
headers[].priceBookEntries[].rateCardEntry.billableComponentId |
string | no | Id of the billable component this rate-card entry prices (a UUID). |
headers[].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'. |
headers[].priceBookEntries[].rateCardEntry.description |
string | no | Free-form qualifier distinguishing this rate-card entry from siblings on the same billable component. |
headers[].priceBookEntries[].rateCardEntry.usageType |
string | no | How usage is measured against this entry. One of 'consumption', 'overage', 'thresholdCounter'. |
headers[].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'. |
headers[].priceBookEntries[].rateCardEntry.conversion |
string (decimal) | no | Multiplier applied to convert unitOfMeasure quantities into billableUnitOfMeasure quantities. |
headers[].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'. |
headers[].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'. |
Example:
{
"headers": [
{
"priceBookId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"currency": "<currency>",
"validFrom": "2026-01-15",
"validTo": "2026-01-15",
"priceBookEntries": [
{
"listPrice": "19.99",
"fromQuantity": "19.99",
"toQuantity": "19.99",
"priceModel": "<priceModel>",
"rateCardEntry": {
"billableComponentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"unitOfMeasure": "<unitOfMeasure>",
"description": "<description>",
"usageType": "<usageType>",
"billableUnitOfMeasure": "<billableUnitOfMeasure>",
"conversion": "19.99",
"invoiceFrequency": "<invoiceFrequency>",
"priceModel": "<priceModel>"
}
}
]
}
]
}
Response
200 Success
Under data (createAccountingProductLinePricingOutput):
| Field | Type | Required | Description |
|---|---|---|---|
createdPricingHeaderIds |
array of string | yes | Ids of the pricing headers 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 |
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, 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