- Core API's
- >
- Products API
- >
- Products - Delete
Products - Delete API
Delete the specified Product.
Method DELETE
Parameters
Name | Details | Type | Required |
---|---|---|---|
id
|
The ID of the Product. | integer | Yes |
How to Use
fetch('https://simplecrudapi.com/api/products/1', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error))
Response
{
"data": {
"id": 1,
"name": "Canon EOS 5D Mark IV",
"description": "The Canon EOS 5D Mark IV is a professional DSLR camera that combines outstanding image quality, advanced features, and exceptional performance. It\u2019s designed for professional photographers who need high resolution and advanced video features.",
"price": 2499.99,
"quantity": 35,
"is_available": true,
"category": {
"id": 2,
"name": "Cameras",
"description": "Photography and video equipment for capturing high-quality images and videos.",
"created_at": "2024-11-09T19:53:48+00:00",
"updated_at": "2024-11-09T19:53:48+00:00"
},
"created_at": "2024-11-09T20:12:15.000000Z",
"updated_at": "2024-11-09T20:12:15.000000Z"
}
}
Try Now
fetch('https://simplecrudapi.com/api/products/1', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error))