Real-Time Implementation
This guide provides an overview of how to implement Real-Time Account Updater. It covers the initial setup, how to request an update, and how to process the results.
Initial Setup
First, ensure that you have completed the Account Updater Setup guide. This step is only required once.
Private Application
You will need a Private Application to allow your backend to call Basis Theory APIs. Click here to create one using the Basis Theory Customer Portal.
This will create an application with the following Access Controls:
- Permissions:
account-updater:real-time:invoke
Request Real-Time Update
Given a vaulted card
token that you wish to update, first identify whether your system persists the expiration date within the card
token.
If not persisted in the token, you will need to provide the expiration_month
and expiration_year
parameters in the update request.
Submit a request for a real-time update through the API or an SDK using the API key for the application created above.
- Request
- Response
curl "https://api.basistheory.com/account-updater/real-time" \
-H 'Content-Type: application/json' \
-H 'BT-API-KEY: ...' \
-X POST \
-d '{
"token_id": "b4b89606-794a-4652-b375-f4e1d717a5db"
}'
{
"new_token": {
"id": "c06d0789-0a38-40be-b7cc-c28a718f76f1",
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"type": "card",
"card": {
"bin": "42424242",
"last4": "4242",
...
},
...
},
"result_code": "UPD_PAN"
}
Process the Result
The API response will include a result_code that indicates the outcome of the update request. Note that some warning-level result codes may require additional action on your part.
If an update was received, the response will contain the new_card
field containing a token.
The token references in your system should be updated accordingly, and this new token should be used for future transactions.
You have the option to retain the old token that was replaced or delete it once it is no longer needed.