- Core API's
- >
- Products API Documentation
Products API Documentation
A Simple to use CRUD API for your Products application. This API is ready to use with any frontend/backend framework or language.
Endpoints
Name | Endpoint | Method | Copy |
---|---|---|---|
Product List | /api/products | GET | |
Product Detail | /api/products/1 | GET | |
Product Create | /api/products | POST | |
Product Update | /api/products/1 | PUT | |
Product Delete | /api/products/1 | DELETE |
How to Use
Product List API
fetch('https://simplecrudapi.com/api/products')
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));
Product Detail API
fetch('https://simplecrudapi.com/api/products/1')
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));
Product Create API
fetch('https://simplecrudapi.com/api/products', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
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’s designed for professional photographers who need high resolution and advanced video features.',
price: 2499.99,
category_id: 2,
quantity: 35,
is_available: true
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error));
Product Update API
fetch('https://simplecrudapi.com/api/products/1', {
method: 'PUT',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Canon EOS 5D Mark IV',
description: 'Updated The Canon EOS 5D Mark IV is a professional DSLR camera that combines outstanding image quality, advanced features, and exceptional performance. It’s designed for professional photographers who need high resolution and advanced video features.',
price: 2499.99,
category_id: 2,
quantity: 35,
is_available: true
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error))
Product Delete API
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))
Code Sandbox Demos
No Code sandbox demos found yet!
No demos found, You can create a demo and contact us to put that with your credit link.
Contact UsOr,
Browse All Code sandbox Demos