Sage

Tip

Quotes are imported from Sage using the sage.service.import_quotes function.

Configuration

Set the SAGE_URL_AUTH in your .env file e.g:

SAGE_URL_AUTH="https://www.sageone.com/oauth2/auth/central?filter=apiv3.1"

Set the SAGE_CLIENT_ID in your .private file e.g:

SAGE_CLIENT_ID="2e4c160f4992..."

In your settings/base.py file:

SAGE_CLIENT_ID = get_env_variable("SAGE_CLIENT_ID")
SAGE_URL_AUTH = get_env_variable("SAGE_URL_AUTH")

Add the following to the urls.py file in your project:

re_path(r"^sage/", view=include("sage.urls")),

Management Command

To view the parameters sent to the Sage auth URL:

django-admin sage-auth

To do the actual get request:

django-admin sage-auth get=1

Issues

Authorise Application Error

_images/2025-10-15-authorise-app-error.png

When deploying the app to your live (or test) server, remember to update the Callback URLs:

_images/2025-10-15-callback-urls.png