Search for customers
Find a single customer
Find a single customer based on the UID returned when the Customer was created.
Customer customer = gateway.customer().find("customer_uid");
When searching for multiple customers, you can use search criteria appropriate to the specific property type.
Object properties
Searching based on object properties.
CustomerSearchRequest searchReq = new CustomerSearchRequest()
.company().is("Widgets Ltd")
.firstName().is("John")
.lastName().is("Hancock")
.email().is("john@server.com")
.mobile().is("555 444 333")
.phone().is("555 444 333")
.description().is("description");
CustomerCollection customers = gateway.customer().search(searchReq);
Billing address
You can search for customers based on their billing address properties.
CustomerSearchRequest searchReq = new CustomerSearchRequest()
.addressCompany().is("Widgets Ltd")
.addressLine1().is("street address 123")
.addressLine2().is("")
.addressCity().is("Zagreb")
.addressPostalCode().is("10000")
.addressCountryIsoCode2().is("HR");
CustomerCollection customers = gateway.customer().search(searchReq);