Skip to main content

Customers

The full list of request body parameters and possible outcomes can be found here.

Create a customer#

Create a customer which can be linked to one or more payment instruments, and can be passed as a source when making a payment, using the customer’s default instrument.

CustomerRequest request = CustomerRequest.builder()        .email()        .name()        .phone(Phone.builder().build())        .build();
IdResponse response = api.customersClient().create(request).get();

Get customer details#

Returns the details of a customer and their instruments.

CustomerDetailsResponse response = api.customersClient().get(request).get();

Update customer details#

Update details of a customer

CustomerRequest request = CustomerRequest.builder()        .email()        .name()        .phone(Phone.builder().build())        .build();
api.customersClient().update("cus_123456789ASDZX", request).get();

Delete a customer#

Delete a customer and all of their linked payment instruments

api.customersClient().delete("cus_123456789ASDZX").get();