{"id":22415192,"url":"https://github.com/german-zarate/ecommerce-rest-api","last_synced_at":"2025-10-15T21:30:28.796Z","repository":{"id":240225209,"uuid":"800524753","full_name":"german-zarate/ecommerce-rest-api","owner":"german-zarate","description":"RESTful API for an ecommerce website with categories, subcategories and products using flask.","archived":false,"fork":false,"pushed_at":"2024-05-14T13:54:34.000Z","size":5,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-05T15:12:05.340Z","etag":null,"topics":["ecommerce-api","flask","python","rest-api","restful-api","sqlalchemy","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/german-zarate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-14T13:54:06.000Z","updated_at":"2024-06-06T02:00:48.000Z","dependencies_parsed_at":"2024-05-17T12:46:59.850Z","dependency_job_id":"99e3922b-1678-405b-adaa-f76d5c4112ae","html_url":"https://github.com/german-zarate/ecommerce-rest-api","commit_stats":null,"previous_names":["german-zarate/ecommerce-rest-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/german-zarate%2Fecommerce-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/german-zarate%2Fecommerce-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/german-zarate%2Fecommerce-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/german-zarate%2Fecommerce-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/german-zarate","download_url":"https://codeload.github.com/german-zarate/ecommerce-rest-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236641547,"owners_count":19181889,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ecommerce-api","flask","python","rest-api","restful-api","sqlalchemy","sqlite"],"created_at":"2024-12-05T15:11:35.301Z","updated_at":"2025-10-15T21:30:28.231Z","avatar_url":"https://github.com/german-zarate.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003eEcommerce REST API\u003c/h1\u003e\nRESTful HTTP API using Python Flask that allows users to manage their ecommerce platform.\n\u003cbr\u003e\u003c/br\u003e\nAbility to create, read, update, and delete products, categories and subcategories. A category can have multiple subcategories and a subcategory can belong to multiple categories. Products can belong to multiple categories and subcategories.\n\u003cbr\u003e\u003c/br\u003e\nFetching a product fetches the details of categories and subcategories it belongs to. Provides the ability to search for products by name, category and subcategories.\n\u003cbr\u003e\u003c/br\u003e\nPaginates result when products are fetched by categories or subcategories. \n\n### Requirements\n```bash\npip install -r requirements.txt\n```\n\n\n### Usage\n\nStart the server:\n\n`python app.py` (Starts the server on 127.0.0.1:5000)\n\nThis project is preloaded with a dummy `sqlite` database located in the `instance` directory. To start from a scratch db, delete the `instance` directory and start the server.\n\nTo test the API using Postman, install postman agent in your OS and call the API using Postman.\n\n### Endpoints\n\n#### Fetch products using name, category, subcategory\n- [GET] `/product/\u003cname: string\u003e` - Get product with name: `name`\n\u003cbr\u003e\u003c/br\u003e\n- [GET] `/subcategory/\u003csubcategory_id: int\u003e/products` - Get product with within subcategory `subcategory`. Returns first page of the paginated results.\n\u003cbr\u003e\u003c/br\u003e\n- [GET] `/subcategory/\u003csubcategory_id: int\u003e/products?page=\u003cpage_no\u003e` - Get product with within subcategory `subcategory`. Returns `page_no` of the paginated results.\n\u003cbr\u003e\u003c/br\u003e\n- [GET] `/category/\u003ccategory_id: int\u003e/products` - Get product with within category `category`. Returns first page of the paginated results.\n\u003cbr\u003e\u003c/br\u003e\n- [GET] `/category/\u003ccategory_id: int\u003e/products?page=\u003cpage_no\u003e` - Get product with within category `category`. Returns `page_no` of the paginated results.\n\n\u003cbr\u003e\u003c/br\u003e\n#### Category\n- [GET] `/categories` - Get all categories\n- [GET] `/category/(int: category_id)` - Get category with category_id\n- [DELETE] `/category/(int: category_id)` - Delete category with category_id\n\n- [POST] `/category/create` - Create a new category\n```\n{\n  \"name\": \"name\",\n  \"subcategories\": [\u003csubcategory ids\u003e] //optional\n}\n```\n\n- [PUT] `/category/(int: category_id)/update` - Update category with category_id\n```\n{\n  \"name\": \"name\",\n  \"subcategories\": [\u003csubcategory ids\u003e] //optional\n}\n```\n\n\u003cbr\u003e\u003c/br\u003e\n#### Subcategory\n- [GET] `/subcategories` - Get all subcategories\n- [GET] `/subcategory/(int: subcategory_id)` - Get subcategory with subcategory_id\n- [DELETE] `/subcategory/(int: subcategory_id)` - Delete subcategory with subcategory_id\n\n- [POST] `/subcategory/create` - Create a new subcategory\n```\n{\n  \"name\": \"name\",\n  \"categories\": [(category ids)] //optional\n  \"products\": [\u003csubcategory ids\u003e] // optional\n}\n```\n\n- [PUT] `/subcategory/(int: subcategory_id)/update` - Update subcategory with subcategory_id\n```\n{\n  \"name\": \"name\",\n  \"categories\": [\u003ccategory ids\u003e] //optional\n  \"products\": [\u003csubcategory ids\u003e] // optional\n}\n```\n\n\n\u003cbr\u003e\u003c/br\u003e\n#### Product\n- [GET] `/products` - Get all products\n- [GET] `/product/(int: product_id)` - Get product with product_id\n- [DELETE] `/product/(int: product_id)` - Delete product with product_id\n\n- [POST] `/product/create` - Create a new product\n```\n{\n  \"name\": \"name\",\n  \"description\": \"description\",\n  \"subcategories\": [\u003csubcategory ids\u003e] //optional\n}\n```\n\n- [PUT] `/product/(int: product_id)/update` - Update product with product_id\n```\n{\n  \"name\": \"name\",\n  \"description\": \"description\",\n  \"subcategories\": [\u003csubcategory ids\u003e] //optional\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerman-zarate%2Fecommerce-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgerman-zarate%2Fecommerce-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgerman-zarate%2Fecommerce-rest-api/lists"}