Smart-ID signing service allows your customers to fill in the blanks in document template and sign the document right after that.

Here are some examples: Demo ContractNDA

To get started go HERE and create your first contract template. Then just copy-paste piece of code (iFrame) to your webpage and that’s it. In case user needs to be redirected to some other page after signing add url parameter signature_redirect with desired page like that ?signature_redirect=

Enhanced contract templates

It is also possible to personalize the contract before showing it to the customer and asking him to sign it. It is useful if you want to prefill the contract with products or services that customer wants to buy. Pre filling fields can be done over API query

This call must have client_id and secret values that you got when you registered your website with Smart ID. In addition there is GET parameter tag_values that is url encoded JSONobject that contains values of the tags defined in the original contract. Field values are remembered up to 24h, after this time passes the API call must be done again to get new code.

Example call is

Similarly it is possible to have editable default values. Instead of tag_values use tag_defaults urlencoded json

Returned value is also JSON object with status either “OK” or “error”. If status is “OK” then there is another field “code” which value is needed in next step where you redirect the customer to sign the contract page. If the status is “error” then it includes “message” which contains details of what exactly went wrong.

Final step is to customize the signing page iframe url parameters and add the code value from the first step. Example sign page url with some blanks prefilled by the API call is

Custom document signing

In some cases the document template still does not give you enough flexibility. In this case it is possible to prepare the file that will be signed yourself. This process contains 2 steps like enhanced contract templates.

Firstly document will be sent via HTTP POST with 3 mandatory URL parameters: client_id, secret and filename and one optional parameter signature_redirect. client_id and secret are taken from smartid admin and filename can be whatever you like it to be in the signed doc. signature_redirect will be location where user is redirected 5s after sining if value present. Call is sent to query to Document content will be POST call body in base64 encoded format.

Response to above call is JSON. If successful then the status will be OK and doc_id value is string like {“status”:”OK”,”doc_id”:”rawaQxqrlYrsaGvslt7JFFCcMYztXHHwedFMPbze”} . If there is error then status is error with message like {“status”:”error”,”message”:”Missing filename for the document”} .

Second step is redirecting the customer to the signing page. Page can also be embedded in the iFrame for smoother experience. URL for the signing page needs to have 2 GET parameters: client_id and doc_id. Example of the signing page URL is this

Optionally it is possible to download the signed document over API as well.

Use the previously received doc_id with client_id and secret to get the document after signing. API HTTP GET endpoint is

If the call is successful then signed_file_contents has base64 encoded format of bdoc container. Example response will be {“status”:”OK”,”signed_file_contents”:”UEsDBAo…..Ah8AAAAA”,”signer_id”:”38112086027″,”filename”:”my_doc_to_be_signed.pdf_MARGUS_PALA_20170904121905.bdoc”}