Welcome to FrankieOne!

On this page, we will explain how you can use a country object to have a specific customisation per country/state for different fields, which will allow you to meet different requirements for each country you want to launch for. This customisation can be added to the document and personal ekyc forms.

Country object

countries is an array of different country objects:

AttributeDescription
countries:array of country object

Each country object starts with a country_code followed by a set of state_code. A default key can be used where customisation is not required and to provide fallback behavior.

<country_code>: {
  <state_code>: {
    fields: []
	},
  <state_code>: {
    fields: []
	},
}
AttributeDescription
country_codeThree digit country code: If not applicable, use default as the key.
state_codeState code for the specific country. If not applicable, use default as the key
fields [ ]An array of field object

For each state, you can have an array of field objects. This object is a common structure across all the Personal and ID document input fields. There are some pre-defined fields available that you can use as explained for each screen, but you can also define custom fields.

Field object

AttributeDescriptionValues
fieldTypeThe type of the field to be rendered in the UI.It can be one of the following:

“input”: input text field
”select”: drop-down field
”dob”: Date of Birth field
”address”: Address field, which includes auto search and manual
”phone”: Phone number field
nameThe name of the field to be detected by OneSDK FormsAvailable pre-defined fields:

'givenName'
'middleName'
'familyName'
'dateOfBirth'
'address.fullAddress'
'address.country'
'address.unitNumber'
'address.postalCode'
'address.state'
'address.streetNumber'
'address.streetName'
'address.town'
'idNumber'
'country'
'region'
'idExpiry'
'extraData.reference'
'extraData.document_number'
dataTypeThe data type of this field to be processed by OneSDK Forms'phone'
'email'
'individual_extra'
'document_extra'
'previous_addr'
'current_addr'
‘'text'
'number'
style
labeldisplayed label for the field
helperTextthe text displayed under the field for additional info
placeholderthe text displayed inside the field as a sample input
hidedisplay or hide a fieldtrue/false

rules [NOT applicable to "dob" field].

AttributeDescriptionValues
required
required.valuetrue/false
required.value
minLength
minLength.valueinteger
minLength.message
maxLength
maxLength.valueinteger
regex.valuestring - regex type

/^([+-])(\d{2}):(\d{2})$/

Alphabetic → /^[A-Za-z]+$/
regex.message

options: array [applicable to "select" fieldType]

AttributeDescriptionValues
label
value

calendar [applicable to "dob" fieldType]

AttributeDescriptionValues
calendar.type“Gregorian” | “islamic”
local
day
day.required
day.placeholder
month
month.required
month.placeholder
year
year.required
year.placeholder

age [applicable to “dob” field]

AttributeDescriptionValues
minminimum age required for inputinteger
maxmaximum age required for inputinteger
messageError message to user when outside min and maxstring

Sample

Default countries

Default fields for all countries/states:

"countries": {
  "default": {
    "default": {
      "fields": [
          {
            "fieldType": "input",
            "name": "license_number",
            rules:{
            },
            style: {  
              ff-form-field:{} 
            }
          },
          {
            "fieldType": "input",
            "name": "card_number",
            rules:{
            },
            style: {  
              ff-form-field:{} 
            }
          }
      ],
    }
  }
}

Overwrite specific countries

Overwrite the config for specific countries/states:

"countries": {
  "AUS": {
    "VIC": {
      "fields": [
        {
          "fieldType": "input",
          "name": "license_number",
          rules:{
          },
          style: {  
            ff-form-field:{} 
          }
        },
        {
          "fieldType": "input",
          "name": "card_number",
          rules:{
          },
          style: {  
            ff-form-field:{} 
          }
        },
        {
          "fieldType": "input",
          "name": "registration_number",
          style: {  
            ff-form-field:{} 
          }
        }
      ]
    },
    "NSW": {
      "fields": [
        <data_field>
      ]
    }
  }
  "NZL": {
    "default": {
      "fields": [
        <data_field>
      ]
    }
  }
}

Use countries within documents

documents: [
      {
        type: "DRIVERS_LICENCE",
        countries: {
          default: {
            default: {
              fields: [
                {
                  fieldType: 'select',
                  name: 'country',
                  options: [
                    {
                      label: "Australia",
                      value: "AUS"
                    },
                    {
                      label: "New Zealand",
                      value: "NZL"
                    }
                  ],
                }
              ]
            }
          }
        }
      },
      {
        type: "PASSPORT",
        countries: {
          default: {
            default: {
              fields: [
                {
                  fieldType: 'select',
                  name: 'country',
                  options: [
                    {
                      label: "Australia",
                      value: "AUS"
                    },
                    {
                      label: "New Zealand",
                      value: "NZL"
                    }
                  ],
                }
              ]
            }
          }
        }
      }
]