> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/commerce-openapis/admin/orders/order-agreements/list-order-agreements.md).

# List order agreements

Returns a paginated list of order agreements — the legal contracts captured at checkout.

Each entry includes the contract type and the full contract text, which is fetched from the document store at read time. Filter by `order_number`, `order_id`, or `contract_type`. Order results with `sort`.

```json
{"openapi":"3.1.0","info":{"title":"Admin API","version":"1.0.0"},"tags":[{"name":"Order Agreements","description":"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.\n\nThe 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.\n\n## Core Capabilities\n\n**1. Agreement Listing & Filtering**\n* Retrieve a paginated list of all order agreements.\n* 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.\n* Order results with the `sort` parameter.\n\n**2. Agreement Retrieval**\n* Retrieve a single order agreement, including the full contract text.\n\n## Order Agreement Fields\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `order_id` | string | The identifier of the order the agreement belongs to. |\n| `url` | string (URI) | URL of the stored contract document. |\n| `type` | string enum | The contract type: `info` (Preliminary Information Form) or `sales` (Distance Sales Agreement). |\n| `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. |\n\n## Filtering & Ordering\n\n| Parameter | Match | Notes |\n|-----------|-------|-------|\n| `order_number` | Exact | Keep only agreements whose order has the given order number. |\n| `order_id` | Exact | Keep only agreements for the given order identifier. |\n| `contract_type` | Exact | Filter by contract type (`info` or `sales`). |\n\nUse the `sort` query parameter to order the results; prefix with `-` for descending.\n\n## Dynamic Settings & Environment Variables\n\nNo dynamic settings (`dj_dynamic_settings`) affect these endpoints.\n\n**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:\n\n| Setting | Type | Effect |\n|---------|------|--------|\n| `AWS_S3_BUCKET_URL_TEMPLATE` | string | When set, used as the URL template for the stored contract document. |\n| `AWS_STORAGE_BUCKET_NAME` | string | Fallback bucket name used to build the document URL when the template is not set. |\n\nIf the document cannot be fetched, `contract_content` is returned as an empty string; the rest of the record is unaffected."}],"servers":[{"description":"Omnitron Remote Proxy (external access — recommended)","url":"https://{omnitron_url}/api/v1/remote/{channel_id}","variables":{"omnitron_url":{"default":"sandbox.akinon.com","description":"Omnitron server URL (e.g., {omnitron.akinon.com})"},"channel_id":{"default":"1","description":"The channel identifier the remote request is routed through"}}},{"description":"Commerce API Server (internal / direct access only)","url":"https://{commerce_url}/api/v1","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Internal commerce server URL, reachable only from within the Omnitron network"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token credential sent in the Authorization header, in the form: `Token <your-token>`. Requires a staff (admin) account."}},"parameters":{"page":{"name":"page","in":"query","required":false,"description":"The page number to return.","schema":{"type":"integer","default":1}},"limit":{"name":"limit","in":"query","required":false,"description":"The number of items to return per page.","schema":{"type":"integer","default":10}},"sort":{"name":"sort","in":"query","required":false,"description":"Orders the results by one or more fields. Separate multiple fields with commas. Prefix a field with a hyphen (`-`) for descending order.","schema":{"type":"string"}}},"schemas":{"OrderContractType":{"type":"string","description":"The type of legal contract attached to an order agreement.","enum":["info","sales"]},"PaginatedOrderAgreementList":{"type":"object","description":"A paginated list of order agreements.","properties":{"count":{"type":"integer","description":"Total number of order agreements matching the request."},"next":{"type":["string","null"],"format":"uri","description":"URL of the next page, or `null` if this is the last page."},"previous":{"type":["string","null"],"format":"uri","description":"URL of the previous page, or `null` if this is the first page."},"results":{"type":"array","description":"The order agreements on the current page.","items":{"$ref":"#/components/schemas/OrderAgreement"}}}},"OrderAgreement":{"type":"object","description":"A legal agreement (contract) that was accepted during checkout.","properties":{"order_id":{"type":"string","description":"The identifier of the order this agreement belongs to."},"url":{"type":"string","format":"uri","description":"URL of the contract document in the document store."},"type":{"$ref":"#/components/schemas/OrderContractType"},"contract_content":{"type":"string","description":"The full text content of the contract document. An empty string if the document could not be retrieved."}}},"ValidationError":{"type":"object","description":"Returned when the request contains invalid or missing data. Errors are grouped by the field they apply to: each key is the name of a field from the request and its value is a list of one or more messages describing what is wrong with that field. Messages that do not belong to any single field are grouped under `non_field_errors`.","properties":{"non_field_errors":{"type":"array","description":"Error messages that apply to the request as a whole rather than to a specific field.","items":{"type":"string"}}},"additionalProperties":{"type":"array","description":"The list of error messages for the field named by the key.","items":{"type":"string"}}},"Error":{"type":"object","description":"An error response.","properties":{"detail":{"type":"string","description":"A human-readable description of the error."}},"additionalProperties":true}},"responses":{"ValidationError":{"description":"The request contains invalid or missing data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"Unauthorized":{"description":"Authentication credentials were not provided or are invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The authenticated user does not have administrator privileges.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"OrderAgreementPageNotFound":{"description":"The requested page of the order agreement list does not exist — the page number is beyond the last page or is not a number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/order_agreements/":{"get":{"tags":["Order Agreements"],"operationId":"listOrderAgreements","summary":"List order agreements","description":"Returns a paginated list of order agreements — the legal contracts captured at checkout.\n\nEach entry includes the contract type and the full contract text, which is fetched from the document store at read time. Filter by `order_number`, `order_id`, or `contract_type`. Order results with `sort`.","parameters":[{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/sort"},{"name":"order_number","in":"query","description":"Filter by the order number of the owning order. Exact match.","required":false,"schema":{"type":"string"}},{"name":"order_id","in":"query","description":"Filter by the identifier of the owning order. Exact match.","required":false,"schema":{"type":"integer"}},{"name":"contract_type","in":"query","description":"Filter by contract type.","required":false,"schema":{"$ref":"#/components/schemas/OrderContractType"}}],"responses":{"200":{"description":"A page of order agreements.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedOrderAgreementList"}}}},"400":{"$ref":"#/components/responses/ValidationError"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/OrderAgreementPageNotFound"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://apidocs.akinon.com/commerce-openapis/admin/orders/order-agreements/list-order-agreements.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
