Skip to main content

tokenize Method

Overview

The tokenize method stores a payment method securely.

Request Fields

FieldTypeRequiredDescription
paymentMethodPaymentMethodYesCard details
customerIdStringNoCustomer ID

Response Fields

FieldTypeDescription
paymentMethodIdStringToken ID
statusStringACTIVE

Example

Map<String, Object> card = new HashMap<>();
card.put("cardNumber", Map.of("value", "4242424242424242"));
card.put("cardExpMonth", Map.of("value", "12"));
card.put("cardExpYear", Map.of("value", "2027"));

Map<String, Object> request = new HashMap<>();
request.put("paymentMethod", Map.of("card", card));

Map<String, Object> response = paymentMethodClient.tokenize(request);