Public
Documentation Settings

Nodejs Shop

This project is a RESTful API built with Node.js and
Express, designed to power an e-commerce platform. It provides essential
functionalities such as product listing, product creation, and checkout
handling using Stripe for payment processing. The API is backed by
MongoDB, with Mongoose as the ODM.

GETGet All Products

https://shop-api-wx9a.onrender.com/api/shop

Get the entire list of products stored in the MongoDB databases.

json
[
  {
    "name": "Call Of Dutty",
    "price": 50.99,
    "image": "img-url.com",
    "category": "Playstation",
    "stripeId": "stripeId",
    "id": "679cb4c3c4f0af3addd1804b"
  }  
]

POSTCreate Product

http://localhost:8080/api/shop

Add a new product to the MongoDB databases.

json
{
    "name": "Spiderman 2",
    "price": 58,
    "image": "img-url.com",
    "category": "Steam"
}

POSTCheckout

https://shop-api-wx9a.onrender.com/api/shop/checkout

This endpoint handles payments by sending products to the Stripe API and returning a URL to redirect users to the Stripe website to complete the purchase. After the user completes the payment they are returned to the Home Web Page.

json
[{
    "name": "Spiderman 2",
    "price": 58,
    "image": "img-url.com",
    "category": "Steam",
    "stripeId": "stripeId",
    "qty": 1
}]
Loading