GetCustomerInfoResponse

@Serializable
data class GetCustomerInfoResponse(val id: String? = null, val status: CustomerStatus, val fields: Map<String, GetCustomerInfoField>? = null, val providedFields: Map<String, GetCustomerInfoProvidedField>? = null, val message: String? = null)

Response from a GET /customer request containing customer KYC status and field requirements.

Indicates the current state of the customer's KYC process and what information (if any) is still required. Used to guide the customer through the verification process and display appropriate UI.

Response properties:

  • id: Customer ID for future requests (present if customer was registered)

  • status: Current KYC status (ACCEPTED, PROCESSING, NEEDS_INFO, REJECTED)

  • fields: Fields the anchor needs (present when status is NEEDS_INFO)

  • providedFields: Fields already provided with their status

  • message: Human-readable message about the customer's status

Example - New customer (NEEDS_INFO):

val response = kycService.getCustomerInfo(request)
// Response:
// id: null (not yet registered)
// status: NEEDS_INFO
// fields: {
// "first_name": GetCustomerInfoField(type="string", description="Legal first name"),
// "last_name": GetCustomerInfoField(type="string", description="Legal last name"),
// "email_address": GetCustomerInfoField(type="string", description="Email address")
// }

response.fields?.forEach { (fieldName, fieldInfo) ->
println("Need: $fieldName - ${fieldInfo.description}")
}

Example - Customer under review (PROCESSING):

val response = kycService.getCustomerInfo(request)
// Response:
// id: "d1ce2f48-3ff1-495d-9240-7a50d806cfed"
// status: PROCESSING
// message: "Your information is being reviewed. This typically takes 1-2 business days."

println(response.message)

Example - Customer approved (ACCEPTED):

val response = kycService.getCustomerInfo(request)
// Response:
// id: "d1ce2f48-3ff1-495d-9240-7a50d806cfed"
// status: ACCEPTED
// message: "Your account has been approved"

if (response.status == CustomerStatus.ACCEPTED) {
proceedWithTransfer()
}

Example - Field needs verification (VERIFICATION_REQUIRED):

val response = kycService.getCustomerInfo(request)
// Response:
// status: NEEDS_INFO
// providedFields: {
// "email_address": GetCustomerInfoProvidedField(
// status=VERIFICATION_REQUIRED,
// description="Email address"
// )
// }

val emailField = response.providedFields?.get("email_address")
if (emailField?.status == FieldStatus.VERIFICATION_REQUIRED) {
println("Please enter the verification code sent to your email")
}

Example - Customer rejected (REJECTED):

val response = kycService.getCustomerInfo(request)
// Response:
// id: "d1ce2f48-3ff1-495d-9240-7a50d806cfed"
// status: REJECTED
// message: "Unable to verify identity. Please contact support."

if (response.status == CustomerStatus.REJECTED) {
showErrorDialog(response.message ?: "Application rejected")
}

See also:

Constructors

Link copied to clipboard
constructor(id: String? = null, status: CustomerStatus, fields: Map<String, GetCustomerInfoField>? = null, providedFields: Map<String, GetCustomerInfoProvidedField>? = null, message: String? = null)

Properties

Link copied to clipboard
@SerialName(value = "fields")
val fields: Map<String, GetCustomerInfoField>?

Fields the anchor needs from the customer (required for NEEDS_INFO status)

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

Customer ID if registered, null if not yet created

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

Human-readable message about the customer's status (required for REJECTED)

Link copied to clipboard
@SerialName(value = "provided_fields")
val providedFields: Map<String, GetCustomerInfoProvidedField>?

Fields already provided with verification status

Link copied to clipboard
@SerialName(value = "status")
val status: CustomerStatus

Current KYC status (ACCEPTED, PROCESSING, NEEDS_INFO, REJECTED)