Document Creation Service API (1.0.6)

Download OpenAPI specification:Download

API for a service for creating document binaries from document data.

Documents

Request to create a new document

path Parameters
org-id
required
string

ID of the organization whose data is being accessed.

Request Body schema: application/json
request_id
required
string

An identifier for the request.

The identifier is issued by the client and can be used by the DCS to cache the generated document binary.

A client must guarantee to use a different identifier for requests for a different document or with a different locale, output format specification, or duplicate flag.

Note that changes in the meta data or the external data do not require a change in the request identifier.

document_type
required
string (DocumentType)
Enum: "CREDIT_MEMO" "INVOICE" "PAYMENT_RECEIPT" "PRO_FORMA_INVOICE"
document_data
required
any (DocumentData)
language
string <bcp47> [ 2 .. 5 ] characters

The language in which the document shall be generated.

The language is identified by a simple IETF BCP 47 language tag consisting of a two-letter language code from ISO 639-1 optionally followed by a '-' and a region subtag based on a two-letter country code from ISO 3166-1 alpha-2 written in upper case.

For example, de, en, or de-CH.

meta_data
required
object (MetaData)

Data that is associated with the "createDocument" request but is not relevant for the document itself.

Consider for example, the request to create a binary for an "Invoice" document. While the meta data contains the IDs of the service location and device from which the document is requested, they are not the service location/device to be printed on the document. Those are provided as part of the document data.

Note that the service location, device and staff member IDs are optional. They are omitted when the request is not triggered via user interaction on a client but by the enfore server platform on its own.

output_format
required
object (OutputFormatSpecification)

Specifies the output format that the document binary created by the DCS must to conform to.

ATTN: For now, only PDF without additional format specification is used. The format type RECEIPT and the ReceiptFormatParameters have only been defined to make the API future-proof but are not being used for the current milestone.

external_data
string <= 1024 characters

External data that was returned by the DCS as result of a previous "create document" invocation.

Note that this is reused across different output formats.

as_duplicate
required
boolean
Default: false

A flag indicating that a "duplicate" document binary is requested.

ATTN: This flag is not used at the moment.

Responses

200

OK

400

Invalid parameters were sent by the client

403

Credentials missing or not sufficient

404

Resource(s) not found or invalid identifier

429

Too many requests / rate-limited.

post /org/{org-id}/documents/v1
/org/{org-id}/documents/v1

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "request_id": "string",
  • "document_type": "CREDIT_MEMO",
  • "document_data":
    {
    },
  • "language": "strin",
  • "meta_data":
    {
    },
  • "output_format":
    {
    },
  • "external_data": "string",
  • "as_duplicate": false
}

Response samples

Content type
application/problem+json
Copy
Expand all Collapse all
{}