cURL
curl --request POST \ --url https://v1.api.flux-os.com/measurements/units/convert \ --header 'Content-Type: application/json' \ --header 'x-api-key: <api-key>' \ --header 'x-user-id: <api-key>' \ --data ' { "value": 123, "from_unit_id": 123, "to_unit_id": 123, "product_category_id": 123 } '
{ "data": { "product_category": { "id": 123, "name": "<string>" }, "from": { "value": 123, "measurement_unit": { "id": 123, "name": "<string>", "abbreviation": "<string>" } }, "to": { "value": 123, "measurement_unit": { "id": 123, "name": "<string>", "abbreviation": "<string>" } }, "formula": "<string>" } }
Convert a value from one measurement unit to another using stored conversion factors.
The value to convert
Measurement Unit ID
Product Category ID
Successful conversion
Show child attributes
The formula used for the conversion