Embed signature value (PostSign)
const url = 'https://api.test.certilia.com/xades/v1';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"token":"<token from ePotpis>","signatureFormat":"xades","signatureLevel":"lta","userCertificate":"<userCertificate from ePotpis>","tsaAccess":{"url":"https://tsa.test.certilia.com/qts","username":"<TSA username>","password":"<TSA password>"},"documents":[{"verificationCode":"00000000-0000-0000-0000-000000000001","hash":"0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF","signedHash":"<signedHash from ePotpis>","timeStamp":"<timeStamp from ePotpis>"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.test.certilia.com/xades/v1 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "token": "<token from ePotpis>", "signatureFormat": "xades", "signatureLevel": "lta", "userCertificate": "<userCertificate from ePotpis>", "tsaAccess": { "url": "https://tsa.test.certilia.com/qts", "username": "<TSA username>", "password": "<TSA password>" }, "documents": [ { "verificationCode": "00000000-0000-0000-0000-000000000001", "hash": "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF", "signedHash": "<signedHash from ePotpis>", "timeStamp": "<timeStamp from ePotpis>" } ] }'Embeds the signature value created in ePotpis in the prepared XML document and returns the signed XML document.
- One request can hold one or more signature values, each for its document, identified by the
verificationCodeof the ePotpis transaction. - Every document needs
timeStamp: the one ePotpis sent with the signed data. - Call it right after ePotpis has sent the signed data: the prepared document is kept for 20 minutes after PreSign.
Authorizations
Odjeljak „Authorizations”Request Bodyrequired
Odjeljak „Request Bodyrequired”PostSign request. Holds the signature values to embed and the time-stamp settings.
object
EPotpis transaction token, the same as in PreSign.
Signature format, xades, the same as in PreSign.
Signature level: b (B-B), t (B-T), lt (B-LT) or lta (B-LTA). t, lt and lta add a time stamp
and need tsaAccess.
The signer’s X.509 certificate in hexadecimal, unchanged as received from ePotpis with the signed data
(signingData.userCertificate).
Access data for the AKD time-stamping service (TSA).
AKD issues the access data on request; the request form is on certilia.com.
object
TSA URL:
- Test:
https://tsa.test.certilia.com/qts - Production:
https://tsa.certilia.com/qts
TSA username.
TSA password.
One entry per signature value to embed.
One signature value and the document it belongs to.
object
Verification code, the same as in PreSign.
The hash that PreSign returned for this document.
The signature value for this hash, as received from ePotpis (signedHash).
Mandatory. The signing time ePotpis sent with the signed data for this document (timeStamp),
unchanged: a UTC date and time as hex-encoded ASCII text
(323032362D31312D31335432333A34323A34305A is 2026-11-13T23:42:40Z). The API writes it into the signature
as SigningTime.
Example
{ "token": "<token from ePotpis>", "signatureFormat": "xades", "signatureLevel": "lta", "userCertificate": "<userCertificate from ePotpis>", "tsaAccess": { "url": "https://tsa.test.certilia.com/qts", "username": "<TSA username>", "password": "<TSA password>" }, "documents": [ { "verificationCode": "00000000-0000-0000-0000-000000000001", "hash": "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF", "signedHash": "<signedHash from ePotpis>", "timeStamp": "<timeStamp from ePotpis>" } ]}Responses
Odjeljak „Responses”The signed XML document(s).
PostSign response.
object
EPotpis transaction token, the same as in the request.
One entry per signed document.
One signed document.
object
Verification code, the same as in the request.
The signed XML document, Base64-encoded. The signature (enveloped) is inside the root element.
Document type, xml.
Example
{ "token": "<token from ePotpis>", "documents": [ { "verificationCode": "00000000-0000-0000-0000-000000000001", "base64Document": "PD94bWwgdmVyc2lvbj0iMS4wIj8+...", "mimeType": "xml" } ]}The request contains invalid values, or another error occurred during PostSign. POSTSIGN_BUILD_ERROR
means the signature could not be embedded, for example because the prepared document has expired or
userCertificate is not in hexadecimal.
Error response.
object
Error details.
object
Error type, the group the error belongs to.
Error code. The first character identifies the API (7 for XAdES), the rest is the error number.
Public error name. Rely on code or message in your code, not on description.
Error description.
Example
{ "error": { "type": "HG_GENERAL_ERROR", "code": "7111", "message": "POSTSIGN_BUILD_ERROR", "description": "Postsign error." }}