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.

When creating a token without a fingerprint_expression, the fingerprint_tokens tenant setting must be set to true to automatically apply the Default Fingerprint Expression associated with the token type. See our docs on Fingerprints for details.

Token

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

Token AttributeValue
Typetoken
Default Container/general/high/
Input ValidationNone
Input LengthAny
Default Fingerprint Expression{{ data | stringify }}
Default Mask Expressionnull
Default Search IndexesNone

Card

Token AttributeValue
Typecard
Default Container/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 }}"
}
Default Search IndexesNone

See Test Card Numbers for suggested test data when using card tokens.

The cvc property within the Card Object automatically expires and is deleted based on your CVC Retention Quota, with a default of one hour in order to comply with PCI requirements.

If you have a business case that requires retaining cvc for longer than the default "CVC Retention" Quota of one hour, it may be possible to extend the expiration time while maintaining PCI compliance. Please request a change to the CVC Retention Quota in the Quota Page for your Tenant.

Bank

Token AttributeValue
Typebank
Default Container/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 }}"
}
Default Search IndexesNone

Card Number

Token AttributeValue
Typecard_number
Default Container/pci/high/
Input ValidationLuhn-valid, numeric
Input Length13 - 19
Default Fingerprint Expression{{ data }}
Default Mask Expression{{ data | reveal_last: 4 }}
Default Search IndexesNone

See Test Card Numbers for suggested test data when using card_number tokens.

Examples:

Input DataMasked Value
4242424242424242XXXXXXXXXXXX4242
36227206271667XXXXXXXXXX1667

US Bank Account Number

Token AttributeValue
Typeus_bank_account_number
Default Container/bank/high/
Input ValidationNumeric
Input Length3 - 17
Default Fingerprint Expression{{ data }}
Default Mask Expression{{ data | reveal_last: 4 }}
Default Search IndexesNone

Examples:

Input DataMasked Value
1234567890XXXXXX7890

US Bank Routing Number

Token AttributeValue
Typeus_bank_routing_number
Default Container/bank/low/
Input ValidationNumeric, ABA-valid
Input Length9
Default Fingerprint Expression{{ data }}
Default Mask Expression{{ data | reveal_last: 4 }}
Default Search IndexesNone

Social Security Number

Token AttributeValue
Typesocial_security_number
Default Container/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 }}
Default Search Indexes{{ data }}
{{ data | replace: '-' }}
{{ data | last4 }}

Examples:

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

Employer ID Number

Token AttributeValue
Typeemployer_id_number
Default Container/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 }}
Default Search Indexes{{ data }}
{{ data | replace: '-' }}
{{ data | last4 }}

Examples:

Input DataMasked Value
123456789XXXXX6789
12-3456789XX-XXX6789