Preskoči na sadržaj

Embed signature value (PostSign)

PATCH
/pades/v2
curl --request PATCH \
--url https://api.test.certilia.com/pades/v2 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "token": "<token from ePotpis>", "signatureFormat": "pades", "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>" } ] }'

Embeds the signature value created in ePotpis into the prepared (presign) document and returns the signed PDF.

  • Uses the eIDAS PAdES standard, levels B-B, B-T, B-LT and B-LTA (signatureLevel).
  • For levels B-T, B-LT and B-LTA the API adds a time stamp from the AKD time-stamping service (TSA); send its access data in tsaAccess.
  • One request can hold one or more signature values, each for its prepared document.
  • The API finds the stored prepared file and embeds the signature value. The prepared file is deleted after this call, whatever the result.
Media typeapplication/json

PostSign request. Holds the signature values to embed and the time-stamp settings.

object
token
required

EPotpis transaction token, the same as in PreSign.

string
>= 1 characters
signatureFormat
required

Signature format. Always pades.

string
Allowed values: pades
signatureLevel
required

EIDAS PAdES baseline signature level:

  • b: B-B, without a time stamp.
  • t: B-T, with a signature time stamp.
  • lt: B-LT, B-T plus the data for long-term validation.
  • lta: B-LTA, B-LT plus an archive time stamp.

Levels t, lt and lta need tsaAccess.

string
Allowed values: b t lt lta
userCertificate
required

The signer’s X.509 certificate in hexadecimal, unchanged as received from ePotpis with the signed data (signingData.userCertificate).

string
>= 1 characters
tsaAccess

Access data for the AKD time-stamping service (TSA). Required for signature levels t, lt and lta.

The API uses only the AKD TSA. AKD issues the access data on request; the request form is on certilia.com.

object
url
required

TSA URL:

  • Test: https://tsa.test.certilia.com/qts
  • Production: https://tsa.certilia.com/qts
string
nullable
username
required

TSA username.

string
nullable
password
required

TSA password.

string
nullable
documents
required

One entry per signature value to embed.

Array<object>

One signature value and the document it belongs to.

object
verificationCode
required

Verification code, the same as in PreSign.

string
>= 1 characters
hash
required

The hash that PreSign returned for this document.

string
>= 1 characters
signedHash
required

The signature value for this hash, as received from ePotpis (signedHash).

string
>= 1 characters

Example

{
"token": "<token from ePotpis>",
"signatureFormat": "pades",
"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>"
}
]
}

The signed document(s).

Media typeapplication/json

PostSign response.

object
token
required

EPotpis transaction token, the same as in the request.

string
>= 1 characters
documents
required

One entry per signed document.

Array<object>

One signed document.

object
verificationCode
required

Verification code, the same as in the request.

string
>= 1 characters
documentName

Document name, as sent in PreSign.

string
nullable
base64Document
required

The signed PDF, Base64-encoded.

string
>= 1 characters
mimeType
required

Document type. pdf for PAdES.

string
>= 1 characters

Example

{
"token": "<token from ePotpis>",
"documents": [
{
"verificationCode": "00000000-0000-0000-0000-000000000001",
"documentName": "Contract 2026-001.pdf",
"base64Document": "JVBERi0xLjcK...",
"mimeType": "pdf"
}
]
}

The request contains invalid values, or another error occurred during PostSign. All error codes are listed by GET /pades/errors.

Media typeapplication/json

Error response.

object
error

Error details.

object
traceId

Trace identifier, if the response has one. Send it to support when you report a problem.

string
nullable
type

Error type, the group the error belongs to.

string
nullable
code

Error code. The first digit is the API code (6 for this API); the remaining digits are the error number. Example: 65 is error 5 of API 6.

string
nullable
status

HTTP status code.

integer format: int32
message

Public error name.

string
nullable
description

Error description, in Croatian. If a required field is missing from the request, type and code are empty, message is ERROR, and this field lists the missing fields in English (for example The Token field is required.).

string
nullable
info

Additional information about the error.

string
nullable
language

Language of description.

string
nullable
name

Public error name, the same as message (kept for compatibility).

string
nullable

Example

{
"error": {
"type": "HL_INVALID_AUTHORIZATION_CREDENTIALS",
"code": "664",
"message": "INVALID_TSA_CREDENTIALS",
"description": "Neispravni autorizacijski podaci."
}
}