Skip to main content

Product

Definition

product.json
{
"id": 0,
"categoryID": 0,
"brandID": 0,
"key": "",
"title": "",
"subTitle": "",
"slug": "",
"price": 0,
"discount": 0,
"content": "",
"seq": 0,
"status": 0,
"createdAt": "",
"updatedAt": "",
}

Get Products

curl -X GET "${baseUrl}/product/?filter=${filter}&orderBy=${orderBy}&page=${page}&pageSize=${pageSize}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Get Product

curl -X GET "${baseUrl}/product/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Apply Product.ID

curl -X POST "${baseUrl}/apply/product/id/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Create Product

curl -X POST "${baseUrl}/product/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @product.json
info
product.json
{
"categoryID": 0,
"brandID": 0,
"key": "",
"title": "",
"subTitle": "",
"slug": "",
"price": 0,
"discount": 0,
"content": "",
"seq": 0,
"status": 0,
}
tip

success status: 201

Update Product

#!/bin/bash
curl -X PUT "${baseUrl}/product/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @product.json
info
product.json
{
"categoryID": 0,
"brandID": 0,
"key": "",
"title": "",
"subTitle": "",
"slug": "",
"price": 0,
"discount": 0,
"content": "",
"seq": 0,
"status": 0,
}

Patch Product

curl -X PATCH "${baseUrl}/product/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Attrs: categoryID,brandID,key,title,subTitle,slug,price,discount,content,seq,status" \
-d @product.json
info
product.json
{
"categoryID": 0,
"brandID": 0,
"key": "",
"title": "",
"subTitle": "",
"slug": "",
"price": 0,
"discount": 0,
"content": "",
"seq": 0,
"status": 0,
}

Update Product Status

curl -X PATCH "${baseUrl}/product/${id}/status/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @product.json
info
product.json
{
"status": 0
}

Destroy Product

curl -X DELETE "${baseUrl}/product/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Get Tags

curl -X GET "${baseUrl}/product/${id}/tag/?filter=${filter}&orderBy=${orderBy}&page=${page}&pageSize=${pageSize}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
curl -X POST "${baseUrl}/product/${id}/tag/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "[1,2,3,4]"
curl -X DELETE "${baseUrl}/product/${id}/tag/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "[1,2,3,4]"