API Documentation - Product Favorites
Endpoint
POST /product/favorites
Parameters
The following parameters can be included in the request:
Parameter | Type | Description | Required |
---|---|---|---|
guid | string | A unique identifier for the session or user | No |
id_membre | int | The member ID | Yes |
id_product | int | The product ID to add or remove from favorites | Yes |
check | string | Optional flag to check the current status without modifying favorites. Value: "yes" | No |
Response
The response is a JSON object containing the following fields:
{
"success": "true or false",
"message": "Description of the response",
"result": {
"favoris": [
{
"id": "Favorite ID",
"id_membre": "Member ID",
"id_article": "Product ID",
"dateAjout": "Date Added",
"heureAjout": "Time Added"
}
// Additional favorite items
]
}
}
Error Handling
If an error occurs, the response will contain the following fields:
{
"success": "false",
"message": "Error description"
}
Example Request
POST /product/favorites
Content-Type: application/json
{
"guid": "12345",
"id_membre": 678,
"id_product": 91011,
"check": "yes"
}
Example Response
{
"success": "true",
"message": "Favoris added",
"result": {
"favoris": [
{
"id": 1,
"id_membre": 678,
"id_article": 91011,
"dateAjout": "2024-06-01",
"heureAjout": "12:00:00"
}
]
}
}