Add Unit
Testing Env
https://www.testecommerce.vodoerp.com
Testing Env
https://www.testecommerce.vodoerp.com
POST
/api/v1/standard_units
Last modified:2025-04-30 08:52:51
Key | Value | Description | Type |
---|---|---|---|
apikey | 5f28583f26a1a | API key for authentication; contact support to obtain. Required | String |
apiconnection | appmobile | Connection type; contact support to obtain. Required | String |
secure-business-key | 4765066450c0bd66325.48403130 | Business-specific key; contact support for valid values. Required | String |
userToken | 09119b2691afaa567bc1d46c829ebd41193c8545191146cc5df791681a792ad9 | User token from login API; see description for endpoints. (Get user token from https://testaccounts.vodoerp.com/api/login or https://accounts.vodoerp.com/api/login ) Required | String |
Key | Value | Description | Type |
---|---|---|---|
name_ar | Unit Name Arabic | Unit name in Arabic. Required | String |
name_en | Unit Name English | Unit name in English. Required | String |
children[0][name_ar] | Child Name Arabic | Child unit name in Arabic. Required | String |
children[0][name_en] | Child Name English | Child unit name in English. Required | String |
children[0][width] | 100 | Width of the child unit. | String |
children[0][length] | 200 | Length of the child unit. | String |
children[0][height] | 50 | Height of the child unit. | String |
children[0][weight] | 10 | Weight of the child unit. | String |
children[0][width_unit_id] | 1 | Unit ID for width measurement. | Intger |
children[0][length_unit_id] | 2 | Unit ID for length measurement. | Intger |
children[0][height_unit_id] | 3 | Unit ID for height measurement. | Intger |
children[0][weight_unit_id] | 4 | Unit ID for weight measurement. | Intger |
calculations[0][value] | 1.5 | Conversion factor for the unit. | String |
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://www.testecommerce.vodoerp.com/api/v1/standard_units' \
--header 'apikey: 5f28583f26a1a' \
--header 'apiconnection: appmobile' \
--header 'secure-business-key: 4765066450c0bd66325.48403130' \
--header 'userToken: 09119b2691afaa567bc1d46c829ebd41193c8545191146cc5df791681a792ad9' \
--header 'Content-Type: application/json' \
--data-raw '{
"name_ar": "Unit Name Arabic",
"name_en": "Unit Name English",
"children": [
{
"name_ar": "Child Name Arabic",
"name_en": "Child Name English",
"width": 100,
"length": 200,
"height": 50,
"weight": 10,
"width_unit_id": 1,
"length_unit_id": 2,
"height_unit_id": 3,
"weight_unit_id": 4
},
{
"name_ar": "Another Child Name Arabic",
"name_en": "Another Child Name English",
"width": 120,
"length": 220,
"height": 55,
"weight": 12,
"width_unit_id": 1,
"length_unit_id": 2,
"height_unit_id": 3,
"weight_unit_id": 4
},
{
"name_ar": "Another Childbbbbbbbb Name Arabic",
"name_en": "Another Childbbbbbbb Name English",
"width": 120,
"length": 220,
"height": 55,
"weight": 12,
"width_unit_id": 1,
"length_unit_id": 2,
"height_unit_id": 3,
"weight_unit_id": 4
},
{
"name_ar": "Another Childddddddddddddd Name Arabic",
"name_en": "Another Childddddddd Name English",
"width": 120,
"length": 220,
"height": 55,
"weight": 12,
"width_unit_id": 1,
"length_unit_id": 2,
"height_unit_id": 3,
"weight_unit_id": 4
}
],
"calculations": [
{
"value": 1.5
},
{
"value": 2.0
},
{
"value": 3.0
},
{
"value": 5.0
}
]
}'
Response Response Example
{"status":true,"message":"Unit stored successfully","data":{"name_ar":"Unit Name Arabic","name_en":"Unit Name English","updated_at":"2025-04-14T22:37:05.000000Z","created_at":"2025-04-14T22:37:05.000000Z","id":131,"type":"custom","business_id":259,"children":[{"id":787,"standard_unit_id":131,"name_ar":"Child Name Arabic","name_en":"Child Name English","width":100,"length":200,"height":50,"weight":10,"width_unit_id":1,"length_unit_id":2,"height_unit_id":3,"weight_unit_id":4,"created_at":"2025-04-14T22:37:05.000000Z","updated_at":"2025-04-14T22:37:05.000000Z","calculations_from":[{"id":700,"from_unit_child_id":787,"to_unit_child_id":787,"value":1.5,"created_at":"2025-04-14T22:37:05.000000Z","updated_at":"2025-04-14T22:37:05.000000Z"},{"id":701,"from_unit_child_id":787,"to_unit_child_id":788,"value":2,"created_at":"2025-04-14T22:37:05.000000Z","updated_at":"2025-04-14T22:37:05.000000Z"},{"id":702,"from_unit_child_id":787,"to_unit_child_id":789,"value":3,"created_at":"2025-04-14T22:37:05.000000Z","updated_at":"2025-04-14T22:37:05.000000Z"},{"id":703,"from_unit_child_id":787,"to_unit_child_id":790,"value":5,"created_at":"2025-04-14T22:37:05.000000Z","updated_at":"2025-04-14T22:37:05.000000Z"}],"calculations_to":[{"id":700,"from_unit_child_id":787,"to_unit_child_id":787,"value":1.5,"created_at":"2025-04-14T22:37:05.000000Z","updated_at":"2025-04-14T22:37:05.000000Z"}]},{"id":788,"standard_unit_id":131,"name_ar":"Another Child Name Arabic","name_en":"Another Child Name English","width":120,"length":220,"height":55,"weight":12,"width_unit_id":1,"length_unit_id":2,"height_unit_id":3,"weight_unit_id":4,"created_at":"2025-04-14T22:37:05.000000Z","updated_at":"2025-04-14T22:37:05.000000Z","calculations_from":[],"calculations_to":[{"id":701,"from_unit_child_id":787,"to_unit_child_id":788,"value":2,"created_at":"2025-04-14T22:37:05.000000Z","updated_at":"2025-04-14T22:37:05.000000Z"}]},{"id":789,"standard_unit_id":131,"name_ar":"Another Childbbbbbbbb Name Arabic","name_en":"Another Childbbbbbbb Name English","width":120,"length":220,"height":55,"weight":12,"width_unit_id":1,"length_unit_id":2,"height_unit_id":3,"weight_unit_id":4,"created_at":"2025-04-14T22:37:05.000000Z","updated_at":"2025-04-14T22:37:05.000000Z","calculations_from":[],"calculations_to":[{"id":702,"from_unit_child_id":787,"to_unit_child_id":789,"value":3,"created_at":"2025-04-14T22:37:05.000000Z","updated_at":"2025-04-14T22:37:05.000000Z"}]},{"id":790,"standard_unit_id":131,"name_ar":"Another Childddddddddddddd Name Arabic","name_en":"Another Childddddddd Name English","width":120,"length":220,"height":55,"weight":12,"width_unit_id":1,"length_unit_id":2,"height_unit_id":3,"weight_unit_id":4,"created_at":"2025-04-14T22:37:05.000000Z","updated_at":"2025-04-14T22:37:05.000000Z","calculations_from":[],"calculations_to":[{"id":703,"from_unit_child_id":787,"to_unit_child_id":790,"value":5,"created_at":"2025-04-14T22:37:05.000000Z","updated_at":"2025-04-14T22:37:05.000000Z"}]}]}}
Request
Header Params
apikey
stringÂ
required
Example:
5f28583f26a1a
apiconnection
stringÂ
required
Example:
appmobile
secure-business-key
stringÂ
required
728106399db2b289783.89154521
2680667168f2f8a68f6.12561200
140356399db2b2c32f0.25237063
96701678e330f31f768.22400604
14807664478836358b0.31329842
Example:
4765066450c0bd66325.48403130
userToken
stringÂ
required
https://testaccounts.vodoerp.com/api/login
or
https://accounts.vodoerp.com/api/login
Example:
09119b2691afaa567bc1d46c829ebd41193c8545191146cc5df791681a792ad9
Body Params application/json