NAV
shell javascript


Introduction

Welcome to The Growing Developer API ! Connect with our APIs to kickstart your learning career. I promise to be a constant companion in your learning. I had the urge to spread the knowledge to all so I started my Youtube channel that you all love and support. Taking it to the next level, I worked very hard to create a full fledged API for you all to learn building E-commerce applications.

You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

Authentication

All the requests will require an API Key to be included as a query parameter.

Parameter Description
apiKey Your API Key Get your API Key

Base Url

https://dev.thegrowingdeveloper.org/api

Products

Product Entity

Product Entity will look like this

  {
  "id": 15970,
  "gender": "Men",
  "masterCategory": "Apparel",
  "subCategory": "Topwear",
  "articleType": "Shirts",
  "baseColour": "Navy Blue",
  "season": "Fall",
  "year": 2011,
  "usage": "Casual",
  "productDisplayName": "Turtle Check Men Navy Blue Shirt",
  "productPrice": 902,
  "productDescription": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillu"
}

For ease of understanding, the response for each request is shown on the right panel. The responses can be formatted in JSON. You can build your Models based on this structure.

Parameter Description
id Integer unique identifier for product
gender String Gender for which product is meant
masterCategory StringMaster Category of the product
subCategory String Sub Category of the product
articleType String Type of the article
baseColour String Color of the product
season String Season when this product is used
year Integer Product make year
usage String How is product used
productDisplayName String Name of the product
productPrice Integer Price of the product
productDescription String Description of the product

Get Products

curl --location --request GET 'https://dev.thegrowingdeveloper.org/api/products/all?apiKey=YOUR_API_KEY'
var requestOptions = {
    method: 'GET',
    redirect: 'follow'
};

fetch("https://dev.thegrowingdeveloper.org/api/products/all?apiKey=YOUR_API_KEY", requestOptions)
    .then(response => response.text())
    .then(result => console.log(result))
    .catch(error => console.log('error', error));

The above command returns JSON structured like this:

[
  {
  "id": 15970,
  "gender": "Men",
  "masterCategory": "Apparel",
  "subCategory": "Topwear",
  "articleType": "Shirts",
  "baseColour": "Navy Blue",
  "season": "Fall",
  "year": 2011,
  "usage": "Casual",
  "productDisplayName": "Turtle Check Men Navy Blue Shirt",
  "productPrice": 902,
  "productDescription": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillu"
  },
  {
    "id": 39386,
    "gender": "Men",
    "masterCategory": "Apparel",
    "subCategory": "Bottomwear",
    "articleType": "Jeans",
    "baseColour": "Blue",
    "season": "Summer",
    "year": 2012,
    "usage": "Casual",
    "productDisplayName": "Peter England Men Party Blue Jeans",
    "productPrice": 795,
    "productDescription": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillu"
  },
  ....

]

This endpoint retrieves all the products across all the categories.

HTTP Request

GET /products/all

Query Parameters

Parameter Description
productId Integer Products related to this category
sortBy String Choose how to sort products.
minPrice Integer Minimum price of the products you want to get
maxPrice IntegerMaximum price of the products you want to get
season String Filter products based on season.
masterCategory & subCategory

Product Images

The product id can be used to fetch the images of the product. The url is as follows :

https://dev.thegrowingdeveloper.org/images/{{productId}}.jpg

Users

Get User Details

This endpoint can be used to get details of the Logged-in User

The above command returns JSON structured like this:

curl --location --request GET 'https://dev.thegrowingdeveloper.org/api/user/details/10?apiKey=YOUR_API_KEY'
var requestOptions = {
  method: 'GET',
  redirect: 'follow'
};

fetch("https://dev.thegrowingdeveloper.org/api/user/details/{{userId}}?apiKey=YOUR_API_KEY", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

{
  "userId": 10,
  "userName": "Simranjeet Singh",
  "userEmail": "simranjeetsingh@gmail.com"
}

Http Request

GET /user/details/{{userId}}

Login User

curl --location --request POST 'https://dev.thegrowingdeveloper.org/api/user/login?apiKey=YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email":"simranjeetsingh@gmail.com",
    "password" : "smmiboy"
}'

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "email": "simranjeetsingh@gmail.com",
  "password": "smmiboy"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://dev.thegrowingdeveloper.org/api/user/login?apiKey=YOUR_API_KEY", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

