Unit conversion

Convert Units

Fetching conversion factor

put

Calculates conversion factor for the given pair of units.

Authorizations
Path parameters
tenantstringRequired

The tenant name.

Example: testtenant
Body
commandUuidstringOptional
Responses
201
The factor has been successfully calculated.
application/json
put
PUT /unit-handling/{tenant}/units/conversion-factor-commands HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 88

{
  "commandUuid": "text",
  "input": {
    "sourceUnitAmount": 1,
    "sourceUnit": "g",
    "targetUnit": "kg"
  }
}
{
  "commandUuid": "e948a54d-ffeb-405a-9614-c68406274554,",
  "input": {
    "sourceUnit": "us-fl-oz,",
    "targetUnit": "cl"
  },
  "output": {
    "conversionFactor": 2.95735296
  }
}

Converting unit

put

Converts the source unit to a target unit.

Authorizations
Path parameters
tenantstringRequired

The tenant name.

Example: testtenant
Body
commandUuidstringOptional
Responses
201
The unit has ben successfully converted.
application/json
put
PUT /unit-handling/{tenant}/units/convert-unit-commands HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 90

{
  "commandUuid": "text",
  "input": {
    "sourceUnitAmount": 100,
    "sourceUnit": "g",
    "targetUnit": "kg"
  }
}
{
  "commandUuid": "83ddc478-89d7-48e1-8b6c-527f4c67fb56",
  "input": {
    "sourceUnitAmount": 100,
    "sourceUnit": "us-fl-oz",
    "targetUnit": "cl"
  },
  "output": {
    "targetUnitAmount": 295.735296,
    "targetUnit": "cl"
  }
}

Was this helpful?