Skip to main content
Version: 2.0.0

TIN Tokenization

TIN Tokenization

The TIN Tokenization endpoint allows you to securely convert sensitive Taxpayer Identification Numbers into non-sensitive tokens before using them anywhere in the API. Once tokenized, the token can be used in place of the raw TIN across all supported downstream endpoints.

Why is this recommended?

Raw TINs carry high compliance risk wherever they travel. TIN Tokenization replaces the TIN with a token upfront, so the raw value never has to move through your systems again. It helps you:

  • Limit exposure. Fewer systems and payloads ever see the actual TIN.
  • Avoid repeat work. Encrypt and submit once; reuse the token everywhere after.
  • Share data safely. Tokens carry no identifiable taxpayer information, making them safe for logs, microservices, or third-party calls.
  • Simplify batch workflows. Reference the same TIN across multiple downstream calls (e.g., a Business record and its related 1099 filings) using one token.

How It Works

TIN Tokenization uses a hybrid encryption model combining symmetric and asymmetric encryption to ensure the raw TIN never travels through your systems in plain text.

Before calling this endpoint, the TIN must be encrypted on the client side using the following approach:

  1. Retrieve the RSA Public Key

    Retrieve your RSA Public Key from the Developer Console under Settings -> Credentials -> TIN Tokenization. This key is unique to your account and is automatically generated when your account is created.

    TaxBandits provides a 2048-bit RSA public key, which your application uses only to encrypt the AES key. The corresponding RSA private key is securely managed by TaxBandits and is never shared with clients.

  2. Generate an AES Key

    Generate a cryptographically secure random 256-bit (32-byte) AES key for each encryption operation. This key will be used to encrypt the TIN.

  3. Encrypt the TIN using AES-GCM

    Encrypt the plain-text TIN using AES-256-GCM with a randomly generated 96-bit (12-byte) nonce. A unique nonce must be generated for every encryption operation. AES-GCM provides both confidentiality and integrity protection.

  4. Encrypt the AES Key using RSA-OAEP

    Encrypt the AES key using the RSA Public Key with OAEP padding and SHA-256. This ensures the AES key can only be decrypted by TaxBandits using the corresponding RSA private key.

  5. Encode and Submit

    Base64-encode the encrypted TIN, nonce, and encrypted AES key. Submit them together in the request payload.

    On the server side, TaxBandits decrypts the AES key using the RSA Private Key, decrypts the TIN using the AES key and nonce, validates the TIN, generates a unique token, and returns the token to your client.

Use the returned TINToken in place of the TIN in any downstream endpoint that accepts TINDetails.Format = "TOKENIZED_TIN" - including Business/Create, Recipient/Create, Form1099NEC/Create, and others.

Encryption Input Format

When submitting an encrypted TIN, provide the following three Base64-encoded values as the EncryptedTIN payload:

ValueDescription
EncryptedTINBase64-encoded AES-GCM ciphertext of the plain-text TIN
NonceBase64-encoded nonce used during AES-GCM encryption. Must be unique per TIN.
EncryptedKeyBase64-encoded RSA-OAEP encrypted AES key

Never reuse a nonce with the same AES key. Never send a plain-text TIN to this endpoint.

Why Use TIN Tokenization

Raw TINs carry significant compliance risk wherever they travel. TIN Tokenization replaces the TIN with a token at the earliest point in your workflow, so the raw value never needs to move through your systems again.

  • Limit exposure — Fewer systems and payloads ever see the actual TIN.
  • Avoid repeat work — Encrypt and submit once; reuse the token everywhere after.
  • Share data safely — Tokens carry no identifiable taxpayer information, making them safe for logs, microservices, or third-party calls.
  • Simplify batch workflows — Reference the same TIN across multiple downstream calls (such as a Business record and its related 1099 filings) using one token.

You can tokenize up to 500 TINs in a single request payload.

Endpoint

POST /Utility/TINTokenization 

All requests require a Bearer token obtained through the OAuth 2.0 authentication flow. Learn more about OAuth 2.0

Request Body

FieldTypeDescription
EncryptedKeyStringEncrypted AEK (AES Encryption Key) used to encrypt the TIN before tokenization.
EncryptedTINDetailsObject[]Array of TIN entries to tokenize. Multiple entries supported per request.
   SequenceIdStringOptional Your reference ID for this entry, returned in the response for matching.
Size Range: 50 characters
   TINTypeStringType of TIN.
Allowed values

"EIN", "SSN", "QI-EIN", "ITIN", "WP-EIN", "WT-EIN", "NQI-EIN", "NA"

   EncryptedTINStringBase64-encoded encrypted TIN value, produced using AES-GCM encryption as described above.
   NonceStringUnique random nonce associated with the TIN during the encryption process.

