Skip to main content

entirius-django-returns

A Django module for order returns (RMA) in Entirius, the open-source modular ecommerce platform. Customers file a return request for a completed order, attach files and download a PDF return form; the order moves to its returned status.

PyPI Python License: MPL-2.0

What it does

  • Lists the items of a completed order that can still be returned, within a configurable return window.
  • Creates return requests with the return method, the chosen solution, a comment and attachments.
  • Generates a PDF return form and sends a confirmation email.
  • Links every return to the checkout order and to the customer account.
  • Exposes a key-protected storefront REST API per sales channel, plus admin download routes for attachments.

Installation

uv add entirius-django-returns
pip install entirius-django-returns
INSTALLED_APPS = [
    ...
    "django_utils",
    "django_regional",
    "django_accounts",
    "django_pim",
    "django_pricemanager",
    "django_email",
    "django_checkout",
    "django_returns",
]

# urls.py
urlpatterns = [
    path("", include("django_returns.urls")),
]

Required setting: PRIVATE_DIR, the root directory of attachment storage; the module refuses to import without it. The checkout module it builds on has required settings of its own, listed in https://github.com/entirius/entirius-django-checkout/blob/develop/README.md. Optional settings (API_BASE_URL, DAYS_TO_RETURN, LOGO_URL, PDF_RETURN_TEMPLATE) are listed in https://github.com/entirius/entirius-django-returns/blob/develop/AGENTS.md (section Settings).

The storefront API reads its key from the X-API-KEY header. With django_access installed the key is an access token with the scope returns.api:

python manage.py access_token create --application <name> --create-application --scope returns.api --channel <idx>

Without django_access, create the key with python manage.py returns-generate-api-key.

Quick start

from django_returns.models import OrderReturn, ReturnStatus

open_returns = OrderReturn.objects.filter(status=ReturnStatus.OPEN).select_related("order", "customer")

Requirements

  • Python 3.11 or newer, Django 5.0 or newer.
  • PostgreSQL.
  • Entirius packages pulled in: entirius-django-checkout (orders and their status flow), entirius-django-email (confirmation email), entirius-django-accounts (customer), entirius-django-utils, entirius-py-pdf-generator (return form), entirius-py-bievents, entirius-py-process-logger.

Documentation

Part of Entirius

This module runs inside the Entirius backend service (Volkanos) as a satellite of the checkout module.

Development

make install     # sync dependencies (uv)
make check       # lint + format check (ruff)
make test        # test suite (pytest + pytest-django, needs PostgreSQL via DATABASE_URL)

Development and agent instructions: https://github.com/entirius/entirius-django-returns/blob/develop/AGENTS.md

License

Mozilla Public License 2.0 (MPL-2.0) — see https://github.com/entirius/entirius-django-returns/blob/develop/LICENSE.

Metadata

Release files for entirius-django-returns 4.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for entirius-django-returns 4.0.0
File Size Uploaded
entirius_django_returns-4.0.0.tar.gz 167.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for entirius-django-returns 4.0.0
File Interpreter ABI Platform
entirius_django_returns-4.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 201.6 kB

Release files / entirius_django_returns-4.0.0.tar.gz

Download URL entirius_django_returns-4.0.0.tar.gz
Size 167.7 kB
Tags Source
SHA-256 checksum
How to use checksums
166aba1608423fa5adbe2cdf62c62a8776252e6f0c42dced02c4297c0eb50bd1
BLAKE2b-256 checksum
How to use checksums
8e465bd90617105d04d014559b239a8e473c689e7dcdbbe020b60b0027916d74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / entirius_django_returns-4.0.0-py3-none-any.whl

Download URL entirius_django_returns-4.0.0-py3-none-any.whl
Size 33.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d850133f4d9d01a83e3c9e377c18627354284f8ea749a8e12723a0f5054ef7c0
BLAKE2b-256 checksum
How to use checksums
ec9f526aaee92a52c9e0c3f3ad74fdf77166487e0542df8c5b5cbc9e3195086b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

4.0.0 This release

2 release files

3.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page