Tokenization API

Card Tokenization API Overview

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 Facilero platform.

1. Create Token

Endpoint

Live

POST https://live.facilero.com/api/v1/payments/card/tokenize

Sandbox

POST https://sandbox.facilero.com/api/v1/payments/card/tokenize

Request Headers

  • Content-Type: application/json
  • Authorization: Bearer <AUTH_TOKEN>

Request Body DTO

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.

Example Request Body

{
  "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"
}

Response Body DTO

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.

Example Response Body

{
  "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 the Card-Sale API docs for detailed definitions of theCard, BillingDetails, Order, and Device objects.