Skip to content

UJP

UJP

Slovenian UJP e-invoice package operations. The package endpoint generates native e-SLOG XML, a required UJP envelope, a tar.gz attachment package, and PDF visualization files for provider or UJP B2B exchange workflows.

Download UJP package

GET/documents/{id}/ujp

Download a deterministic ZIP package for Slovenian UJP provider or B2B e-invoice exchange. The document type is detected from the ID prefix. This does not send the document and does not require UJP credentials or certificates. The package requires current valid e-SLOG XML, a UJP .env envelope, a .tar.gz attachment package hashed by the envelope, and a PDF visualization.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstringrequired

Document ID. The document type is detected from the ID prefix.

import SpaceInvoices from '@spaceinvoices/js-sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const blob = await sdk.ujp.download("inv_clx1234567890");

const arrayBuffer = await blob.arrayBuffer();
const { writeFile } = await import('node:fs/promises');
await writeFile('download.zip', Buffer.from(arrayBuffer));
console.log('Saved download.zip');