iotoms Docs

Set a price variance tolerance

PUT
/api/v1/pricing/variances/tolerance

Creates or updates a tolerance for a role, party or party-and-item pairing. Omit partyId to set the tenant default for that role. Set muted to stop a pairing from appearing on the variance worklist without discarding the recorded observations.

How to use it

  1. Pick the role (SUPPLIER or CUSTOMER) and, for an override, the vendor ID from List vendors or customer number from List customers.
  2. Send absThreshold and/or pctThreshold; omit partyId to set the merchant-wide default, add itemId to narrow it to one item.
  3. Set muted to true to stop that pairing appearing on the worklist; earlier variances stay on record.
  4. The same role, party and item combination is updated in place; new purchase documents are checked against the most specific match.

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 (purchase prices) or CUSTOMER (sale prices). Defaults to SUPPLIER.

Value in"SUPPLIER""CUSTOMER"
partyId?|

Vendor ID (SUPPLIER) or customer number (CUSTOMER). Omit to set the merchant-wide default for the role.

itemId?|

Item code to narrow the override to one item from this party. Requires partyId.

absThreshold?|

Per-unit amount in the merchant's currency the rate must move by before it is flagged. 0 or more; omit to use the built-in default.

pctThreshold?|

Percentage the rate must move by before it is flagged, e.g. 5 = 5%. 0 or more; omit to use the built-in default.

muted*boolean

true stops this scope adding new rows to the worklist; past variances are kept. Defaults to false, and every save overwrites it, so send true again when updating a muted scope.

notes?|

Optional reason for the override, kept for audit.

updatedBy?|

Name or username of the person making the change, stored for audit.

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 tolerance as saved.

Example Request
curl -X PUT 'https://beta.iotoms.com/api/v1/pricing/variances/tolerance' \  -H 'X-TenantID: your-tenant-code' \  -H 'Content-Type: application/json' \  -d '{  "partyRole": "SUPPLIER",  "muted": true}'
Example Response
{  "status": "string",  "message": "string",  "data": {    "id": 0,    "partyRole": "SUPPLIER",    "partyId": "string",    "partyName": "string",    "itemId": "string",    "itemName": "string",    "absThreshold": 0,    "pctThreshold": 0,    "muted": true,    "notes": "string",    "updatedBy": "string",    "updatedAt": "2019-08-24T14:15:22Z"  }}