Tokenizing a Card

POST /v1/payments/card/tokenize

This endpoint is used to tokenize (securely save) a customer's card details for future transactions.
Tokenization allows you to charge the card later without needing to handle sensitive card data again. The
result of a successful tokenization is a token (or identifier) that represents the card in the Exirom platform.

Request Body Parameters:

When tokenizing a card, provide the following fields in the JSON request body:

FieldTypeRequiredDescription
requestIdStringYesUnique identifier for this tokenization request.
socialSecurityNumberStringNoCustomer’s SSN for enhanced KYC (nullable).
cardObject (Card)YesCard details to vault. See Card-Sale API’s Card Object (number, expMonth, expYear, cvv).
billingDetailsObject (BillingDetails)YesCustomer billing/KYC info. Mirrors Card-Sale API’s BillingDetails fields.
metadataMap<String,String>NoOptional free-form key/value map for your internal reference.
expirationDateString (YYYY-MM-DD)NoISO-8601 date. Optional token expiry. If omitted, token will expire 5 years from creation.

For example

{
  "requestId":             "req-token-123",
  "socialSecurityNumber":  null,
  "card": {
    "number":   "4111111111111111",
    "expMonth": "12",
    "expYear":  "2025",
    "cvv":      "123"
  },
  "billingDetails": {
    "externalUserId": "cust-789",
    "firstName":      "Jane",
    "lastName":       "Doe",
    "address1":       "123 Main St",
    "city":           "Dublin",
    "state":          "Leinster",
    "country":        "IE",
    "postalCode":     "D01X0F5",
    "phone":          "+353851234567",
    "email":          "[email protected]",
    "dateOfBirth":    "1990-05-20"
  },
  "metadata": {
    "customerId":    "cust-789"
  },
  "expirationDate":       "2028-07-14"
}

Request Body Fields Description

FieldTypeDescription
requestIdStringUnique identifier for the request (e.g., token reference).
socialSecurityNumberStringCustomer’s Social Security Number. Maybenull if not provided.
card.numberStringFull card number of the customer.
card.expMonthStringExpiration month of the card (MM format).
card.expYearStringExpiration year of the card (YYYY format).
card.cvvStringCard security code (CVV/CVC).
billingDetails.externalUserIdStringExternal identifier for the user in the merchant’s system.
billingDetails.firstNameStringCustomer’s first name.
billingDetails.lastNameStringCustomer’s last name.
billingDetails.address1StringStreet address of the customer.
billingDetails.cityStringCity of the billing address.
billingDetails.stateStringState or province of the billing address.
billingDetails.countryStringCountry code (ISO 3166-1 alpha-2) for the billing address.
billingDetails.postalCodeStringPostal or ZIP code of the billing address.
billingDetails.phoneStringCustomer’s phone number including country code.
billingDetails.emailStringCustomer’s email address.
billingDetails.dateOfBirthStringCustomer’s date of birth (YYYY-MM-DD format).
metadata.customerIdStringMerchant-defined customer identifier stored as metadata.
expirationDateStringDate when the token or card will expire (YYYY-MM-DD format).

Response

On success, this endpoint returns a token object containing a reference to the card. The exact structure can
include:

FieldTypeDescription
tokenStringSecure reference for the vaulted card.
cardMaskStringMasked PAN for display/logging (e.g. 411111******1111).
expMonthStringCard expiration month (MM).
expYearStringCard expiration year (YYYY).
statusStringToken status: ACTIVE or INACTIVE.
issuingBankCountryStringISO-2 country code of the issuing bank (e.g. IE).
binCardCategoryStringBIN-derived category (e.g. CLASSIC, GOLD).
cardPaymentBrandStringCard scheme brand (e.g. VISA, MASTERCARD).
binCardTypeStringBIN-derived card type: DEBIT or CREDIT.
issuingBankNameStringName of the issuing bank as returned by BIN lookup.
binCardCountryCodeStringISO-2 country code of the card’s BIN (e.g. IE).
createdAtStringISO-8601 timestamp when the token was created.
expirationDateString (YYYY-MM-DD)ISO-8601 date. Date when this token will expire (5-year default if not set).
redirectUrlStringNullable URL to redirect the customer for a 3DS challenge if additional authentication is required.
billingDetailsObject (BillingDetails)(Optional in Create) Original billing info you provided—returned for reference.
metadataMap<String,String>(Optional) Echo of your free-form metadata map.

Keep the cardToken secure; it is what you will use to perform charges or create recurring payments
without handling raw card numbers again.

{
  "token":                "tok_abc123xyz",
  "cardMask":             "411111******1111",
  "expMonth":             "12",
  "expYear":              "2025",
  "status":               "ACTIVE",
  "issuingBankCountry":   "IE",
  "binCardCategory":      "CLASSIC",
  "cardPaymentBrand":     "VISA",
  "binCardType":          "CREDIT",
  "issuingBankName":      "Bank of Dublin",
  "binCardCountryCode":   "IE",
  "createdAt":            "2025-07-14T10:00:00Z",
  "expirationDate":       "2028-07-14",
  "redirectUrl":          null
}

See theInitiating Card Payment API docs for detailed definitions of the Card, BillingDetails, Order, and Device objects.