Resolve rates for a document's lines
Returns the expected rate for every line of a document in one call, and where it came from: an agreed price, the last document, the vendor's item price, or none. Each line also says whether the rate can be used to warn about a typed value. Use it only to pre-fill empty rate fields; the item's selling price is never used as a source.
How to use it
- Send the party (vendor ID or customer number), the document date and every line with your own lineRef, itemId and quantity.
- Mark free lines with freeGoods=true so they get no rate.
- Pre-fill only empty rate fields with resolvedRate and show sourceLabel under the line; nothing is saved by this call.
- Use comparable to decide whether to warn when a user types a different rate.
BearerAuthAuthorizationBearer <JWT>X-TenantID*stringYour merchant's tenant code — the value typed in the Domain field on the iotoms login screen. See Concepts.
application/json- body
partyRole*stringSUPPLIER for purchase documents or CUSTOMER for sales documents.
"SUPPLIER""CUSTOMER"partyId*stringVendor ID for SUPPLIER (see List vendors) or customer number for CUSTOMER (see List customers).
documentDate?|Date of the document, YYYY-MM-DD. Rates are resolved as of this date. Defaults to today.
datecurrencyCode?|Document currency. Defaults to the merchant's currency; any other currency is rejected.
lines*array<>The document lines to resolve, all in one call.
OK
*/*- response
status*stringOutcome of the call: SUCCESS when the request was processed; otherwise an error status.
message*stringShort human-readable message describing the outcome, e.g. which record was saved or why the call failed.
data?The resolved rate for each requested line, with where it came from.
curl -X POST 'https://beta.iotoms.com/api/v1/pricing/resolve' \ -H 'X-TenantID: your-tenant-code' \ -H 'Content-Type: application/json' \ -d '{ "partyRole": "SUPPLIER", "partyId": "string", "lines": [ { "lineRef": "string", "itemId": "string", "qty": 0, "freeGoods": true } ]}'{ "status": "string", "message": "string", "data": { "partyRole": "SUPPLIER", "partyId": "string", "documentDate": "2019-08-24", "currencyCode": "string", "lines": [ { "lineRef": "string", "itemId": "string", "resolvedRate": 0, "source": "AGREEMENT", "sourceRef": "string", "sourceObservedOn": "2019-08-24", "uomId": "4df47f00-a69d-4ff2-b50d-4a7649a4b70c", "unitOfMeasure": "string", "currencyCode": "string", "taxInclusive": true, "comparable": true, "reason": "UNIT_MISMATCH", "lapsedRate": 0, "lapsedTo": "2019-08-24", "sourceLabel": "string" } ] }}