Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Order Agreements

A read-only administrative endpoint for order agreements — the legal contracts captured at checkout and stored against an order. Turkish distance-selling law requires two documents per order: the Preliminary Information Form (info) and the Distance Sales Agreement (sales). Each is rendered to HTML at order time and stored as a file, producing one order-agreement record per contract type per order.

The endpoint exposes only list and retrieve — order agreements are created by the checkout flow, never through this API, and cannot be updated or deleted here. Retrieving an agreement fetches the stored contract document and returns its full text alongside the metadata.

Core Capabilities

1. Agreement Listing & Filtering

  • Retrieve a paginated list of all order agreements.

  • Filter by order_number or order_id to find the agreements captured for a specific order, or by contract_type to select a document type.

  • Order results with the sort parameter.

2. Agreement Retrieval

  • Retrieve a single order agreement, including the full contract text.

Order Agreement Fields

Field
Type
Description

order_id

string

The identifier of the order the agreement belongs to.

url

string (URI)

URL of the stored contract document.

type

string enum

The contract type: info (Preliminary Information Form) or sales (Distance Sales Agreement).

contract_content

string

The full text of the contract document, fetched from the document store at read time. An empty string if the document could not be retrieved.

Filtering & Ordering

Parameter
Match
Notes

order_number

Exact

Keep only agreements whose order has the given order number.

order_id

Exact

Keep only agreements for the given order identifier.

contract_type

Exact

Filter by contract type (info or sales).

Use the sort query parameter to order the results; prefix with - for descending.

Dynamic Settings & Environment Variables

No dynamic settings (dj_dynamic_settings) affect these endpoints.

Environment variables / Django settings — the contract_content field is populated by fetching the stored document over HTTP at serialization time. The document URL is built from:

Setting
Type
Effect

AWS_S3_BUCKET_URL_TEMPLATE

string

When set, used as the URL template for the stored contract document.

AWS_STORAGE_BUCKET_NAME

string

Fallback bucket name used to build the document URL when the template is not set.

If the document cannot be fetched, contract_content is returned as an empty string; the rest of the record is unaffected.

Last updated

Was this helpful?