{"id":16136738,"url":"https://github.com/prinx/dotnet-shopping-cart","last_synced_at":"2025-04-06T16:40:56.594Z","repository":{"id":49215187,"uuid":"375632295","full_name":"prinx/dotnet-shopping-cart","owner":"prinx","description":"Sample Shopping Cart API using .NET Core","archived":false,"fork":false,"pushed_at":"2021-06-23T08:28:25.000Z","size":79,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T04:32:44.358Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prinx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-10T08:51:34.000Z","updated_at":"2021-06-23T06:27:11.000Z","dependencies_parsed_at":"2022-09-09T12:50:42.160Z","dependency_job_id":null,"html_url":"https://github.com/prinx/dotnet-shopping-cart","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prinx%2Fdotnet-shopping-cart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prinx%2Fdotnet-shopping-cart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prinx%2Fdotnet-shopping-cart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prinx%2Fdotnet-shopping-cart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prinx","download_url":"https://codeload.github.com/prinx/dotnet-shopping-cart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247517058,"owners_count":20951708,"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":[],"created_at":"2024-10-09T23:13:00.588Z","updated_at":"2025-04-06T16:40:56.577Z","avatar_url":"https://github.com/prinx.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dotnet Shopping Cart\n\nExample of Shopping Cart API using .NET Core\n\nThis project assumes a user can have only one cart.\n\n## API Documentation\n\n\n### Add a new user\n\n```http\nPOST http://localhost:5000/api/users\nContent-type: application/json\n\n{\n    \"name\": \"Caroline\",\n    \"phoneNumber\": \"233...\"\n}\n```\n\n### Add product\n\n```http\nPOST http://localhost:5000/api/products\nContent-type: application/json\n\n{\n    \"name\": \"Keyboard\",\n    \"price\": 5000,\n    \"inStock\": true\n}\n```\n\n### Add item to cart\n\n```http\nPOST http://localhost:5000/api/cartItems\nContent-type: application/json\n\n{\n    \"ProductId\": 3,\n    \"UserId\": 2,\n    \"Quantity\": 1\n}\n```\n\n- Quantity is optional and is 1 by default\n- A new cart item will be created if it does not exist\n- Only cart item quantity will be updated if cart item already exist\n\n### Delete cart item\n\n```http\nDELETE http://localhost:5000/api/cartItems\nContent-type: application/json\n\n{\n    \"ProductId\": 3,\n    \"UserId\": 2,\n    \"Quantity\": 1\n}\n```\n\nThis will reduce the quantity of the cart item. The product is deleted when the remaining quantity is less or equal to 0.\n\n### Get user's cart\n\n```http\nGET http://localhost:5000/api/cartItems/user/{userId}\n```\n\n## Swagger link\n\nUse this link Swagger interface after building the project (should open automatically in the browser after a build):\n\n\u003chttp://localhost:5000/swagger/index.html\u003e\n\n## Improvments\n\n- Add unit tests\n- Use a service based architecture \n\n## LICENSE\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprinx%2Fdotnet-shopping-cart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprinx%2Fdotnet-shopping-cart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprinx%2Fdotnet-shopping-cart/lists"}