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 Attribute | Value |
---|---|
Type | token |
Default Containers | [ "/general/high/" ] |
Input Validation | None |
Input Length | Any |
Default Fingerprint Expression | {{ data | stringify}} |
Default Mask Expression | null |
Card
Token Attribute | Value |
---|---|
Type | card |
Default Containers | [ "/pci/high/" ] |
Input Validation | See Card Object for validation requirements |
Default Fingerprint Expression | {{ data.number }} |
Default Mask Expression | { |
See Test Card Numbers for suggested test data when using card
tokens.
The cvc
property within the Card Object automatically expires and is deleted after one hour in order to comply with PCI requirements.
cvc
for longer than one hour, it may be possible to extend the expiration time while maintaining PCI compliance. Please reach out to our support team for assistance.Bank
Token Attribute | Value |
---|---|
Type | bank |
Default Containers | [ "/bank/high/" ] |
Input Validation | See Bank Object for validation requirements |
Default Fingerprint Expression | {{ data.account_number }}|{{ data.routing_number }} |
Default Mask Expression | { |
Card Number
Token Attribute | Value |
---|---|
Type | card_number |
Default Containers | [ "/pci/high/" ] |
Input Validation | Luhn-valid, numeric |
Input Length | 13 - 19 |
Default Fingerprint Expression | {{ data }} |
Default Mask Expression | {{ data | reveal_last: 4 }} |
See Test Card Numbers for suggested test data when using card_number
tokens.
Examples:
Input Data | Masked Value |
---|---|
4242424242424242 | XXXXXXXXXXXX4242 |
36227206271667 | XXXXXXXXXX1667 |
US Bank Account Number
Token Attribute | Value |
---|---|
Type | us_bank_account_number |
Default Containers | [ "/bank/high/" ] |
Input Validation | Numeric |
Input Length | 3 - 17 |
Default Fingerprint Expression | {{ data }} |
Default Mask Expression | {{ data | reveal_last: 4 }} |
Examples:
Input Data | Masked Value |
---|---|
1234567890 | XXXXXX7890 |
US Bank Routing Number
Token Attribute | Value |
---|---|
Type | us_bank_routing_number |
Default Containers | [ "/bank/low/" ] |
Input Validation | Numeric, ABA-valid |
Input Length | 9 |
Default Fingerprint Expression | {{ data }} |
Default Mask Expression | {{ data | reveal_last: 4 }} |
Social Security Number
Token Attribute | Value |
---|---|
Type | social_security_number |
Default Containers | [ "/pii/high/" ] |
Input Validation | Numeric with optional delimiter of "-" |
Input Length | 9 (not including delimiting characters) |
Default Fingerprint Expression | {{ data | remove: '-' }} |
Default Mask Expression | {{ data | reveal_last: 4 }} |
Examples:
Input Data | Masked Value |
---|---|
123456789 | XXXXX6789 |
123-45-6789 | XXX-XX-6789 |
Employer ID Number
Token Attribute | Value |
---|---|
Type | employer_id_number |
Default Containers | [ "/pii/high/" ] |
Input Validation | Numeric with optional delimiter of "-" |
Input Length | 9 (not including delimiting characters) |
Default Fingerprint Expression | {{ data | remove: '-' }} |
Default Mask Expression | {{ data | reveal_last: 4 }} |
Examples:
Input Data | Masked Value |
---|---|
123456789 | XXXXX6789 |
12-3456789 | XX-XXX6789 |