[go: up one dir, main page]

0% found this document useful (0 votes)
53 views5 pages

Api Documentation Ecommerce Product

Uploaded by

sebincherian
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views5 pages

Api Documentation Ecommerce Product

Uploaded by

sebincherian
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

API Documentation: E-commerce Product API

Endpoint: /products

Method: GET

Description: Retrieves a list of all products.

Parameters:

- page (integer): The page number for paginated results.

- category (string): The category of products.

Response:

- status (integer): HTTP status code.

- data (array): Contains the list of products.

- id (integer): The product ID.

- name (string): The name of the product.

- price (float): The price of the product.

- category (string): The category of the product.

- stock (integer): The available stock of the product.

Endpoint: /products/{id}

Method: GET
Description: Retrieves information about a specific product.

Parameters:

- id (integer): The ID of the product.

Response:

- status (integer): HTTP status code.

- data (object): Contains the product's information.

- id (integer): The product ID.

- name (string): The name of the product.

- description (string): The description of the product.

- price (float): The price of the product.

- category (string): The category of the product.

- stock (integer): The available stock of the product.

- created_at (string): The creation date of the product.

Endpoint: /products

Method: POST

Description: Creates a new product.

Parameters:
- name (string): The name of the product.

- description (string): The description of the product.

- price (float): The price of the product.

- category (string): The category of the product.

- stock (integer): The available stock of the product.

Response:

- status (integer): HTTP status code.

- data (object): Contains the newly created product's information.

- id (integer): The product ID.

- name (string): The name of the product.

- description (string): The description of the product.

- price (float): The price of the product.

- category (string): The category of the product.

- stock (integer): The available stock of the product.

Endpoint: /products/{id}

Method: PUT

Description: Updates information about a specific product.


Parameters:

- id (integer): The ID of the product.

- name (string): The name of the product (optional).

- description (string): The description of the product (optional).

- price (float): The price of the product (optional).

- category (string): The category of the product (optional).

- stock (integer): The available stock of the product (optional).

Response:

- status (integer): HTTP status code.

- data (object): Contains the updated product's information.

- id (integer): The product ID.

- name (string): The name of the product.

- description (string): The description of the product.

- price (float): The price of the product.

- category (string): The category of the product.

- stock (integer): The available stock of the product.

Endpoint: /products/{id}
Method: DELETE

Description: Deletes a specific product.

Parameters:

- id (integer): The ID of the product.

Response:

- status (integer): HTTP status code.

- data (object): Contains the status of the deletion request.

- message (string): The result of the deletion.

You might also like