OpenAPI - DocumentManagement System (1.0.0)

Download OpenAPI specification:

This is an example API to demonstrate features of the OpenAPI specification.

Document

Describes operations on Documents.

Get list of documents

Get list of documents

Authorizations:
basic_auth
header Parameters
Accept-Language
string
Default: en-GB
Examples: en-US

The language you prefer for messages. Supported values are en-AU, en-CA, en-GB, en-US.

Transaction-Id
required
string <UUID>

Transaction-Id header parameter.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a new document

This operation creates a new financial document

Authorizations:
basic_auth
header Parameters
Accept-Language
string
Default: en-GB
Examples: en-US

The language you prefer for messages. Supported values are en-AU, en-CA, en-GB, en-US.

Transaction-Id
required
string <UUID>

Transaction-Id header parameter.

Request Body schema: application/json
required

User request to be added to the database.

date
required
string <date>

Date of the document

documentType
string (document_type)
Enum: "Note" "Bill" "Invoice" "Transfer"

Predefined type of the document

documentName
string

Name of the document

documentDescription
string

Detailed description of the document

invoiceNumber
string or null

Invoice number of the document

accountId
required
integer <int64>

Unique identifier for the account

targetAccountId
integer or null <int64>

Unique identifier for the target account

transferAmount
number or null <double>

Amount to be transferred

counterpartyId
integer or null <int64>

Unique identifier for the counterparty

paymentMethod
required
string

Payment method for the document

currencyCode
string = 3 characters
Default: "PLN"

Currency code of the transfer amount

exchangeRate
number <double> decimal places <= 6 > 0

Exchange rate applicable to the transfer amount

Array of objects (document_item_request) non-empty

List of items in the document

Responses

Request samples

Content type
application/json
{
  • "date": "2023-10-01",
  • "documentType": "Invoice",
  • "documentName": "October Invoice",
  • "documentDescription": "October Invoice for car insurance",
  • "invoiceNumber": "INV-12345",
  • "accountId": 67890,
  • "targetAccountId": 98765,
  • "transferAmount": 1500.75,
  • "counterpartyId": 54321,
  • "paymentMethod": "Credit Card",
  • "currencyCode": "USD",
  • "exchangeRate": 1.12,
  • "documentItems": [
    ]
}

Response samples

Content type
application/json
{
  • "title": "string",
  • "status": 400,
  • "detail": "string",
  • "instance": "string"
}

Get document by ID

Get document by ID

Authorizations:
basic_auth
path Parameters
id
required
integer <int64>

ID of the document

Responses

Response samples

Content type
application/json
{
  • "documentId": 12345,
  • "documentDate": "2023-10-01",
  • "documentType": "Invoice",
  • "documentName": "October Invoice",
  • "documentComment": "Details for October Invoice",
  • "invoiceNumber": "INV-12345",
  • "account": {},
  • "targetAccount": {},
  • "documentAmount": 1500.75,
  • "counterparty": {
    },
  • "paymentMethod": "Credit Card",
  • "currencyCode": "USD",
  • "exchangeRate": 1.12,
  • "documentItemsCount": 5,
  • "documentItems": [
    ],
  • "createDateTime": "2022-08-22T11:43:06-07:00",
  • "updateDateTime": "2022-08-22T11:43:06-07:00"
}

Item

Describes operations on Items.

Get list of items

Get paginated list of items

Authorizations:
basic_auth
query Parameters
pageNumber
integer
Default: 0
Examples: pageNumber=0

The page number to retrieve (0-based index).

pageSize
integer
Default: 25
Examples: pageSize=25

The number of items to return per page.

orderBy
string
Default: "id"
Examples: orderBy=itemName

The field to order the items by.

orderDirection
string
Default: "asc"
Enum: "asc" "desc"
Examples: orderDirection=asc

The direction to order the items (asc or desc).

Responses

Response samples

Content type
application/json
{
  • "pageSize": 25,
  • "totalItems": 100,
  • "totalPages": 10,
  • "currentPage": 1,
  • "data": [
    ]
}

Create a new Item

Create a new Item

Authorizations:
basic_auth
Request Body schema: application/json
itemName
string

Name of the item

categoryId
integer <int64>

ID of the category the item belongs to

Responses

Request samples

Content type
application/json
{
  • "itemName": "An item",
  • "categoryId": 54321
}

Response samples

Content type
application/json
{
  • "title": "string",
  • "status": 400,
  • "detail": "string",
  • "instance": "string"
}

Get item by ID

Get item by ID

Authorizations:
basic_auth
path Parameters
id
required
integer <int64>

ID of the item

Responses

Response samples

Content type
application/json
{
  • "itemId": 12345,
  • "itemName": "An item",
  • "itemCategory": {
    }
}

Account

Describes operations on Accounts.

Get list of accounts

Get list of accounts

Authorizations:
basic_auth

Responses

Response samples

Content type
application/json
[]

Create a new Account

Create a new Account

Authorizations:
basic_auth
Request Body schema: application/json
accountName
required
string

Name of the account

accountDescription
string

Detailed description of the Account

accountCurrency
string

Default currency for the Account

accountImageUrl
string <url>

Detailed description of the Account

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "title": "string",
  • "status": 400,
  • "detail": "string",
  • "instance": "string"
}

Get account by ID

Get single account by ID

Authorizations:
basic_auth
path Parameters
id
required
integer <int64>

ID of the account

Responses

Response samples

Content type
application/json
{}