Instruments
The full list of request body parameters and possible outcomes can be found here.
#
Create an instrumentCreate a card or bank account payment instrument to use for future payments and payouts.
// other instruments availableCreateInstrumentTokenRequest request = CreateInstrumentTokenRequest.builder() .token("token") .accountHolder(AccountHolder.builder().build()) .customer(CreateCustomerInstrumentRequest.builder() .id() .build()) .build();
CreateInstrumentTokenResponse response = fourApi.instrumentsClient().create(request).get();
#
Get instrument detailsRetrieve the details of a payment instrument.
GetCardInstrumentResponse getResponse = (GetCardInstrumentResponse) fourApi.instrumentsClient().get(instrumentId).get();
#
Update an instrumentUpdate the details of a payment instrument.
UpdateInstrumentCardRequest updateRequest = UpdateInstrumentCardRequest.builder() .expiryMonth() .expiryYear() .name() .customer(UpdateCustomerRequest.builder().build()) .accountHolder(AccountHolder.builder().build()) .build();
UpdateInstrumentCardResponse updateResponse = fourApi.instrumentsClient().update(instrumentId, updateRequest).get();
#
Delete an instrumentDelete a payment instrument.
fourApi.instrumentsClient().delete(instrumentId).get();