PutCustomerInfoRequest

data class PutCustomerInfoRequest(val jwt: String, val id: String? = null, val account: String? = null, val memo: String? = null, val memoType: String? = null, val type: String? = null, val transactionId: String? = null, val kycFields: StandardKYCFields? = null, val customFields: Map<String, String>? = null, val customFiles: Map<String, ByteArray>? = null, val verificationFields: Map<String, String>? = null, val fileReferences: Map<String, String>? = null)

Request for uploading or updating customer KYC information in SEP-12.

Submits customer data to the anchor in an authenticated and idempotent manner. Used for both initial registration and updating existing customer information. Supports text fields, binary file uploads, verification codes, and file references.

Request categories:

  1. Standard KYC fields via kycFields (SEP-09 standard fields)

  2. Custom fields via customFields and customFiles

  3. Verification codes via verificationFields (e.g., email/phone verification)

  4. File references via fileReferences (for separately uploaded files)

The request is idempotent: multiple calls with the same data won't create duplicate customers. Use the customer id from the response for subsequent updates.

Example - Basic registration:

val request = PutCustomerInfoRequest(
jwt = authToken,
kycFields = StandardKYCFields(
naturalPersonKYCFields = NaturalPersonKYCFields(
firstName = "John",
lastName = "Doe",
emailAddress = "john@example.com",
birthDate = LocalDate(1990, 1, 15)
)
)
)

val response = kycService.putCustomerInfo(request)
println("Customer ID: ${response.id}")

Example - With document uploads:

val request = PutCustomerInfoRequest(
jwt = authToken,
id = customerId, // Update existing customer
kycFields = StandardKYCFields(
naturalPersonKYCFields = NaturalPersonKYCFields(
photoIdFront = loadImageBytes("passport_front.jpg"),
photoIdBack = loadImageBytes("passport_back.jpg")
)
)
)

val response = kycService.putCustomerInfo(request)

Example - Email verification:

// User receives code "123456" via email
val request = PutCustomerInfoRequest(
jwt = authToken,
id = customerId,
verificationFields = mapOf(
"email_address_verification" to "123456",
"mobile_number_verification" to "654321"
)
)

val response = kycService.putCustomerInfo(request)

Example - File references (two-step upload):

// Step 1: Upload file separately
val fileResponse = kycService.postCustomerFile(photoBytes, authToken)

// Step 2: Reference file in customer update
val request = PutCustomerInfoRequest(
jwt = authToken,
id = customerId,
fileReferences = mapOf(
"photo_id_front_file_id" to fileResponse.fileId
)
)

val response = kycService.putCustomerInfo(request)

Example - Organization KYC:

val request = PutCustomerInfoRequest(
jwt = authToken,
type = "sep31-receiver",
kycFields = StandardKYCFields(
organizationKYCFields = OrganizationKYCFields(
name = "Acme Corp",
registrationNumber = "123456789",
directorName = "Jane Smith"
)
)
)

Example - Custom fields:

val request = PutCustomerInfoRequest(
jwt = authToken,
customFields = mapOf(
"custom_field_1" to "value1",
"custom_field_2" to "value2"
),
customFiles = mapOf(
"custom_document" to documentBytes
)
)

Field submission order:

  • Text fields are submitted first

  • Binary files must be sent at the end (SEP-12 requirement)

  • The SDK handles proper multipart/form-data ordering automatically

See also:

Constructors

Link copied to clipboard
constructor(jwt: String, id: String? = null, account: String? = null, memo: String? = null, memoType: String? = null, type: String? = null, transactionId: String? = null, kycFields: StandardKYCFields? = null, customFields: Map<String, String>? = null, customFiles: Map<String, ByteArray>? = null, verificationFields: Map<String, String>? = null, fileReferences: Map<String, String>? = null)

Properties

Link copied to clipboard

Stellar account ID - deprecated, use JWT sub value instead (optional)

Link copied to clipboard

Custom text fields not defined in SEP-09 (optional)

Link copied to clipboard

Custom binary fields not defined in SEP-09 (optional)

Link copied to clipboard

File IDs from POST /customer/files with _file_id suffix (optional)

Link copied to clipboard
val id: String?

Customer ID from previous PUT request (optional)

Link copied to clipboard
val jwt: String

JWT token from SEP-10 or SEP-45 authentication

Link copied to clipboard

SEP-09 standard KYC fields (optional)

Link copied to clipboard
val memo: String?

Memo for shared accounts (optional)

Link copied to clipboard

Type of memo - deprecated, should always be 'id' (optional)

Link copied to clipboard

Associated transaction ID (optional)

Link copied to clipboard
val type: String?

KYC type (e.g., 'sep6-deposit', 'sep31-sender') (optional)

Link copied to clipboard

Verification codes with _verification suffix (optional)