CustomerNotFoundException

Exception thrown when a customer is not found (HTTP 404).

Indicates that no customer record exists for the specified account/memo combination or customer ID. This typically occurs when:

  • Attempting to retrieve info for an unregistered customer

  • Using an incorrect customer ID

  • Account/memo combination doesn't match any customer

  • Customer was deleted (GDPR request)

Recovery actions:

  • Register the customer via PUT /customer

  • Verify the account ID and memo are correct

  • Check if customer ID is still valid

Example - Handle customer not found:

try {
val info = kycService.getCustomerInfo(
GetCustomerInfoRequest(
jwt = authToken,
id = customerId
)
)
} catch (e: CustomerNotFoundException) {
println("Customer ${e.accountId} not found, registering...")

// Register new customer
val putRequest = PutCustomerInfoRequest(
jwt = authToken,
account = e.accountId,
kycFields = StandardKYCFields(...)
)
val response = kycService.putCustomerInfo(putRequest)
println("Registered with ID: ${response.id}")
}

Example - Verify customer exists before update:

fun updateCustomer(customerId: String, newEmail: String) {
try {
// Check if customer exists
val info = kycService.getCustomerInfo(
GetCustomerInfoRequest(jwt = authToken, id = customerId)
)

// Customer exists, update email
kycService.putCustomerInfo(
PutCustomerInfoRequest(
jwt = authToken,
id = customerId,
kycFields = StandardKYCFields(
naturalPersonKYCFields = NaturalPersonKYCFields(
emailAddress = newEmail
)
)
)
)
} catch (e: CustomerNotFoundException) {
println("Customer no longer exists: ${e.accountId}")
}
}

See also:

Constructors

Link copied to clipboard
constructor(accountId: String)

Properties

Link copied to clipboard

The Stellar account ID or customer ID that was not found

Link copied to clipboard
expect open val cause: Throwable?
Link copied to clipboard
expect open val message: String?