Skip to main content

Token Types

Basis Theory offers several pre-configured token types for various use-cases and compliance requirements. Token Types define the rules around a data type such as validation requirements, default token containers, fingerprint expressions, and mask expressions.

Token

The token type is used for general data types that don't require input validation or formatting restrictions.

Token AttributeValue
Typetoken
Default Containers[ "/general/high/" ]
Input ValidationNone
Input LengthAny
Default Fingerprint Expression{{ data | stringify}}
Default Mask Expressionnull

Card

Token AttributeValue
Typecard
Default Containers[ "/pci/high/" ]
Input ValidationSee Card Object for validation requirements
Default Fingerprint Expression{{ data.number }}
Default Mask Expression{
  "number": "{{ data.number | reveal_last: 4 }}",
  "expiration_month": "{{ data.expiration_month }}",
  "expiration_year": "{{ data.expiration_year }}"
}

Bank

Token AttributeValue
Typebank
Default Containers[ "/bank/high/" ]
Input ValidationSee Bank Object for validation requirements
Default Fingerprint Expression{{ data.account_number }}|{{ data.routing_number }}
Default Mask Expression{
  "routing_number": "{{ data.routing_number }}",
  "account_number": "{{ data.account_number | reveal_last: 4 }}"
}

Card Number

Token AttributeValue
Typecard_number
Default Containers[ "/pci/high/" ]
Input ValidationLuhn-valid, numeric
Input Length13 - 19
Default Fingerprint Expression{{ data }}
Default Mask Expression{{ data | reveal_last: 4 }}

Examples:

Input DataMasked Value
4242424242424242XXXXXXXXXXXX4242
36227206271667XXXXXXXXXX1667

US Bank Account Number

Token AttributeValue
Typeus_bank_account_number
Default Containers[ "/bank/high/" ]
Input ValidationNumeric
Input Length3 - 17
Default Fingerprint Expression{{ data }}
Default Mask Expression{{ data | reveal_last: 4 }}

Examples:

Input DataMasked Value
1234567890XXXXXX7890

US Bank Routing Number

Token AttributeValue
Typeus_bank_routing_number
Default Containers[ "/bank/low/" ]
Input ValidationNumeric, ABA-valid
Input Length9
Default Fingerprint Expression{{ data }}
Default Mask Expression{{ data | reveal_last: 4 }}

Social Security Number

Token AttributeValue
Typesocial_security_number
Default Containers[ "/pii/high/" ]
Input ValidationNumeric with optional delimiter of "-"
Input Length9 (not including delimiting characters)
Default Fingerprint Expression{{ data | remove: '-' }}
Default Mask Expression{{ data | reveal_last: 4 }}

Examples:

Input DataMasked Value
123456789XXXXX6789
123-45-6789XXX-XX-6789

Employer ID Number

Token AttributeValue
Typeemployer_id_number
Default Containers[ "/pii/high/" ]
Input ValidationNumeric with optional delimiter of "-"
Input Length9 (not including delimiting characters)
Default Fingerprint Expression{{ data | remove: '-' }}
Default Mask Expression{{ data | reveal_last: 4 }}

Examples:

Input DataMasked Value
123456789XXXXX6789
12-3456789XX-XXX6789