Skip to main content

Get Item Category List

Deskripsi

Membuat API service bagi user open API untuk mengambil category-category produk di Marketplace PaDi UMKM

MethodURL
GETapi/v1/bumn/categories

Request

TypeParamsValuesDescription
URI PARAMtype
  • string
  • mandatory
    Each ID has a status with the following description:
| type | name |
| 1 | Barang |
| 2 | Jasa |
URI PARAMname
  • string
  • mandatory
    Each ID has a status with the following description:
| type | name |
| 1 | Barang |
| 2 | Jasa |
URI PARAMpageinteger optional

Current page

URI PARAMlimitinteger optional

Number of rows per page.

Response

Success

StatusPayload
200
{
"status": "success",
"data": {
"categories": [
{
"__v": 0,
"name": "Seragam Kerja",
"parent_data": {
"name": "Fashion",
"parent_data": {},
"slug": "fashion",
"type": 1,
"type_name": "barang"
},
"parent_id": "62f5d41372324e224617aff2",
"slug": "seragam-kerja",
"type": 1,
"type_name": "barang"
}
],
"meta": {
"first": "",
"last": "",
"limit": 10,
"next": "",
"page": 1,
"prev": "",
"total_data": 1,
"total_page": 1
}
},
"message": "ok"
}
ParamsDescription
parent_data
Data Type: OBJECT
Data transmitted by response.
parent_data.type
Data Type: STRING
ID of type category.
parent_data.type_name
Data Type: STRING
Name of type category.
parent_data.slug
Data Type: STRING
Unique Identification for category.
parent_data.name
Data Type: STRING
Type Name of category.
parent_data.parent_id
Data Type: STRING
ID of parent data.
parent_data.__v
Data Type: STRING
Otomatic Field by MongoDB for saving version of the data.

Error

StatusPayload
404
{
"status": "error",
"message": "category not found"
}
ParamsDescription
status
Data Type: STRING
Status of the request delivered to server.
Available value:
* “success”
* “error”
message
Data Type: STRING
Description message for the occurring error