Customers
The full list of request body parameters and possible outcomes can be found here.
#
Create a customerCreate 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 customerRequest = CustomerRequest.builder() .email() .name() .phone(Phone.builder().build()) .build();IdResponse response = fourApi.customersClient().create(customerRequest).get();
#
Get customer detailsReturns the details of a customer and their instruments.
CustomerResponse response = fourApi.customersClient().get(customerId).get();
#
Update customer detailsUpdate details of a customer.
CustomerRequest customerRequest = CustomerRequest.builder() .email() .name() .phone(Phone.builder() .countryCode() .number() .build()) .build();
fourApi.customersClient().update(customerId, request).get();
#
Delete a customerDelete a customer and all of their linked payment instruments.
fourApi.customersClient().delete(customerId).get();