Add the OpenAPI spec for the sales domain

The developer portal listed this API with no reference documentation:
catalog was the only domain that had a spec anywhere in the tree.

Generated from the backend's own drf-spectacular schema
(/classic-models/api/schema/, version 4.7.0), filtered to the operations
this domain's gateway actually exposes — derived from the Kong routes and
their request-transformer rewrites in Konnect, not from guesswork. Every
route resolved to a backend operation; the counts match one for one.

Paths and server are the **gateway's**, not the backend's. A portal
reader calls https://sales-dev.sttlab.local/sales/v1/..., and the
gateway rewrites that onto /classic-models/api/v1/... upstream. Path
parameters are renamed to the gateway's capture names where the backend
used a different case.

Components are pruned to what these paths transitively reference.

Note: catalog-api/openapi.yaml does NOT follow this convention — it
documents the backend paths and http://localhost:8000 as its server, so
its operations cannot be called as written from the portal. Left alone
here; worth aligning separately.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Stéphane Tailland
2026-08-26 18:28:25 +02:00
parent 18a3a6488a
commit b0fa4a1aa2
+651
View File
@@ -0,0 +1,651 @@
openapi: 3.0.3
info:
title: Classic Models API — Sales domain
version: 4.7.0
description: 'Sales orders and order lines, from quote to shipment. Sales domain subset of the shared classic-models-api backend, as exposed by the sales domain''s Kong gateway. Paths and server below are the gateway''s, not the backend''s: the gateway rewrites /sales/v1/... onto /classic-models/api/v1/... upstream. Requires a bearer token from the classic-models realm.'
paths:
/sales/v1/orderdetails/:
post:
operationId: create_order_detail
description: Add a new line item to an existing order with product code, quantity, and price.
summary: Create a new order detail
tags:
- Order Details
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OrderdetailRequest'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/OrderdetailRequest'
multipart/form-data:
schema:
$ref: '#/components/schemas/OrderdetailRequest'
required: true
security:
- ApiKeyAuth: []
- JWTAuth: []
responses:
"201":
content:
application/json:
schema:
$ref: '#/components/schemas/Orderdetail'
description: ""
get:
operationId: list_order_details
description: Retrieve a paginated list of all order line items with product and quantity information.
summary: List all order details
parameters:
- name: page
required: false
in: query
description: A page number within the paginated result set.
schema:
type: integer
- name: page_size
required: false
in: query
description: Number of results to return per page.
schema:
type: integer
tags:
- Order Details
security:
- ApiKeyAuth: []
- JWTAuth: []
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedOrderdetailList'
description: ""
/sales/v1/orderdetails/{ordernumber}/{productcode}/:
get:
operationId: get_order_detail
description: Retrieve a specific line item from an order using the composite key (orderNumber, productCode).
summary: Get a specific order detail
parameters:
- in: path
name: ordernumber
schema:
type: integer
description: The order number
required: true
- in: path
name: productcode
schema:
type: string
description: The product code
required: true
tags:
- Order Details
security:
- ApiKeyAuth: []
- JWTAuth: []
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Orderdetail'
description: ""
delete:
operationId: delete_order_detail
description: Remove a line item from an order.
summary: Delete an order detail
parameters:
- in: path
name: ordernumber
schema:
type: integer
description: The order number
required: true
- in: path
name: productcode
schema:
type: string
description: The product code
required: true
tags:
- Order Details
security:
- ApiKeyAuth: []
- JWTAuth: []
responses:
"204":
description: No response body
put:
operationId: update_order_detail
description: Update all fields of an existing order line item.
summary: Update an order detail
parameters:
- in: path
name: ordernumber
schema:
type: integer
description: The order number
required: true
- in: path
name: productcode
schema:
type: string
description: The product code
required: true
tags:
- Order Details
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OrderdetailRequest'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/OrderdetailRequest'
multipart/form-data:
schema:
$ref: '#/components/schemas/OrderdetailRequest'
required: true
security:
- ApiKeyAuth: []
- JWTAuth: []
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Orderdetail'
description: ""
patch:
operationId: patch_order_detail
description: Update specific fields of an existing order line item.
summary: Partially update an order detail
parameters:
- in: path
name: ordernumber
schema:
type: integer
description: The order number
required: true
- in: path
name: productcode
schema:
type: string
description: The product code
required: true
tags:
- Order Details
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PatchedOrderdetailRequest'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/PatchedOrderdetailRequest'
multipart/form-data:
schema:
$ref: '#/components/schemas/PatchedOrderdetailRequest'
security:
- ApiKeyAuth: []
- JWTAuth: []
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Orderdetail'
description: ""
/sales/v1/orders/:
get:
operationId: list_orders
description: Retrieve a paginated list of all customer orders with their status and details.
summary: List all orders
parameters:
- name: page
required: false
in: query
description: A page number within the paginated result set.
schema:
type: integer
- name: page_size
required: false
in: query
description: Number of results to return per page.
schema:
type: integer
tags:
- Orders
security:
- ApiKeyAuth: []
- JWTAuth: []
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedOrderList'
description: ""
post:
operationId: create_order
description: Create a new customer order with order date, required date, and status information.
summary: Create a new order
tags:
- Orders
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OrderRequest'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/OrderRequest'
multipart/form-data:
schema:
$ref: '#/components/schemas/OrderRequest'
required: true
security:
- ApiKeyAuth: []
- JWTAuth: []
responses:
"201":
content:
application/json:
schema:
$ref: '#/components/schemas/Order'
description: ""
/sales/v1/orders/{ordernumber}/:
delete:
operationId: delete_order
description: Remove an order from the system.
summary: Delete an order
parameters:
- in: path
name: ordernumber
schema:
type: integer
maximum: 2147483647
minimum: -2147483648
description: A unique value identifying this order.
required: true
tags:
- Orders
security:
- ApiKeyAuth: []
- JWTAuth: []
responses:
"204":
description: No response body
put:
operationId: update_order
description: Update all fields of an existing order record.
summary: Update an order
parameters:
- in: path
name: ordernumber
schema:
type: integer
maximum: 2147483647
minimum: -2147483648
description: A unique value identifying this order.
required: true
tags:
- Orders
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OrderRequest'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/OrderRequest'
multipart/form-data:
schema:
$ref: '#/components/schemas/OrderRequest'
required: true
security:
- ApiKeyAuth: []
- JWTAuth: []
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Order'
description: ""
patch:
operationId: patch_order
description: Update specific fields of an existing order record.
summary: Partially update an order
parameters:
- in: path
name: ordernumber
schema:
type: integer
maximum: 2147483647
minimum: -2147483648
description: A unique value identifying this order.
required: true
tags:
- Orders
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PatchedOrderRequest'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/PatchedOrderRequest'
multipart/form-data:
schema:
$ref: '#/components/schemas/PatchedOrderRequest'
security:
- ApiKeyAuth: []
- JWTAuth: []
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Order'
description: ""
get:
operationId: get_order
description: Retrieve detailed information about a specific order by its order number.
summary: Get a specific order
parameters:
- in: path
name: ordernumber
schema:
type: integer
maximum: 2147483647
minimum: -2147483648
description: A unique value identifying this order.
required: true
tags:
- Orders
security:
- ApiKeyAuth: []
- JWTAuth: []
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Order'
description: ""
/sales/v1/orders/{ordernumber}/order-details/:
get:
operationId: get_order_order_details
description: Retrieve all line items for a specific order. This endpoint supports order fulfillment and invoice generation.
summary: Get order details by order
parameters:
- in: path
name: ordernumber
schema:
type: integer
description: The order number
required: true
- name: page
required: false
in: query
description: A page number within the paginated result set.
schema:
type: integer
- name: page_size
required: false
in: query
description: Number of results to return per page.
schema:
type: integer
tags:
- Orders
security:
- ApiKeyAuth: []
- JWTAuth: []
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedOrderdetailList'
description: ""
components:
schemas:
Order:
type: object
description: Customer order information
properties:
ordernumber:
type: integer
maximum: 2147483647
minimum: -2147483648
orderdate:
type: string
format: date
requireddate:
type: string
format: date
shippeddate:
type: string
format: date
nullable: true
status:
type: string
maxLength: 15
comments:
type: string
nullable: true
customernumber:
type: integer
maximum: 2147483647
minimum: -2147483648
required:
- customernumber
- orderdate
- ordernumber
- requireddate
- status
OrderRequest:
type: object
description: Customer order information
properties:
ordernumber:
type: integer
maximum: 2147483647
minimum: -2147483648
orderdate:
type: string
format: date
requireddate:
type: string
format: date
shippeddate:
type: string
format: date
nullable: true
status:
type: string
minLength: 1
maxLength: 15
comments:
type: string
nullable: true
customernumber:
type: integer
maximum: 2147483647
minimum: -2147483648
required:
- customernumber
- orderdate
- ordernumber
- requireddate
- status
Orderdetail:
type: object
description: Order line items with product details
properties:
id:
type: integer
readOnly: true
quantityordered:
type: integer
maximum: 2147483647
minimum: -2147483648
priceeach:
type: string
format: decimal
pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
orderlinenumber:
type: integer
maximum: 32767
minimum: -32768
ordernumber:
type: integer
maximum: 2147483647
minimum: -2147483648
productcode:
type: string
required:
- id
- orderlinenumber
- ordernumber
- priceeach
- productcode
- quantityordered
OrderdetailRequest:
type: object
description: Order line items with product details
properties:
quantityordered:
type: integer
maximum: 2147483647
minimum: -2147483648
priceeach:
type: string
format: decimal
pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
orderlinenumber:
type: integer
maximum: 32767
minimum: -32768
ordernumber:
type: integer
maximum: 2147483647
minimum: -2147483648
productcode:
type: string
minLength: 1
required:
- orderlinenumber
- ordernumber
- priceeach
- productcode
- quantityordered
PaginatedOrderList:
type: object
properties:
count:
type: integer
example: 123
next:
type: string
nullable: true
format: uri
example: http://api.example.org/accounts/?page=4
previous:
type: string
nullable: true
format: uri
example: http://api.example.org/accounts/?page=2
results:
type: array
items:
$ref: '#/components/schemas/Order'
PaginatedOrderdetailList:
type: object
properties:
count:
type: integer
example: 123
next:
type: string
nullable: true
format: uri
example: http://api.example.org/accounts/?page=4
previous:
type: string
nullable: true
format: uri
example: http://api.example.org/accounts/?page=2
results:
type: array
items:
$ref: '#/components/schemas/Orderdetail'
PatchedOrderRequest:
type: object
description: Customer order information
properties:
ordernumber:
type: integer
maximum: 2147483647
minimum: -2147483648
orderdate:
type: string
format: date
requireddate:
type: string
format: date
shippeddate:
type: string
format: date
nullable: true
status:
type: string
minLength: 1
maxLength: 15
comments:
type: string
nullable: true
customernumber:
type: integer
maximum: 2147483647
minimum: -2147483648
PatchedOrderdetailRequest:
type: object
description: Order line items with product details
properties:
quantityordered:
type: integer
maximum: 2147483647
minimum: -2147483648
priceeach:
type: string
format: decimal
pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
orderlinenumber:
type: integer
maximum: 32767
minimum: -32768
ordernumber:
type: integer
maximum: 2147483647
minimum: -2147483648
productcode:
type: string
minLength: 1
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: X-API-Key
description: API key authentication using X-API-Key header
JWTAuth:
type: http
scheme: bearer
bearerFormat: JWT
servers:
- url: https://sales-dev.sttlab.local
description: Sales gateway (dev)