Skip to content

Create a derivation rule or add a version to it

Request

Without id, creates a new derivation rule in the token's company with version 1 (name required). With the id of an existing derivation rule, appends the next version to it. Every accepted request creates a version, also when its definition equals an earlier one.

Takes effect immediately only where Latest is followed: configuration rule lines following Latest of this derivation rule switch to the new version. Pinned references keep their version.

name and description are not versioned: they are replaced when given and kept when omitted.

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

Id of the derivation rule to add a version to. Omit to create a new derivation rule.

Example:12
namestring, non-empty

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

descriptionstring

Not versioned; omitted = unchanged.

definitionobject(EInvoiceDerivationRuleDefinition)required
curl -i -X POST \
  https://api.cloud.hypatos.ai/v2/integration-setup/e-invoice-derivation-rules \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Is XRechnung UBL",
    "definition": {
      "derivationRuleMapping": "<xsl:stylesheet version=\"2.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"><xsl:template match=\"/\"><xsl:value-of select=\"exists(/*:Invoice)\"/></xsl:template></xsl:stylesheet>"
    }
  }'

Responses

Version created (and the derivation rule, if no id was given).

Headers
Locationstring

URL of the configuration, e.g. /v2/integration-setup/e-invoice-pdf-mappings/41.

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": 12, "name": "Is XRechnung UBL", "companyId": "6081acde0377a83b93f05a10", "version": 1, "created": true }