{"id":26537504,"url":"https://github.com/kuzmenkous/drf-ecommerce","last_synced_at":"2025-03-21T22:44:51.343Z","repository":{"id":156745923,"uuid":"626652933","full_name":"kuzmenkous/drf-ecommerce","owner":"kuzmenkous","description":"Django Rest Framework e-commerce project","archived":false,"fork":false,"pushed_at":"2023-05-18T15:04:09.000Z","size":131,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-15T12:32:35.153Z","etag":null,"topics":["celery","django","django-rest-framework","docker","docker-compose","postgresql","python","redis","restful-api","swagger"],"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/kuzmenkous.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":"2023-04-11T22:43:09.000Z","updated_at":"2025-01-22T11:59:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"4270b76b-8799-4f86-a004-a8b9bdeaf065","html_url":"https://github.com/kuzmenkous/drf-ecommerce","commit_stats":null,"previous_names":["kuzmenkous/drf-ecommerce"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuzmenkous%2Fdrf-ecommerce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuzmenkous%2Fdrf-ecommerce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuzmenkous%2Fdrf-ecommerce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kuzmenkous%2Fdrf-ecommerce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kuzmenkous","download_url":"https://codeload.github.com/kuzmenkous/drf-ecommerce/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244880542,"owners_count":20525511,"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":["celery","django","django-rest-framework","docker","docker-compose","postgresql","python","redis","restful-api","swagger"],"created_at":"2025-03-21T22:44:50.774Z","updated_at":"2025-03-21T22:44:51.337Z","avatar_url":"https://github.com/kuzmenkous.png","language":"Python","funding_links":["https://www.paypal.com/ua/welcome/signup/","https://developer.paypal.com/dashboard/","https://developer.paypal.com/dashboard/applications/sandbox","https://developer.paypal.com/dashboard/accounts","https://developer.paypal.com/dashboard/accounts/create","https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout\u0026token=EC-2AH72020TS646435P"],"categories":[],"sub_categories":[],"readme":"# DRF ECOMMERCE\n\nDRF Ecommerce is an e-commerce platform built using Django and Django Rest Framework (DRF). It provides a set of APIs\nfor managing products, orders, and user authentication.\n\n## Configure .env file\n\n###### DJANGO SETTINGS\n\n- SECRET_KEY - you can generate it [here](https://djecrety.ir/).\n- DEBUG - by default this value is ```True```.\n- LANGUAGE_CODE - by default this value is ```en-us```.\n- TIME_ZONE - by default this value is ```UTC```\n\n  ###### DATABASE CONNECTION\n- DB_ENGINE - by default this value is ```django.db.backend.sqlite3```.\n  For example, you can write ```django.db.backends.postgresql```.\n- DB_NAME - any database name that you want, for example ```drf_ecommerce_db```.\n- DB_USER - any user that you want.\n- DB_PASSWORD - any password that you want.\n- DB_HOST - ```localhost```.\n- DB_PORT - ```5432``` for example.\n\n  ###### EMAIL CONNECTION\n- EMAIL_HOST - any email host that you want, for example\n  you can use gmail - ```EMAIL_HOST=smtp.gmail.com```\n- EMAIL_HOST_USER - your email.\n- EMAIL_HOST_PASSWORD - password from your account if you\n  don't use 2FA authentication. If you are using 2FA authentication\n  you need to paste here password which Google(if you are yousing Gmail) provided to you during the setup process.\n- EMAIL_PORT - ```587``` for example.\n- EMAIL_USE_TLS - ```True``` for example.\n  #### Some articles about email sending in Django\n- ***[Send emails with Django and Gmail , a better way](https://dev.to/abderrahmanemustapha/how-to-send-email-with-django-and-gmail-in-production-the-right-way-24ab)***\n- ***[How to Send Email with Django](https://www.abstractapi.com/guides/django-send-email)***\n- ***[How to send emails with python django through google SMTP server for free](https://bshoo.medium.com/how-to-send-emails-with-python-django-through-google-smtp-server-for-free-22ea6ea0fb8e)***\n- ***[Use Django to send emails with SMTP](https://opensource.com/article/22/12/django-send-emails-smtp)***\n\n  ###### NOVA POSHTA\n- NOVA_POSHTA_API_KEY - your nova poshta API KEY.\n  To generate API KEY go [there](https://new.novaposhta.ua/), register or\n  Sign In. Go to the [settings](https://new.novaposhta.ua/dashboard/settings) and\n  after [security](https://new.novaposhta.ua/dashboard/settings/developers) and generate API KEY\n  and paste it here ```NOVA_POSHTA_API_KEY=your_api_key```\n\n  ###### PAYPAL\n  #### First of all you need to create an account.\n- [Create paypal account](https://www.paypal.com/ua/welcome/signup/#/intent)\n- [Go to the dashboard](https://developer.paypal.com/dashboard/)\n- [Go apps \u0026 credentials](https://developer.paypal.com/dashboard/applications/sandbox) and create app.\n- Go to your created app.\n\n  #### In .env file\n- PAYPAL_CLIENT_ID - paste your ```client_id``` from you app page.\n- PAYPAL_CLIENT_SECRET - paste ```your secret_key``` from your app page.\n\n  #### To test payments create sandox account\n- Go to the [Testing Tools/Sandox accounts](https://developer.paypal.com/dashboard/accounts)\n- [Create account](https://developer.paypal.com/dashboard/accounts/create)\n- Select personal(Buyer Account) and create account.\n- [At the accounts page](https://developer.paypal.com/dashboard/accounts) click for three buttons and\n  click ```view/edit``` account.\n- Go to the funding, scroll to down and click edit.\n- Write amount that you want to have in an account and click save.\n\n## Installation and running\n\n1. ### Clone the repository:\n\n```git\ngit clone https://github.com/okuzmenko31/drf-ecommerce.git\n```\n\n2. ### Go to the project directory:\n\n```python\ncd\necommerce\n```\n\n3. ### Build app with docker-compose\n\n```shell\ndocker-compose build\n```\n\n4. ### Up docker-compose\n\n```shell\ndocker-compose up\n```\n\n## API Reference\n\n## Registration\n\n### Request\n\n``POST /api/v1/user/registration/``\n\n```\n{\n    \"email\": \"test@gmail.com\",\n    \"password\": \"password\",\n    \"password1\": \"password\"\n}\n```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: POST, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"status\": 200,\n    \"message\": \"Mail with registration link has been sent to your email.\",\n    \"data\": {\n        \"email\": \"test@gmail.com\"\n    }\n}\n```\n\n## Confimation of email and registration\n\n### Request\n\n```GET /api/v1/user/confirm_email/\u003ctoken\u003e/\u003cemail\u003e/```\n\n### Response - if all is ok.\n\n```\nHTTP 200 OK\nAllow: GET, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"success\": \"You successfully confirmed your email!\"\n}\n```\n\n## Login\n\n### Request\n\n```POST /api/v1/user/login/```\n\n```\n{\n    \"email\": \"test@gmail.com\",\n    \"password\": \"password\"\n}\n```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, POST, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"message\": \"Successful authentication\",\n    \"token\": \"c897d02a01eb25710955228d1c26d70554895660\"\n}\n```\n\n## Profile\n\n### Request\n\n```GET /api/v1/user/profile/```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, PUT, PATCH, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"username\": \"@test\",\n    \"full_name\": null,\n    \"email\": \"test@gmail.com\"\n}\n```\n\n### Request\n\n```PUT /api/v1/user/profile/```\n\n```\n{\n    \"username\": \"@test\",\n    \"full_name\": Test User\n}\n```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, PUT, PATCH, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"username\": \"@test\",\n    \"full_name\": Test User,\n    \"email\": \"test@gmail.com\"\n}\n```\n\n## Change email\n\n### Request\n\n```POST /api/v1/user/change_email/```\n\n```\n{\n   \"email\": \"new_test@gmail.com\"\n}\n```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: POST, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"success\": \"Mail with email changing confirmation has been sent to your new email. Your email in this account will be changed after confirmation.\"\n}\n```\n\n## Email changing confirmation\n\n### Request\n\n```GET /api/v1/change_email_confirm/\u003ctoken\u003e/\u003cemail\u003e/```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"success\": \"You successfully changed your email\"\n}\n```\n\n## Password reset\n\n### Request\n\n```POST /api/v1/user/password_reset/```\n\n```\n{\n   \"email\": \"new_test@gmail.com\"\n}\n```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: POST, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"success\": \"Mail with password reset confirmation has been sent to your email.\"\n}\n```\n\n## Password reset confirmation\n\n### Request\n\n```GET /api/v1/user/password_reset/\u003ctoken\u003e/\u003cemail\u003e/```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, POST, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"message\": \"Password reset page. Write new password.\"\n}\n```\n\n### Request\n\n```POST /api/v1/user/password_reset/\u003ctoken\u003e/\u003cemail\u003e/```\n\n```\n{\n   \"password\": \"new_password\",\n   \"password1\": \"new_password\"\n}\n```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, POST, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"success\": \"Password reset success.\"\n}\n```\n\n## Bonuses balance page\n\n### Request\n\n```GET /api/v1/user/bonuses_balance/```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n[\n    {\n        \"user\": 8,\n        \"balance\": 0\n    }\n]\n```\n\n## Update bonuses balance - only for admins\n\n### Request\n\n```PUT /api/v1/user/update_bonuses/\u003cpk\u003e/```\n\n```\n{\n    \"balance\": 100\n}\n```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, PUT, PATCH, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"user\": 2,\n    \"balance\": 100\n}\n```\n\n## Products\n\n### Request\n\n```GET /api/v1/products/```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, POST, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n[\n    {\n        \"id\": 2,\n        \"name\": \"Apple iPhone 13 Pro 256GB Space Black\",\n        \"category\": 3,\n        \"price\": 54356,\n        \"price_with_discount\": 54356,\n        \"description\": null,\n        \"photo\": null,\n        \"discount\": 0,\n        \"article\": \"786081\",\n        \"rating\": \"0.0\",\n        \"availability_status\": \"in stock\"\n    },\n    {\n        \"id\": 3,\n        \"name\": \"Apple iPhone 13 Pro 256GB Deep Purple\",\n        \"category\": 3,\n        \"price\": 52000,\n        \"price_with_discount\": 51480,\n        \"description\": null,\n        \"photo\": null,\n        \"discount\": 1,\n        \"article\": \"791854\",\n        \"rating\": \"0.0\",\n        \"availability_status\": \"low in stock\"\n    },\n    {\n        \"id\": 1,\n        \"name\": \"Apple iPhone 13 Pro 128GB Space Black\",\n        \"category\": 3,\n        \"price\": 57859,\n        \"price_with_discount\": 56701,\n        \"description\": null,\n        \"photo\": null,\n        \"discount\": 2,\n        \"article\": \"8006227\",\n        \"rating\": \"0.0\",\n        \"availability_status\": \"in stock\"\n    }\n]\n```\n\n### Request - only for admins\n\n```POST /api/v1/products/```\n\n```\n{\n    \"name\": \"Apple iPhone 14 Pro Max 512GB Space Black\",\n    \"category\": 4,\n    \"price\": 65999,\n    \"description\": null,\n    \"photo\": null,\n    \"discount\": 2,\n    \"article\": \"sdf1fsa\"\n}\n```\n\n### Response\n\n```\nHTTP 201 Created\nAllow: GET, POST, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"id\": 5,\n    \"name\": \"Apple iPhone 14 Pro Max 512GB Space Black\",\n    \"category\": 4,\n    \"price\": 65999,\n    \"price_with_discount\": 64019,\n    \"description\": null,\n    \"photo\": null,\n    \"discount\": 3,\n    \"article\": \"sdf1fsa\",\n    \"rating\": \"0.0\",\n    \"availability_status\": \"in stock\"\n}\n```\n\n## Product detail\n\n### Request\n\n```GET /api/v1/products/\u003cpk\u003e/```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"id\": 1,\n    \"name\": \"Apple iPhone 13 Pro 128GB Space Black\",\n    \"category\": 3,\n    \"price\": 57859,\n    \"price_with_discount\": 56701,\n    \"description\": null,\n    \"photo\": null,\n    \"discount\": 2,\n    \"article\": \"8006227\",\n    \"rating\": \"0.0\",\n    \"availability_status\": \"in stock\"\n}\n\n```\n\n## Products by category\n\n### Request\n\n```GET /api/v1/products/by_category/\u003ccategory_id\u003e/```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n[\n    {\n        \"id\": 1,\n        \"name\": \"Apple iPhone 13 Pro 128GB Space Black\",\n        \"category\": 3,\n        \"price\": 57859,\n        \"price_with_discount\": 56701,\n        \"description\": null,\n        \"photo\": null,\n        \"discount\": 2,\n        \"article\": \"8006227\",\n        \"rating\": \"0.0\",\n        \"availability_status\": \"in stock\"\n    },\n    {\n        \"id\": 2,\n        \"name\": \"Apple iPhone 13 Pro 256GB Space Black\",\n        \"category\": 3,\n        \"price\": 54356,\n        \"price_with_discount\": 54356,\n        \"description\": null,\n        \"photo\": null,\n        \"discount\": 0,\n        \"article\": \"786081\",\n        \"rating\": \"0.0\",\n        \"availability_status\": \"in stock\"\n    },\n    {\n        \"id\": 3,\n        \"name\": \"Apple iPhone 13 Pro 256GB Deep Purple\",\n        \"category\": 3,\n        \"price\": 52000,\n        \"price_with_discount\": 51480,\n        \"description\": null,\n        \"photo\": null,\n        \"discount\": 1,\n        \"article\": \"791854\",\n        \"rating\": \"0.0\",\n        \"availability_status\": \"low in stock\"\n    },\n    {\n        \"id\": 5,\n        \"name\": \"Apple iPhone 13 Pro 512GB Space Black\",\n        \"category\": 3,\n        \"price\": 65999,\n        \"price_with_discount\": 64019,\n        \"description\": null,\n        \"photo\": null,\n        \"discount\": 3,\n        \"article\": \"sdf1fsa\",\n        \"rating\": \"0.0\",\n        \"availability_status\": \"in stock\"\n    }\n]\n```\n\n## Product variations\n\n### Request\n\n```GET /api/v1/products/variations/\u003cproduct_id\u003e/```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n[\n    {\n        \"id\": 6,\n        \"variation_category_name\": \"Color Deep Purple\",\n        \"product_name\": \"Apple iPhone 13 Pro 256GB Deep Purple\",\n        \"product_link\": \"/api/v1/products/3/\"\n    },\n    {\n        \"id\": 1,\n        \"variation_category_name\": \"Memory 128GB\",\n        \"product_name\": \"Apple iPhone 13 Pro 128GB Space Black\",\n        \"product_link\": \"/api/v1/products/1/\"\n    }\n]\n```\n\n## Product variations by variation category\n\n### Request\n\n```GET /api/v1/products/variations/\u003cproduct_id\u003e/\u003cparent_id\u003e/```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n[\n    {\n        \"id\": 1,\n        \"variation_category_name\": \"Memory 128GB\",\n        \"product_name\": \"Apple iPhone 13 Pro 128GB Space Black\",\n        \"product_link\": \"/api/v1/products/1/\"\n    }\n]\n```\n\n## Categories\n\n### Request\n\n```GET /api/v1/categories/```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, POST, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n[\n    {\n        \"id\": 1,\n        \"name\": \"Smartphones\",\n        \"parent\": null\n    },\n    {\n        \"id\": 2,\n        \"name\": \"Apple Smartphones\",\n        \"parent\": 1\n    },\n    {\n        \"id\": 3,\n        \"name\": \"Apple iPhone 13 Pro\",\n        \"parent\": 2\n    },\n    {\n        \"id\": 4,\n        \"name\": \"Xiamo\",\n        \"parent\": null\n    }\n]\n\n```\n\n### Request - only for admins\n\n```POST /api/v1/categories/```\n\n```\n{\n    \"id\": 9,\n    \"name\": \"Samsung smarthphones\",\n    \"parent\": 1\n}\n```\n\n### Response\n\n```\nHTTP 201 Created\nAllow: GET, POST, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n\n\n    \"id\": 1,\n    \"name\": \"Smartphones\",\n    \"parent\": null\n}\n```\n\n## Category detail\n\n### Request\n\n```GET /api/v1/categories/\u003cpk\u003e/```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"id\": 1,\n    \"name\": \"Smartphones\",\n    \"parent\": null\n}\n```\n\n### Request - only for admins\n\n```PUT /api/v1/categories/\u003cpk\u003e/```\n\n```\n{\n    \"id\": 1,\n    \"name\": \"New smartphones\",\n    \"parent\": null\n}\n```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"id\": 1,\n    \"name\": \"New Smartphones\",\n    \"parent\": null\n}\n```\n\n### Request - only for admins\n\n```DELETE /api/v1/categories/\u003cpk\u003e/```\n\n### Response\n\n```\nHTTP 204 No Content\nAllow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n```\n\n## Basket\n\n### Request\n\n```GET /api/v1/basket/```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"basket\": \"You dont have items in your basket!\"\n}\n```\n\n## Basket add\n\n### Request\n\n```POST /api/v1/basket/add/\u003cproduct_id\u003e/```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: POST, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"basket\": {\n        \"user\": 2,\n        \"owner_username\": \"@admin\"\n    },\n    \"items\": [\n        {\n            \"product\": 1,\n            \"product_name\": \"Apple iPhone 13 Pro 128GB Space Black\",\n            \"quantity\": 1,\n            \"total_price\": 56701\n        }\n    ],\n    \"total_amount\": 56701,\n    \"total_quantity_of_products\": 1\n}\n```\n\n## Basket add quantity\n\n### Request\n\n```POST /api/v1/basket/add_quantity/\u003cproduct_id\u003e/```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: POST, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"basket\": {\n        \"user\": 2,\n        \"owner_username\": \"@admin\"\n    },\n    \"items\": [\n        {\n            \"product\": 1,\n            \"product_name\": \"Apple iPhone 13 Pro 128GB Space Black\",\n            \"quantity\": 2,\n            \"total_price\": 113402\n        }\n    ],\n    \"total_amount\": 113402,\n    \"total_quantity_of_products\": 2\n}\n```\n\n## Basket minus quantity\n\n### Request\n\n```POST /api/v1/basket/minus_quantity/\u003cproduct_id\u003e/```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: POST, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"basket\": {\n        \"user\": 2,\n        \"owner_username\": \"@admin\"\n    },\n    \"items\": [\n        {\n            \"product\": 1,\n            \"product_name\": \"Apple iPhone 13 Pro 128GB Space Black\",\n            \"quantity\": 1,\n            \"total_price\": 56701\n        }\n    ],\n    \"total_amount\": 56701,\n    \"total_quantity_of_products\": 1\n}\n```\n\n## Basket clear\n\n### Request\n\n```POST /api/v1/basket/clear/```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, POST, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"basket\": {\n        \"user\": 2,\n        \"owner_username\": \"@admin\"\n    },\n    \"items\": [],\n    \"total_amount\": 0,\n    \"total_quantity_of_products\": 0\n}\n```\n\n## Checkout\n\n### Request\n\n```GET /api/v1/orders/checkout/```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, POST, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"basket\": {\n        \"user\": 2,\n        \"owner_username\": \"@admin\"\n    },\n    \"items\": [\n        {\n            \"product\": 1,\n            \"product_name\": \"Apple iPhone 13 Pro 128GB Space Black\",\n            \"quantity\": 1,\n            \"total_price\": 56701\n        }\n    ],\n    \"total_amount\": 56701,\n    \"total_quantity_of_products\": 1\n}\n```\n\n### Request\n\n```POST /api/v1/orders/checkout/```\n\n```\n{\n    \"shipping_info\": {\n        \"name\": \"Test\",\n        \"surname\": \"User\",\n        \"patronymic\": \"Userovich\",\n        \"email\": \"new_test@gmail.com\",\n        \"address\": \"Test address\",\n        \"city\": \"Абазівка (Полтавський р-н, Полтавська обл)\",\n        \"post_office\": \"Відділення №5 (до 30 кг): вул. Перемоги, 13, прим. №1, 2, 3, 4\"\n        \n    },\n    \"payment_method\": 2,\n    \"delivery_method\": 2,\n    \"coupon\": null,\n    \"activate_bonuses\": false,\n    \"comment\": \"\",\n    \"create_account\": false\n}\n```\n\n### Response\n\n```\nHTTP 201 Created\nAllow: GET, POST, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"id\": 89,\n    \"shipping_info\": {\n        \"name\": \"Test\",\n        \"surname\": \"User\",\n        \"patronymic\": \"Userovich\",\n        \"email\": \"new_test@gmail.com\",\n        \"address\": \"Test address\",\n        \"city\": \"Абазівка (Полтавський р-н, Полтавська обл)\",\n        \"post_office\": \"Відділення №5 (до 30 кг): вул. Перемоги, 13, прим. №1, 2, 3, 4\"\n    },\n    \"payment_method\": 2,\n    \"delivery_method\": 2,\n    \"coupon\": null,\n    \"activate_bonuses\": false,\n    \"comment\": \"\",\n    \"create_account\": false,\n    \"total_amount\": 56701,\n    \"payment_link\": \"https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout\u0026token=EC-2AH72020TS646435P\",\n    \"order_items\": [\n        {\n            \"order_id\": 89,\n            \"product\": {\n                \"id\": 1,\n                \"name\": \"Apple iPhone 13 Pro 128GB Space Black\",\n                \"category\": 3,\n                \"price\": 57859,\n                \"price_with_discount\": 56701,\n                \"description\": null,\n                \"photo\": null,\n                \"discount\": 2,\n                \"article\": \"8006227\",\n                \"rating\": \"0.0\",\n                \"availability_status\": \"in stock\"\n            },\n            \"quantity\": 1,\n            \"total_price\": 56701\n        }\n    ]\n}\n```\n\n## Payment complete\n\n### Request\n\n```GET /api/v1/orders/order/\u003corder_id\u003e/\u003cpayment_id\u003e/\u003cpayer_id/\u003e```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"success\": \"You successfully paid for order!\"\n}\n```\n\n## Stock\n\n### Request\n\n```GET /api/v1/stock```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, POST, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n[\n    {\n        \"id\": 1,\n        \"product\": 2,\n        \"product_name\": \"Apple iPhone 13 Pro 256GB Space Black\",\n        \"product_link\": \"/api/v1/products/2/\",\n        \"product_category_name\": \"Apple iPhone 13 Pro\",\n        \"product_price\": \"54356\",\n        \"product_article\": \"786081\",\n        \"quantity_in_stock\": 1,\n        \"quantity_sold\": 15,\n        \"stock_date\": \"2023-05-20T17:42:00+03:00\",\n        \"last_sales_date\": \"2023-05-18T21:42:00+03:00\"\n    }\n]\n```\n\n### Request\n\n```POST /api/v1/stock/```\n\n```\n{\n    \"product\": Apple iPhone 13 Pro 512GB Space Black,\n    \"quantity_in_stock\": 1,\n    \"quantity_sold\": 15,\n    \"stock_date\": \"2023-05-20T17:42:00+03:00\",\n    \"last_sales_date\": \"2023-05-18T21:42:00+03:00\"\n}\n```\n\n### Reponse\n\n```\nHTTP 201 Created\nAllow: GET, POST, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"id\": 2,\n    \"product\": 5,\n    \"product_name\": \"Apple iPhone 13 Pro 512GB Space Black\",\n    \"product_link\": \"/api/v1/products/5/\",\n    \"product_category_name\": \"Apple iPhone 13 Pro\",\n    \"product_price\": \"65999\",\n    \"product_article\": \"sdf1fsa\",\n    \"quantity_in_stock\": 1,\n    \"quantity_sold\": 15,\n    \"stock_date\": \"2023-05-20T17:46:00+03:00\",\n    \"last_sales_date\": \"2023-05-18T17:46:00+03:00\"\n}\n```\n\n## Stock item detail\n\n### Request\n\n```GET /api/v1/stock/\u003citem_id\u003e/```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"id\": 1,\n    \"product\": 2,\n    \"product_name\": \"Apple iPhone 13 Pro 256GB Space Black\",\n    \"product_link\": \"/api/v1/products/2/\",\n    \"product_category_name\": \"Apple iPhone 13 Pro\",\n    \"product_price\": \"54356\",\n    \"product_article\": \"786081\",\n    \"quantity_in_stock\": 1,\n    \"quantity_sold\": 15,\n    \"stock_date\": \"2023-05-20T17:42:00+03:00\",\n    \"last_sales_date\": \"2023-05-18T21:42:00+03:00\"\n}\n```\n\n### Request\n\n```PUT /api/v1/stock/\u003citemd_id\u003e/```\n\n```\n{\n    \"id\": 1,\n    \"product\": 2,\n    \"product_name\": \"Apple iPhone 13 Pro 256GB Space Black\",\n    \"product_link\": \"/api/v1/products/2/\",\n    \"product_category_name\": \"Apple iPhone 13 Pro\",\n    \"product_price\": \"54356\",\n    \"product_article\": \"786081\",\n    \"quantity_in_stock\": 47,\n    \"quantity_sold\": 100,\n    \"stock_date\": \"2023-05-20T17:42:00+03:00\",\n    \"last_sales_date\": \"2023-05-18T21:42:00+03:00\"\n}\n```\n\n### Response\n\n```\nHTTP 200 OK\nAllow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n\n{\n    \"id\": 1,\n    \"product\": 2,\n    \"product_name\": \"Apple iPhone 13 Pro 256GB Space Black\",\n    \"product_link\": \"/api/v1/products/2/\",\n    \"product_category_name\": \"Apple iPhone 13 Pro\",\n    \"product_price\": \"54356\",\n    \"product_article\": \"786081\",\n    \"quantity_in_stock\": 47,\n    \"quantity_sold\": 100,\n    \"stock_date\": \"2023-05-20T17:48:00+03:00\",\n    \"last_sales_date\": \"2023-05-18T17:48:00+03:00\"\n}\n```\n\n### Request\n\n```DELETE /api/v1/stock/\u003citem_id\u003e/```\n\n### Response\n\n```\nHTTP 204 No Content\nAllow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS\nContent-Type: application/json\nVary: Accept\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuzmenkous%2Fdrf-ecommerce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkuzmenkous%2Fdrf-ecommerce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkuzmenkous%2Fdrf-ecommerce/lists"}