List units

Requires authentication

HTTP Request

GET connector/api/unit

Example request:

curl -X GET \
-G "http://erp.dstadvertising.com/connector/api/unit" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"

Example response (200):

{
"data": [
{
"id": 1,
"business_id": 1,
"actual_name": "Pieces",
"short_name": "Pc(s)",
"allow_decimal": 0,
"base_unit_id": null,
"base_unit_multiplier": null,
"created_by": 1,
"deleted_at": null,
"created_at": "2018-01-03 15:15:20",
"updated_at": "2018-01-03 15:15:20",
"base_unit": null
},
{
"id": 2,
"business_id": 1,
"actual_name": "Packets",
"short_name": "packets",
"allow_decimal": 0,
"base_unit_id": null,
"base_unit_multiplier": null,
"created_by": 1,
"deleted_at": null,
"created_at": "2018-01-06 01:07:01",
"updated_at": "2018-01-06 01:08:36",
"base_unit": null
},
{
"id": 15,
"business_id": 1,
"actual_name": "Dozen",
"short_name": "dz",
"allow_decimal": 0,
"base_unit_id": 1,
"base_unit_multiplier": "12.0000",
"created_by": 9,
"deleted_at": null,
"created_at": "2020-07-20 13:11:09",
"updated_at": "2020-07-20 13:11:09",
"base_unit": {
"id": 1,
"business_id": 1,
"actual_name": "Pieces",
"short_name": "Pc(s)",
"allow_decimal": 0,
"base_unit_id": null,
"base_unit_multiplier": null,
"created_by": 1,
"deleted_at": null,
"created_at": "2018-01-03 15:15:20",
"updated_at": "2018-01-03 15:15:20"
}
}
]
}

javascript

const url = new URL(
"http://erp.dstadvertising.com/connector/api/unit"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));