Get Customer Info Field
Represents a field that the anchor needs from the customer in SEP-12.
Defines a piece of information the anchor has not yet received for the customer. Used in GetCustomerInfoResponse to communicate field requirements and constraints.
This object is required for customers in the NEEDS_INFO status but may be included with any status. Fields are specified as an object with keys representing SEP-9 field names. Customers in ACCEPTED status should not have any required fields.
Field attributes:
type: Data type of the field value (string, binary, number, date)
description: Human-readable description of the field
choices: Optional array of valid values (for enum-like fields)
optional: Whether the field is required (defaults to required if not specified)
Example - Required text field:
GetCustomerInfoField(
type = "string",
description = "Your legal last name",
choices = null,
optional = false
)Example - Optional enum field:
GetCustomerInfoField(
type = "string",
description = "Type of identification document",
choices = listOf("passport", "drivers_license", "national_id"),
optional = true
)Example - Required binary field:
GetCustomerInfoField(
type = "binary",
description = "Front side of your ID document (JPEG or PNG)",
choices = null,
optional = false
)Example - Using fields from response:
val response = kycService.getCustomerInfo(request)
if (response.status == CustomerStatus.NEEDS_INFO) {
response.fields?.forEach { (fieldName, fieldInfo) ->
println("Field: $fieldName")
println(" Type: ${fieldInfo.type}")
println(" Description: ${fieldInfo.description}")
println(" Required: ${fieldInfo.optional != true}")
if (fieldInfo.choices != null) {
println(" Valid choices: ${fieldInfo.choices.joinToString(", ")}")
}
}
}See also:
GetCustomerInfoProvidedField for fields already provided by customer
GetCustomerInfoResponse for full customer information