POST
/products
curl \
--request POST 'https://garden-to-yours.herokuapp.com/products' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"type":"plant","image":"http://example.com","price":20,"title":"La planta que come","description":"Es una planta carnivora","publisherId":"5345345fdsfg"}'
Request example
{
"type": "plant",
"image": "http://example.com",
"price": 20,
"title": "La planta que come",
"description": "Es una planta carnivora",
"publisherId": "5345345fdsfg"
}
Response examples (201)
{
"_id": "string",
"publisherId": {
"_id": "string",
"firstName": "string",
"email": "hello@example.com",
"username": "string",
"password": "string",
"lastName": "string",
"dateOfBirth": "2000-08-24T00:00:00.000Z",
"emailVerified": true,
"createDate": "2025-05-04",
"location": "string",
"image": "string"
},
"images": [
"https://example.com"
],
"title": "string",
"size": "string",
"price": 42.0,
"type": "plant",
"description": "string",
"publishedDate": "2025-05-04",
"sold": true,
"category": {
"type": "plant",
"category": "string",
"subcategory": "string"
}
}