Get a template

use template id from a list.

GET <base_url/<template_id>

returns a common response with a template parameters like:

{
    providerId: "Universa Superbank",
    contractId: "simple_loan",
    version: "1.0.0",
    inputFields: [
{
                id: "lender",
                name: "lender",
                type: "universa_address",
                description: "address of the person who lends the asset"
            },
            {
                id: "borrower",
                name: "borrower",
                type: "universa_address",
                description: "address of the person who borrows the asset"
            },
            {
                id: "asset",
                name: "asset",
                type: "universa_contract",
                description: "asset to be lent, must be owned by owner. Any universa contract that will change ownership"
            },
            {
                id: "pledge",
                name: "a collateral contract that will b eused as a pledge. It will be blocked until borrower return the loan or will be passed to lender in the case of default",
                description: "interest is calculated depending on the day of return",
                type: "universa_contract",
            },
            {
                id: "interest_currency",
                name: "the token name of the loan payment",
                description: "the token that will be used as payment, its title",
                type: "single_selection", list: [ { id: 'UTN', name: "UTN"}, {id: 'uETH', name: 'uETH'}]
            },
            {
                id: "interest_amount",
                name: "loan payment amount",
                description: "the amount of loan payment",
                type: "decimal"
            },
            {
                id: "description",
                name: "description",
                description: "any text that could be added to the contract",
                optional: true,
                type: "text"
            },
            {
                id: "borrower_person_id",
                name: "debtor personal identification data",
                type: "text",
                description: "full name, birth date and place, document type and number, etc.",
                optional: true
            },
            {
                id: "borrower_document_scan",
                name: "debtor personal identification document scan",
                type: "image_attachment",
                description: "scanned personal ID document",
                optional: true
            }    
        ]
};

The list of parameters should be shown in a UI form to the user fo he or she could fill it in.

The filled parameters are passed to the template generation

Field types

Field types are described as to use in JSON body. If used with BOSS, the format could differ. All text is encoded as UTF-8.

type description
decmal decimal value, with the dot as a decimal point, positive or negative. like 0.000000211
universa_address string value containing either short ot long universa address
univera_conract some universa contract, as base64 string
text some text, any length, modifiers could be applied: multiline, limit=, lines=
single_selection list of values passed in list parameter with single selection. Gerat fit for a select control (dorpdown)