successful will return JSON structure like this

{
    "message": "Login Successful",
    "userId": 10
}

POST /user/login

This endpoint can be used to log-in a user using email and password.

Body Parameters

Parameter Description
email EmailEmail of the user id to sign in
password String User password

Error Response

Register User

curl --location --request POST 'https://dev.thegrowingdeveloper.org/api/user/register?apiKey=YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "userEmail" : "simranjeetsingh@gmail.com",
    "userPassword" : "smmiboy",
    "userName" : "Simranjeet Singh",
}'

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
    "userEmail": "simranjeetsingh@gmail.com",
    "userPassword": "smmiboy",
    "userName": "Simranjeet Singh",
});

var requestOptions = {
    method: 'POST',
    headers: myHeaders,
    body: raw,
    redirect: 'follow'
};

fetch("https://dev.thegrowingdeveloper.org/api/user/register?apiKey=YOUR_API_KEY", requestOptions)
    .then(response => response.text())
    .then(result => console.log(result))
    .catch(error => console.log('error', error));

successful will return JSON structure like this

{
    "message": "Signup Successful"
}

POST /user/register

This endpoint can be used to log-in a user using email and password.

Body Parameters

Parameter Description
userEmail EmailEmail of the user id to Register
userPassword String User password
userName String Full name of the user

Cart

Get Products in the cart

curl --location --request GET 'https://dev.thegrowingdeveloper.org/api/cart/getCartData/{{userId}}?apiKey=YOUR_API_KEY'
var requestOptions = {
    method: 'GET',
    redirect: 'follow'
};

fetch("https://dev.thegrowingdeveloper.org/api/cart/getCartData/{{userId}}?apiKey=YOUR_API_KEY", requestOptions)
    .then(response => response.text())
    .then(result => console.log(result))
    .catch(error => console.log('error', error));

The above command returns JSON structured like this if there are products otherwise []:

[
    {
      "productId": 15970,
      "productDisplayName": "Turtle Check Men Navy Blue Shirt",
      "color": "Navy Blue",
      "quantity": 1,
      "productPrice": 902
    },
    {
      "productId": 21379,
      "productDisplayName": "Manchester United Men Solid Black Track Pants",
      "color": "Black",
      "quantity": 1,
      "productPrice": 962
    },
    {
      "productId": 29114,
      "productDisplayName": "Puma Men Pack of 3 Socks",
      "color": "Navy Blue",
      "quantity": 1,
      "productPrice": 893
    }
  ]

This endpoint retrieves all the products available in the user's cart.

HTTP Request

GET /cart/getCartData/{{userId}}

Cart Product Entity

Parameter Description
productId Integer Products related to this category
productDisplayName String Choose how to sort products. Possible values are name, price
color String Minimum price of the products you want to get
quantity Integer Minimum price of the products you want to get
productPrice Integer Minimum price of the products you want to get

Add a Product in the Cart

Add a new Product in your cart

curl --location --request POST 'https://dev.thegrowingdeveloper.org/api/cart/addProduct?apiKey=YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "productId" : 21379,
    "quantity" : 3,
    "userId" : 1
}'
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "productId": 21379,
  "quantity": 3,
  "userId": 1
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://dev.thegrowingdeveloper.org/api/cart/addProduct?apiKey=YOUR_API_KEY", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

A successful response will look like this

{
    "status": 1,
    "message": "Product Added Successfully"
}

HTTP Request

POST /cart/addProduct

Body Parameters

Parameter Description
productId Integer Unique Id of the product to be added
quantity Integer quantity of the product
userId Integer User Id for the user who is adding product

Update Product Quantity

This endpoint can be used to update quantity of products in the cart

curl --location --request POST 'https://dev.thegrowingdeveloper.org/api/cart/updateProduct?apiKey=YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "productId" : 21379,
    "quantity" : 3,
    "userId" : 1
}'
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "productId": 21379,
  "quantity": 3,
  "userId": 1
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://dev.thegrowingdeveloper.org/api/cart/updateProduct?apiKey=YOUR_API_KEY", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

