Skip to content

Create a configuration rule or save a new version of it

Request

Without id, creates a new configuration rule in the token's company (name required). With the id of an existing rule, replaces its live definition. The full definition must be sent: omitted lines and projects are removed.

  • 201: a new history version was recorded.
  • 200: the definition equals the current one, so nothing changed and no version was created; the response carries the current version.

Takes effect immediately for every project in projectIds.

Referenced PDF mappings, derivation rules and document mappings must belong to the rule's company or the template company. A project already assigned to another configuration rule is rejected with 409.

Security
OAuth2(Required scopes: integration-setup.write)
Bodyapplication/jsonrequired
idinteger

Id of the configuration rule to save. Omit to create a new one.

Example:7
namestring, non-empty

Required without id. Not an identifier: with id, renames when given.

definitionobject(EInvoiceConfigurationRuleDefinition)required

The full definition is sent on every POST: omitted flags are false, omitted pdfMapping means none. In responses the flags are returned as stored (null for rules saved before a flag existed).

curl -i -X POST \
  https://api.cloud.hypatos.ai/v2/integration-setup/e-invoice-configuration-rules \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "ACME e-Invoices",
    "definition": {
      "executeForPdf": true,
      "mergeEmbeddedPdf": false,
      "extractFromRegularPdf": false,
      "mergePdfA3Attachments": false,
      "pdfMapping": {
        "id": 41,
        "latest": true
      },
      "lines": [
        {
          "priority": 1,
          "validationEngine": "xrehnung",
          "derivationRule": {
            "id": 12,
            "version": 5
          },
          "documentMapping": {
            "id": 30,
            "latest": true
          }
        },
        {
          "priority": 2,
          "validationEngine": "zugferd",
          "derivationRule": {
            "id": 13,
            "latest": true
          },
          "documentMapping": {
            "id": 31,
            "latest": true
          }
        }
      ],
      "projectIds": [
        "64b7f0c2a1e4d5f6a7b8c9d0"
      ]
    }
  }'

Responses

Unchanged; no version was created.

Bodyapplication/json
idintegerrequired

Configuration id.

Example:41
namestringrequired
Example:"XRechnung PDF"
companyIdstringrequired
Example:"6081acde0377a83b93f05a10"
versioninteger or nullrequired

The version created by this request (or, for an unchanged configuration rule, its current version; null when it has no history yet).

Example:3
createdbooleanrequired

True when this request created the configuration itself (no id was given).

Example:false
Response
{ "id": 7, "name": "ACME e-Invoices", "companyId": "6081acde0377a83b93f05a10", "version": 2, "created": false }