Pistas de banda magnética
Comprenda cómo D1 genera los valores de las pistas 1/2/3 durante la personalización de la tarjeta física.
Última actualización
¿Te fue útil?
Comprenda cómo D1 genera los valores de las pistas 1/2/3 durante la personalización de la tarjeta física.
D1 builds magnetic stripe Track 1, Track 2, and Track 3 during physical card personalization. You can also override any track by sending a full track value.
If you provide trackData.track1, trackData.track2, or trackData.track3, D1 uses that value as-is.
If you omit a track, D1 computes it from your D1 API inputs and your D1 configuration.
Required D1 API inputs:
cardProductId: Card product identifier configured during D1 onboarding.
encryptedData.pan: Primary Account Number (PAN).
encryptedData.exp: Expiry date, typically YYMM (for example, 2906).
Optional D1 API inputs:
encryptedData.encodedName: End user name for Track 1, pre-encoded per ISO/IEC 7813 rules.
encryptedData.cvv1: CVV1 value used when your discretionary data pattern includes the cvv token. If omitted, D1 computes it using CVK.
paymentApplication.cvKeyIndex: CVK index used when computing cvv1.
encryptedData.pvv: PIN Verification Value (PVV) used when your discretionary data pattern includes the pvv token. If omitted, D1 computes it using the PIN verification key (PVK).
paymentApplication.pvKeyIndex: PIN verification key index used when computing pvv.
Optional track overrides:
trackData.track1: Full Track 1 value to use as-is.
trackData.track2: Full Track 2 value to use as-is.
trackData.track3: Full Track 3 value to use as-is.
serviceCode: 3‑digit service code used in Tracks 1 and 2.
Discretionary data patterns per track (for example, 000000|cvv|000000).
Use cvv in the pattern to inject cvv1.
Use pvv in the pattern to inject pvv.
Key indexes (cvKeyIndex, pvKeyIndex) available for computation.
Including pvv in discretionary data is not standard for magstripe tracks. Only enable it if explicitly required by your configuration and risk policies.
CVV1 is different from the Card security code (CSC, also known as CVV2). CVV1 appears on the magnetic stripe. CSC/CVV2 must never be stored on the card and is not part of the tracks.
Treat full track values as sensitive card data. Do not log them. Do not expose them to the end user.
Use trackData.track1 if provided.
Otherwise, compute using:
pan, exp, encodedName from the API
serviceCode configured in D1
Track 1 discretionary data pattern configured in D1
cvv1 if referenced by the pattern (cvv token)
Use the provided cvv1, or compute it via CVK (cvKeyIndex)
pvv if referenced by the pattern (pvv token)
Use the provided pvv, or compute it (pvKeyIndex)
Inputs:
pan: 5413330089012345
exp: 2906
encodedName: DOE/ALICE
serviceCode: 201 (configured in D1)
Track 1 discretionary pattern: 000000|cvv|000000
Computed cvv1 (via cvKeyIndex=3): 123
Result:
Discretionary data = 000000 + cvv1 + 000000 → 000000123000000.
Use trackData.track2 if provided.
Otherwise, compute using:
pan, exp from the API
serviceCode configured in D1
Track 2 discretionary data pattern configured in D1
cvv1 if referenced by the pattern (cvv token)
pvv if referenced by the pattern (pvv token)
Inputs:
pan: 5413330089012345
exp: 2906
serviceCode: 201 (configured in D1)
Track 2 discretionary pattern: 00000|cvv|00000
Computed cvv1: 123
Result:
Discretionary data = 00000 + cvv1 + 00000 → 0000012300000.
Track 3 is uncommon in most card programs. Enable it only if your card product requires it.
Use trackData.track3 if provided.
Otherwise, compute using pan from the API and a Track 3 body configured in D1.
pan: 5413330089012345
body (configured in D1): 123456789012345
Result:
Última actualización
¿Te fue útil?
¿Te fue útil?
%B<PAN>^<NAME>^<EXPIRY><SERVICE_CODE><DISCRETIONARY_DATA>?%B5413330089012345^DOE/ALICE^2906201000000123000000?;<PAN>=<EXPIRY><SERVICE_CODE><DISCRETIONARY_DATA>?;5413330089012345=29062010000012300000?;<PAN>=<BODY>?;5413330089012345=123456789012345?