Batch file structure
This page defines the batch file format that the issuer backend provides for batch updates.
Batch file structure
The batch file has the following structure:
header
Object
M
The header describing the batch update request.
records
Array
M
The array containing the records. Each record corresponds to an operation.
signature
String
M
This field represents a detached JSON Web Signature (JWS). The signature must be created with the issuer private key. During D1 onboarding, the issuer shares the corresponding public key. For details, see JWS.
Header
The header has the following structure:
batchId
String
48
M
The identifier of the batch file as specified in the file name.
seqNumber
String
48
M
The sequence number of the batch file as specified in the file name.
issuerId
String
48
M
The identifier of the issuer.
operation
String
48
M
Identifies the operation that will be performed with the input file. Value: VIRTUAL_CARD_REGISTRATION.
Records
A record has the following structure:
rowId
int
-
M
The incremental row identifier.
virtualCardRegistrationRequest
Object
-
M
The virtual card registration request payload.
virtualCardRegistrationRequest
card
Object of type Card
N/A
M
An object containing the encrypted card data.
Where the card has the following structure:
id
String
1...48
M
The unique identifier assigned by the issuer.
encryptedData
String
-
M
PKCS#7 payload encrypted with the Thales public key.
scheme
String
-
M
Values: VISA or MASTERCARD.
The content encryption algorithm is AES256/CBC/PKCS7Padding.
The supported key encryption algorithm for an RSA public key (2048-bit) is RSA/OAEPWithSHA256AndMGF1Padding.
For details, see Data encryption and security.
The structure of the deciphered payload is as follows:
fpan
String
Up to 20
M
FPAN of the funding card. Example: {"fpan":"6789451266992345"}.
Signature
The signature object uses the JWS scheme as specified by RFC 7515.
During D1 onboarding, the issuer must share the public key.
Process
Remove carriage returns and whitespace from the payload.
Encode the payload using
UTF-8.Initialize a signing object with the encoded data.
Set the protected header:
alg = "PS256"kid = "key identifier"
Use the private key to sign the data and produce a JWS object.
Split the JWS string into parts using
.as the separator.Create the detached signature by combining the first and third parts with
...Return the detached signature.
Example (Node.js):
JWS composition
The following format shows the representation of a JWS object:
Base64URL(UTF-8(JWS header)) || '.' || Base64URL(JWS payload) || '.' || Base64URL(JWS signature)
As the detached signature is used, the JWS Payload is replaced by an empty string:
Base64URL(UTF-8(JWS header)) || '..' || Base64URL(JWS signature)
JWS header
The header contains the following metadata:
alg
Enum
n/a
Required
Algorithm used to sign the JWS payload. Value is PS256.
kid
String
64
Required
Key identifier of the key used to sign the JWS payload.
JWS payload
The payload to sign is a JSON object with the header and records attributes. It uses UTF-8 encoding and contains no carriage returns or whitespace. Example: {header:{...},records:[...]}
Batch file example
Last updated
Was this helpful?