Metadata-Version: 2.4
Name: flexcommerce-checkout
Version: 1.0.0
Summary: Atomic, idempotent checkout tying cart, stock, discounts, shipping, orders and payments
Author-email: NzeStan <nnamaniifeanyi10@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/NzeStan/flex_commerce
Project-URL: Documentation, https://github.com/NzeStan/flex_commerce#readme
Project-URL: Repository, https://github.com/NzeStan/flex_commerce
Project-URL: Issues, https://github.com/NzeStan/flex_commerce/issues
Project-URL: Changelog, https://github.com/NzeStan/flex_commerce/blob/main/CHANGELOG.md
Keywords: django,ecommerce,flexcommerce,nigeria,africa,drf,checkout
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Framework :: Django :: 5.1
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Office/Business :: Financial :: Point-Of-Sale
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: flexcommerce-core<2,>=1.0.0
Requires-Dist: flexcommerce-cart<2,>=1.0.0
Requires-Dist: flexcommerce-orders<2,>=1.0.0
Provides-Extra: all
Requires-Dist: flexcommerce-inventory<2,>=1.0.0; extra == "all"
Requires-Dist: flexcommerce-discounts<2,>=1.0.0; extra == "all"
Requires-Dist: flexcommerce-shipping<2,>=1.0.0; extra == "all"
Requires-Dist: flexcommerce-payments<2,>=1.0.0; extra == "all"
Dynamic: license-file

# flexcommerce-checkout

One atomic, idempotent checkout: re-prices the cart, validates delivery for the address, reserves stock, redeems the coupon, creates the order and starts the payment — safe against double submits and races.

Part of **[FlexCommerce](https://github.com/NzeStan/flex_commerce/blob/main/README.md)** — a complete, modular e-commerce and marketplace backend for
Django + DRF, built for Nigeria and Africa. Every app is optional.

## Features

- Idempotency keys: retries return the original order
- `expected_total` guard against silent price changes
- Guest checkout, saved addresses, pickup stations, wallet payments
- Preview and shipping-options endpoints for checkout pages
- Works with only the cart and orders apps installed; uses shipping, inventory, discounts and payments when present

## Install

```bash
pip install flexcommerce-checkout
```

```python
INSTALLED_APPS = [..., "rest_framework", "flexcommerce_core", "flexcommerce_cart", "flexcommerce_orders", "flexcommerce_checkout"]
urlpatterns = [path("api/", include("flexcommerce_core.urls"))]
```

```bash
python manage.py migrate
```

Example: `POST /api/checkout/`

## Documentation

- [Integration guide](https://github.com/NzeStan/flex_commerce/blob/main/INTEGRATION.md)
- [Settings](https://github.com/NzeStan/flex_commerce/blob/main/docs/settings.md) · [API](https://github.com/NzeStan/flex_commerce/blob/main/docs/api.md) · [Events & notifications](https://github.com/NzeStan/flex_commerce/blob/main/docs/events.md)
- [Extending](https://github.com/NzeStan/flex_commerce/blob/main/docs/extending.md) · [Operations](https://github.com/NzeStan/flex_commerce/blob/main/docs/operations.md) · [Changelog](https://github.com/NzeStan/flex_commerce/blob/main/CHANGELOG.md)

Requires Python 3.10+, Django 4.2+, Django REST framework 3.14+. MIT licensed.
