Run Tokenization Migration Guide
Overview
This guide is for ISVs and developers who already collect card or bank account details with Runner v1 (runner.js, versions 1.x) and want to move to Runner v2 (runner-v2.js).
Runner v2 is the SDK for Run Tokenization. It renders a single, themeable card form that stays the same whichever gateway processes your transactions. Run turns on Run Tokenization for each MID.
In short: swap the script tag, keep your existing init() and tokenize() code, set useCvv and useExpiry explicitly, and check whether your server reuses browser tokens.
Migration is optional. Runner v1 continues to work and is not deprecated.
Do I Need to Migrate?
Run enables Run Tokenization on each MID; your code doesn’t. Loading v2 on a MID without Run Tokenization enabled changes nothing visible.
Migration Steps
Replace the Script Tag
Load runner-v2.js, not runner.js. In production, pin a specific version (such as 2.0.4) instead of latest, so a new release never reaches your checkout before you’ve tested it.
Keep Your Integration Code
The global is still Runner, and the public API is the same as in v1:
These all still work: init, tokenize(done, expMonth?, expYear?), destroy, onLoaded, onTokenize, getTokenizerError, cardDataChanged, validationMessageChange, the Plaid methods, and every v1 option.
Set useCvv and useExpiry Explicitly
On MIDs with Run Tokenization enabled, these options default to true (in v1 they defaulted to false). If you’ve never set them, your form will start showing CVV and expiry fields. Set them explicitly so the form looks the way you intend:
Enable Run Tokenization on a Test MID
Send your Run representative the MIDs you want enabled. Start with one staging MID, work through the testing checklist below, then roll out one MID at a time.
Update Your Server If It Reuses Browser Tokens
Most integrations need to check this step. See Server-side changes below.
What Isn’t Changing
- Same global and methods.
new Runner(...),init(),tokenize(),destroy()and the v1 callbacks keep their names and signatures. - MIDs without Run Tokenization behave exactly as in v1. CardConnect, CyberSource, Payroc and iStream MIDs get the same gateway hosted fields, option defaults and result shape.
- ACH and Plaid work as before. Continue to pass the Plaid attempt ID on the charge as you do today.
- Card readers (
cardReaderInputId) still tokenize through the gateway, even on Run Tokenization MIDs, because encrypted reader data is tied to that gateway. - The Charge API is unchanged. Send the token as
account_tokentoPOST /api/v1/charge, with the same payload and response. - Validation errors still arrive as JSON (
{ "message": "…" }) throughvalidationMessageChangeand the hidden#tokenizererrorfield.
Changes for Run Tokenization
The Card Form
New Options
New Callbacks
Set these on the Runner class, not on an instance:
The Token Result
The result no longer includes card_info, bank_account or risk_info. Use bin, last4 and brand instead. cardDataChanged does not fire on Run Tokenization MIDs; read the same data from the tokenize() result or from onTokenize.
For the full list of options and styling, see the Run Tokenization reference.
Potential Hurdles
Good to Know
- Layout. Card number, expiry and CVV live in one iframe. You can arrange them with
layoutorcss, but you can’t place your own inputs between them. - CSS. Properties such as
position,z-index,transform,url(...)and@importare removed. Colors, fonts, borders, spacing and grid placement are allowed. - Single-page apps. Call
runner.destroy()before mounting the form again.
Server-Side Changes
On a Run Tokenization MID, the account_token returned to the browser is a Run Token, a short-lived card session reference:
- It expires 5 minutes after tokenization.
- It is single-use: the first charge or vault creation consumes it.
- It only works for MIDs under the same customer as the MID that created it.
POST /api/v1/bin-info and POST /api/v1/surcharge read the token without consuming it, so you can call them before the charge.
If your server saves the browser token to charge later, that will stop working. Save a vault instead:
Existing vaults keep working after you migrate. As long as Run Tokenization stays enabled on a MID, vaults created through it can still be charged even if Run later moves that MID to a different gateway.
If you charge with a Run Token on a MID that doesn’t have Run Tokenization enabled, the charge is declined with the message Card token is invalid or expired — please re-enter card details. If you see this, ask the customer to enter their card again.
Testing Checklist
Run these checks on a staging MID with Run Tokenization enabled:
- The form shows the fields you expect (CVV, expiry).
- A valid test card returns
account_token,bin,last4andbrand. - An invalid card number shows an error and returns
account_token: null. - A charge with the token is approved, and a second charge with the same token is declined.
- A charge with
vault: "Y"creates a vault, and a later charge with thatvault_idis approved. - A charge on a vault created before the migration is approved.
- Your styling, layout and error placement look right on mobile and desktop.
- If you use
updateMode, the expiry you pass totokenize()reaches the charge.
Rolling Back
To roll back, restore your pinned v1 script tag. Vaults are stored by Run, so vaults created while you were on v2 keep working. If you also want a MID taken off Run Tokenization, ask your Run representative to disable it.