productTerms
Resolves one applicable unit monetary amount for each requested product. Unlike
productPrices, which returns stored price records, this query selects the single
amount that applies in the supplied context. It is read-only; callers must explicitly
submit returned amounts to a document mutation to save them.
Business Rules
- Each line has a unique reference, a positive whole-number quantity, and exactly one
of
productIdorsku. - For
salesPrice, the current sales-channel tier with the highest qualifying quantity threshold is used. The newest effective date breaks ties. - MSRP is used when no sales-channel tier applies.
- If neither exists,
unitAmountMonetaryis null andsourceisNONE. - Zero is a valid resolved amount.
- Results follow the input order and return each reference unchanged.
Example
query ProductTerms($input: ProductTermsInput!) {
productTerms(input: $input) {
reference
productId
unitAmountMonetary { amount }
source
}
}
{
"input": {
"context": { "salesPrice": { "salesChannelId": "sales-channel-id" } },
"lines": [
{ "reference": "draft-line-1", "productId": "product-id", "quantity": 10 }
]
}
}
Error Scenarios
Sales channel not found: The channel does not belong to the current company.Product not found for reference ...: The product does not belong to the current company.- Validation error: Lines are empty, references are blank or repeated, product identity is ambiguous, or quantity is not a positive integer.
Permissions Required
products:read_terms
productTerms(
input: ProductTermsInput!
): [ProductTerm!]!
Arguments
productTerms.input ● ProductTermsInput! non-null input products
The context and ordered product requests to resolve.
Type
ProductTerm object products
The resolved unit amount for one requested product.