A successful response will look like this

{
    "status": 1,
    "message": "Product Updated Successfully"
}

HTTP Request

POST /cart/updateProduct

Body Parameters

Parameter Description
productId Integer Unique Id of the product to be added
quantity Integer quantity of the product
userId Integer User Id for the user who is adding product

Delete Product Cart

This endpoint can be used to delete products from the cart

curl --location --request POST 'https://dev.thegrowingdeveloper.org/api/cart/deleteProduct?apiKey=YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "productId" : 21379,
    "userId" : 1
}'
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "productId": 21379,
  "userId": 1
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://dev.thegrowingdeveloper.org/api/cart/deleteProduct?apiKey=YOUR_API_KEY", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

A successful response will look like this

{
    "status": 1,
    "message": "Product Deleted Successfully"
}

HTTP Request

POST /cart/deleteProduct

Body Parameters

Parameter Description
productId Integer Unique Id of the product to be added
userId Integer User Id for the user who is adding product

Wishlist

Get Products in the Wishlist

curl --location --request GET 'https://dev.thegrowingdeveloper.org/api/wishlist/getWishlistData/{{userId}}?apiKey=YOUR_API_KEY'
var requestOptions = {
    method: 'GET',
    redirect: 'follow'
};

fetch("https://dev.thegrowingdeveloper.org/api/cart/getWishlistData/{{userId}}?apiKey=YOUR_API_KEY", requestOptions)
    .then(response => response.text())
    .then(result => console.log(result))
    .catch(error => console.log('error', error));

The above command returns JSON structured like this if there are products otherwise []:

[
  [
    {
      "productId": 29928,
      "productDisplayName": "Police Men Black Dial Watch PL12889JVSB",
      "color": "Black",
      "productPrice": 996
    },
    {
      "productId": 3168,
      "productDisplayName": "Nike Men's Incinerate MSL White Blue Shoe",
      "color": "White",
      "productPrice": 952
    },
    {
      "productId": 31689,
      "productDisplayName": "Nike Women Lunarfly Grey Sports Shoes",
      "color": "Grey",
      "productPrice": 993
    }
  ]
  ]

This endpoint retrieves all the products available in the user's wishlist.

HTTP Request

GET /wishlist/getWishlistData/{{userId}}

Wishlist Product Entity

Parameter Description
productId Integer Products related to this category
productDisplayName String Choose how to sort products. Possible values are name, price
color String Minimum price of the products you want to get
productPrice Integer Minimum price of the products you want to get

Add a Product in the Wishlist

Add a new Product in your cart

curl --location --request POST 'https://dev.thegrowingdeveloper.org/api/wishlist/addProduct?apiKey=YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "productId" : 21379,
    "userId" : 1
}'
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "productId": 21379,
  "quantity": 3,
  "userId": 1
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://dev.thegrowingdeveloper.org/api/wishlist/addProduct?apiKey=YOUR_API_KEY", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

A successful response will look like this

{
    "status": 1,
    "message": "Product Added Successfully"
}

HTTP Request

POST /wishlist/addProduct

Body Parameters

Parameter Description
productId Integer Unique Id of the product to be added
userId Integer User Id for the user who is adding product

Delete a product from Wishlist

Delete a Product from your wishlist

curl --location --request POST 'https://dev.thegrowingdeveloper.org/api/wishlist/addProduct?apiKey=YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "productId" : 21379,
    "userId" : 1
}'
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "productId": 21379,
  "userId": 1
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://dev.thegrowingdeveloper.org/api/wishlist/deleteProduct?apiKey=YOUR_API_KEY", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

A successful response will look like this

{
    "status": 1,
    "message": "Product Deleted Successfully"
}

HTTP Request

POST /wishlist/deleteProduct

Body Parameters

Parameter Description
productId Integer Unique Id of the product to be deleted
userId Integer User Id for the user who is deleting product

Errors

The Growing Developer API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
404 Not Found -- The specified resource could not be found.
500 Internal Server Error -- We had a problem with our server. Try again later.