GetCustomerInfoField

@Serializable
data class GetCustomerInfoField(val type: String, val description: String, val choices: List<String>? = null, val optional: Boolean? = null)

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:

Constructors

Link copied to clipboard
constructor(type: String, description: String, choices: List<String>? = null, optional: Boolean? = null)

Properties

Link copied to clipboard
@SerialName(value = "choices")
val choices: List<String>?

Optional array of valid values for this field (for enum-like selection)

Link copied to clipboard
@SerialName(value = "description")
val description: String

Human-readable description of this field

Link copied to clipboard
@SerialName(value = "optional")
val optional: Boolean?

Whether this field is optional (defaults to required if null or false)

Link copied to clipboard
@SerialName(value = "type")
val type: String

The data type of the field value (string, binary, number, date)