DOCUMENTATION
DOCUMENTATION
DOCUMENTATION
1- Les Produits :
- Response :
{
"code": "7V50NY",
"name": "product 54",
"images": "[\"2024-09-01-66d4274aec293.webp\",\"2024-09-01-
66d4274af130b.webp\",{\"image_name\":\"2024-09-01-
66d4274b1a5e5.webp\",\"storage\":\"public\"}]"
}
Ajout d’un produit :
- Route : http://localhost/api/v4/products/add
- Method : POST
- Headers : Content-Type : multipart/form-data
- Body :
( form-data : car il s’agit de l’upload d’une image )
- Response :
{
"user_id": 1,
"added_by": "admin",
"slug": "DZKLEN1",
"product_type": "physical",
"category_id": 1,
"sub_category_id": 2,
"sub_sub_category_id": 3,
"brand_id": 1,
"thumbnail": "1725409116-xotnpRQAoJ.jpg",
"unit_price": 20,
"purchase_price": 15,
"minimum_order_qty": 1,
"name": "product127",
"unit": "kg",
"details": "<p>\"This is a test product\"</p>",
"current_stock": 150,
"category_ids": "[{\"id\":\"1\",\"position\":\"1\"}]",
"colors": "[\"#FF5733\"]",
"variation": "[{\"price\":\"19.99\",\"sku\":\"CTR-S\",\"qty\":\"50\"}]",
"images": "[{\"image_name\":\"1725409116-
HRpbCvjwqU.jpg\",\"storage\":\"public\"},{\"image_name\":\"1725409116-
V06xZg8NtV.webp\",\"storage\":\"public\"}]",
"color_image": "[{\"color\":\"FF5733\",\"image_name\":\"1725409116-
HRpbCvjwqU.jpg\",\"storage\":\"public\"},
{\"color\":null,\"image_name\":\"1725409116-
V06xZg8NtV.webp\",\"storage\":\"public\"}]",
"choice_options": "[]",
"request_status": 1,
"thumbnail_storage_type": "public",
"updated_at": "2024-09-04T00:18:36.000000Z",
"created_at": "2024-09-04T00:18:36.000000Z",
"id": 70,
"is_shop_temporary_close": 0,
"thumbnail_full_url": {
"key": "1725409116-xotnpRQAoJ.jpg",
"path": "http://localhost/storage/app/public/product/thumbnail/1725409116-
xotnpRQAoJ.jpg",
"status": 200
},
"color_images_full_url": [
{
"color": "FF5733",
"image_name": {
"key": "1725409116-HRpbCvjwqU.jpg",
"path": "http://localhost/storage/app/public/product/1725409116-
HRpbCvjwqU.jpg",
"status": 200
}
},
{
"color": null,
"image_name": {
"key": "1725409116-V06xZg8NtV.webp",
"path": "http://localhost/storage/app/public/product/1725409116-
V06xZg8NtV.webp",
"status": 200
}
}
],
"meta_image_full_url": {
"key": null,
"path": null,
"status": 404
},
"images_full_url": [
{
"key": "1725409116-HRpbCvjwqU.jpg",
"path": "http://localhost/storage/app/public/product/1725409116-
HRpbCvjwqU.jpg",
"status": 200
},
{
"key": "1725409116-V06xZg8NtV.webp",
"path": "http://localhost/storage/app/public/product/1725409116-
V06xZg8NtV.webp",
"status": 200
}
],
"digital_file_ready_full_url": {
"key": null,
"path": null,
"status": 404
},
"translations": []
}
- Response :
- Avant modification :
Après modification :
2-Les Commandes :
- Response :
{
"id": 100001,
"order_amount": 25,
"order_details": [
{
"product_id": 1,
"price": 20,
"qty": 1,
"payment_status": "unpaid"
}
]
}
{
"id": 100001,
"customer_id": 2,
"is_guest": false,
"customer_type": "customer",
"payment_status": "unpaid",
....
....
....
"order_details": [
{
"id": 1,
"order_id": 100001,
"product_id": 1,
"seller_id": 1,
.....
]
- Après modification :
{
"id": 100001,
"customer_id": 2,
"is_guest": false,
"customer_type": "customer",
"payment_status": "paid",
....
....
....
"order_details": [
{
"id": 1,
"order_id": 100001,
"product_id": 1,
"seller_id": 2,
.....
]
3-Notes :
Pour que les images s’affichent correctement sur le site :
1- Il faut qu’il se trouve dans les chemins suivants :
- Thumblains (Requiered) :
“C:\xampp\htdocs\storage\app\public\product\thumbnail”
- Products (Required) :
“C:\xampp\htdocs\storage\app\public\product”
- Meta (Optional) :
“C:\xampp\htdocs\storage\app\public\product\meta”
2- Il faut assurer que la requête doit avoir les champs comme ceci :
{....
"images": [{"image_name":"2024-08-28-
66cf3101e5a3d.webp","storage":"public"}],
"thumbnail": "2024-08-28-66cf3101ee58c.webp",
"thumbnail_storage_type": "public",
....}
Le slug d’un produit doit être unique pour que ce dernier d’affiche correctement
dans le site.