Response Body

FieldTypeDescription
SuccessRecordsObject[]It will show the detailed information about the success status of TIN tokenized records.
   SequenceIdStringYour reference ID, echoed back for matching.
   TINTokenStringThe generated token. Use this value in place of the raw TIN in all supported downstream endpoints by setting TINDetails.Format to TOKENIZED_TIN.
ErrorRecordsObject[]It will show the detailed information about the error records.
   SequenceIdStringYour reference ID, echoed back for matching.
   ErrorsObject[]Present if any entry failed. Null when all entries succeed.
      IdStringUnique identifier for the validation error.
      NameStringShort name identifying the error type.
      MessageStringDescription of what went wrong.

Using the Token in Downstream Endpoints

Once you have a TINToken, pass it in the TINDetails object of any supported endpoint by setting Format to TOKENIZED_TIN:

TIN tokenization flow

This is supported in Business/Create, Business/Update, Recipient/Create, Recipient/Update, Form1099NEC/Create, and all other endpoints that accept TINDetails.

Key Notes

  • The RSA public key is unique to your account and is generated when your account is created. Retrieve it from the Developer Console before implementing client-side encryption.
  • The RSA public key can be downloaded once and securely cached by your application. It does not need to be retrieved before every API request unless the key has been rotated.
  • Never reuse a nonce with the same AES key. Generate a unique nonce for each TIN encryption operation.
  • The AES key must never be transmitted in plain text. It must always be encrypted using the TaxBandits RSA public key before being included in the request.
  • Base64 encoding is used only for data transport. It does not provide encryption or security.
  • TIN tokens are stable within your account. The same TIN will always generate the same token, allowing the token to be securely stored and reused.

Security Considerations

  • Use only the RSA public key downloaded from the TaxBandits Developer Console.
  • Do not generate or upload your own RSA key pair for production use.
  • Never expose, store, or transmit RSA private keys. The corresponding private key is securely managed by TaxBandits.
  • Always use HTTPS when communicating with the TaxBandits API.
  • Rotate or replace the RSA public key when instructed by TaxBandits.
Request JSON
SampleDescriptionAction
Sample 1
Tokenize an encrypted SSN and receive a reusable `TINToken` for downstream endpoints.
Sample 2
Tokenize an encrypted EIN and receive a reusable `TINToken` for downstream endpoints.
Sample 3
Tokenize an encrypted QI-EIN and receive a reusable `TINToken` for downstream endpoints.
Sample 4
Tokenize an encrypted WP-EIN and receive a reusable `TINToken` for downstream endpoints.
Sample 5
Tokenize an encrypted WT-EIN and receive a reusable `TINToken` for downstream endpoints.
Sample 6
Tokenize an encrypted NQI-EIN and receive a reusable `TINToken` for downstream endpoints
Sample 7
Tokenize an encrypted ITIN and receive a reusable `TINToken` for downstream endpoints.
Sample 1
{
"EncryptedKey": "P4F6jUbA9PNeAiyhbRztr0DqC/DkgDuxdKsYj39f/ivxVRgBAPxsgae2Ej9TE/ssblNDuc0zrRDxS/s2yKtlNzI+fZdklWn0/j+zmrpVcTNosv/MV0u9DCmSDnnSpiVZ+ZNCP5SR+GhdFDs+831fa3CHSQZ+5CYJYv0lvxp1ihdMQd+bQCITfMKud1ZjUcZ2DiCjtEK1q+Yaf4u5+bNVTUgfIbRXmHVtRSQU1+AtCW2OyBb1OUZkKGcGF5XUdyG7YDnGPWpXUrLPJTKpoFb2slWibcyJ+OIhhoDES5uZd+q7YZdb9zvbSOuREiAn5bqdJeYiJiFDRoksZ9orzrj0wg==",
"EncryptedTINDetails": [
{
"SequenceId": "001",
"TINType": "SSN",
"EncryptedTIN": "7dUAUVZopKd/retU8YQugZi0oe+uQnW4+Vo=",
"NONCE": "eGUPYRR/vpKA98by"
}
]
}
Response JSON
ResponseDescriptionAction
200
Success Response - This is a sample response for a successful TIN tokenization request.
300
Validation Error Response - You will get the below response when one or more TIN records cannot be tokenized.
400
Bad Request Response - You will get the below response when your API request contains validation errors.
401
Unauthorized Response - You will get the below response when your API request does not contain valid authentication credentials.
Response: 200
{
"SuccessRecords": [
{
"SequenceId": "001",
"TINToken": "TKN_e6b69183237ecffb"
}
],
"ErrorRecords": null,
"Errors": null
}