iotoms Docs

Resolve rates for a document's lines

POST
/api/v1/pricing/resolve

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

  1. Send the party (vendor ID or customer number), the document date and every line with your own lineRef, itemId and quantity.
  2. Mark free lines with freeGoods=true so they get no rate.
  3. Pre-fill only empty rate fields with resolvedRate and show sourceLabel under the line; nothing is saved by this call.
  4. Use comparable to decide whether to warn when a user types a different rate.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Header Parameters

X-TenantID*string

Your merchant's tenant code — the value typed in the Domain field on the iotoms login screen. See Concepts.

Request Body

application/json
  1. body
partyRole*string

SUPPLIER for purchase documents or CUSTOMER for sales documents.

Value in"SUPPLIER""CUSTOMER"
partyId*string

Vendor 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.

Formatdate
currencyCode?|

Document currency. Defaults to the merchant's currency; any other currency is rejected.

lines*array<>

The document lines to resolve, all in one call.

Response Body

OK

*/*
  1. response
status*string

Outcome of the call: SUCCESS when the request was processed; otherwise an error status.

message*string

Short 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.

Example Request
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    }  ]}'
Example Response
{  "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"      }    ]  }}