Add the OpenAPI spec for the payments 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://payments-dev.sttlab.local/payments/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:
+305
@@ -0,0 +1,305 @@
|
|||||||
|
openapi: 3.0.3
|
||||||
|
info:
|
||||||
|
title: Classic Models API — Payments domain
|
||||||
|
version: 4.7.0
|
||||||
|
description: 'Customer payments and their allocation. Payments domain subset of the shared classic-models-api backend, as exposed by the payments domain''s Kong gateway. Paths and server below are the gateway''s, not the backend''s: the gateway rewrites /payments/v1/... onto /classic-models/api/v1/... upstream. Requires a bearer token from the classic-models realm.'
|
||||||
|
paths:
|
||||||
|
/payments/v1/payments/:
|
||||||
|
get:
|
||||||
|
operationId: list_payments
|
||||||
|
description: Retrieve a paginated list of all customer payment records with amounts and dates.
|
||||||
|
summary: List all payments
|
||||||
|
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:
|
||||||
|
- Payments
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
|
- JWTAuth: []
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PaginatedPaymentList'
|
||||||
|
description: ""
|
||||||
|
post:
|
||||||
|
operationId: create_payment
|
||||||
|
description: Record a new customer payment with check number, amount, and payment date.
|
||||||
|
summary: Create a new payment
|
||||||
|
tags:
|
||||||
|
- Payments
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PaymentRequest'
|
||||||
|
application/x-www-form-urlencoded:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PaymentRequest'
|
||||||
|
multipart/form-data:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PaymentRequest'
|
||||||
|
required: true
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
|
- JWTAuth: []
|
||||||
|
responses:
|
||||||
|
"201":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Payment'
|
||||||
|
description: ""
|
||||||
|
/payments/v1/payments/{customernumber}/{checknumber}/:
|
||||||
|
delete:
|
||||||
|
operationId: delete_payment
|
||||||
|
description: Remove a payment record from the system.
|
||||||
|
summary: Delete a payment
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: checknumber
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
description: The check number
|
||||||
|
required: true
|
||||||
|
- in: path
|
||||||
|
name: customernumber
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
description: The customer number
|
||||||
|
required: true
|
||||||
|
tags:
|
||||||
|
- Payments
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
|
- JWTAuth: []
|
||||||
|
responses:
|
||||||
|
"204":
|
||||||
|
description: No response body
|
||||||
|
patch:
|
||||||
|
operationId: patch_payment
|
||||||
|
description: Update specific fields of an existing payment record.
|
||||||
|
summary: Partially update a payment
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: checknumber
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
description: The check number
|
||||||
|
required: true
|
||||||
|
- in: path
|
||||||
|
name: customernumber
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
description: The customer number
|
||||||
|
required: true
|
||||||
|
tags:
|
||||||
|
- Payments
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PatchedPaymentRequest'
|
||||||
|
application/x-www-form-urlencoded:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PatchedPaymentRequest'
|
||||||
|
multipart/form-data:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PatchedPaymentRequest'
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
|
- JWTAuth: []
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Payment'
|
||||||
|
description: ""
|
||||||
|
put:
|
||||||
|
operationId: update_payment
|
||||||
|
description: Update all fields of an existing payment record.
|
||||||
|
summary: Update a payment
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: checknumber
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
description: The check number
|
||||||
|
required: true
|
||||||
|
- in: path
|
||||||
|
name: customernumber
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
description: The customer number
|
||||||
|
required: true
|
||||||
|
tags:
|
||||||
|
- Payments
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PaymentRequest'
|
||||||
|
application/x-www-form-urlencoded:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PaymentRequest'
|
||||||
|
multipart/form-data:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/PaymentRequest'
|
||||||
|
required: true
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
|
- JWTAuth: []
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Payment'
|
||||||
|
description: ""
|
||||||
|
get:
|
||||||
|
operationId: get_payment
|
||||||
|
description: Retrieve detailed information about a specific payment by customer number and check number.
|
||||||
|
summary: Get a specific payment
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: checknumber
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
description: The check number
|
||||||
|
required: true
|
||||||
|
- in: path
|
||||||
|
name: customernumber
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
description: The customer number
|
||||||
|
required: true
|
||||||
|
tags:
|
||||||
|
- Payments
|
||||||
|
security:
|
||||||
|
- ApiKeyAuth: []
|
||||||
|
- JWTAuth: []
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Payment'
|
||||||
|
description: ""
|
||||||
|
components:
|
||||||
|
schemas:
|
||||||
|
PaginatedPaymentList:
|
||||||
|
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/Payment'
|
||||||
|
PatchedPaymentRequest:
|
||||||
|
type: object
|
||||||
|
description: Customer payment records
|
||||||
|
properties:
|
||||||
|
checknumber:
|
||||||
|
type: string
|
||||||
|
minLength: 1
|
||||||
|
maxLength: 50
|
||||||
|
paymentdate:
|
||||||
|
type: string
|
||||||
|
format: date
|
||||||
|
amount:
|
||||||
|
type: string
|
||||||
|
format: decimal
|
||||||
|
pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
|
||||||
|
customernumber:
|
||||||
|
type: integer
|
||||||
|
maximum: 2147483647
|
||||||
|
minimum: -2147483648
|
||||||
|
Payment:
|
||||||
|
type: object
|
||||||
|
description: Customer payment records
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
readOnly: true
|
||||||
|
checknumber:
|
||||||
|
type: string
|
||||||
|
maxLength: 50
|
||||||
|
paymentdate:
|
||||||
|
type: string
|
||||||
|
format: date
|
||||||
|
amount:
|
||||||
|
type: string
|
||||||
|
format: decimal
|
||||||
|
pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
|
||||||
|
customernumber:
|
||||||
|
type: integer
|
||||||
|
maximum: 2147483647
|
||||||
|
minimum: -2147483648
|
||||||
|
required:
|
||||||
|
- amount
|
||||||
|
- checknumber
|
||||||
|
- customernumber
|
||||||
|
- id
|
||||||
|
- paymentdate
|
||||||
|
PaymentRequest:
|
||||||
|
type: object
|
||||||
|
description: Customer payment records
|
||||||
|
properties:
|
||||||
|
checknumber:
|
||||||
|
type: string
|
||||||
|
minLength: 1
|
||||||
|
maxLength: 50
|
||||||
|
paymentdate:
|
||||||
|
type: string
|
||||||
|
format: date
|
||||||
|
amount:
|
||||||
|
type: string
|
||||||
|
format: decimal
|
||||||
|
pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
|
||||||
|
customernumber:
|
||||||
|
type: integer
|
||||||
|
maximum: 2147483647
|
||||||
|
minimum: -2147483648
|
||||||
|
required:
|
||||||
|
- amount
|
||||||
|
- checknumber
|
||||||
|
- customernumber
|
||||||
|
- paymentdate
|
||||||
|
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://payments-dev.sttlab.local
|
||||||
|
description: Payments gateway (dev)
|
||||||
Reference in New Issue
Block a user