Skip to content

Documentation / @facturometro/einvoice / elementDocsUrl

Function: elementDocsUrl() ​

elementDocsUrl(segments, kind?): string

Defined in: packages/core/src/constants.ts:163

Builds the documentation URL of a UBL element.

Segments are the qualified element names from the document root down to the leaf, written either as cac:Party or as cac-Party; the documentation site spells them with a hyphen.

Parameters ​

segments ​

readonly string[]

Qualified element names, outermost first. Empty yields the document root.

kind? ​

"creditNote" | "invoice"

Which document tree to link to. Defaults to 'invoice'.

Returns ​

string

The documentation URL, with a trailing slash.

Example ​

ts
import { elementDocsUrl } from '@facturometro/core';

elementDocsUrl(['cac:LegalMonetaryTotal', 'cbc:PayableAmount']);
// 'https://docs.peppol.eu/poacc/billing/3.0/syntax/ubl-invoice/cac-LegalMonetaryTotal/cbc-PayableAmount/'

MIT licensed. Specification artefacts belong to OpenPEPPOL, CEN and OASIS.