Card Batch
Initiate a new card batch for processing multiple transactions efficiently within the Vortex platform.
Create Card Batch
Vortex Envelope for Card Batch Transactions
To create a card batch in Vortex, structure your request as follows:
{
"arguments": [
{
"payment transaction payload as JSON"
}
],
"procedure": "batch.create",
"class": "rpc",
"requestId": "UUID"
}
Ensure to replace "payment transaction payload as JSON" and "UUID" with your specific transaction details and a unique identifier, respectively.
Request
Sample Payload
Below is an example payload to create a card batch:
{
"number": 976,
"reference": "MyReference718843069923",
"autoCloseTime": "2022-11-16T19:23:45Z",
"externalId": "Test233720977882601514",
"operatorInitials": "DKw",
"merchant": {
"number": "8739290200300003",
"processor": {
"name": "TSYS",
"bankNumber": "1234"
}
}
}
This payload includes batch number, reference, scheduled auto-close time, an external identifier, operator initials, and merchant details.
Code Example
Execute a card batch creation with the following JavaScript example using the Broker Client Library:
const broker = require('@pps/broker-client');
const client = new broker.PaymentClient('EOS_YOUR_TENANT_TOKEN');
async function createCardBatch() {
try {
await client.open();
const transaction = {
// Insert your payload here (refer to the Sample Payload above)
};
const response = await client.rpc.cardBatch.create(transaction);
console.log(`Batch ID: ${response.id}`);
} catch (error) {
console.error('Failed to create card batch:', error);
} finally {
await client.close();
}
}
createCardBatch();
Remember to replace 'EOS_YOUR_TENANT_TOKEN' with your actual tenant token.
Response
Sample Response
Upon successful creation of a card batch, the response will look like this:
{
"code": 200,
"error": null,
"value": {
"id": "QwYFqSBmp9xNBOxTz0EkHw=="
},
"class": "response",
"id": "b1e8e0d1-17e8-5e21-ac96-91dca63a910d"
}
Close Card Batch
Finalize an existing card batch to complete its processing.
Request
Code Example
Close an active card batch using the following code snippet:
const broker = require('@pps/broker-client');
const client = new broker.PaymentClient('EOS_YOUR_TENANT_TOKEN');
async function closeCardBatch() {
try {
await client.open();
await client.rpc.cardBatch.close('externalId');
console.log('Card batch closed successfully.');
} catch (error) {
console.error('Failed to close card batch:', error);
} finally {
await client.close();
}
}
closeCardBatch();
In this example, replace 'EOS_YOUR_TENANT_TOKEN' with your tenant token and 'externalId' with the specific ID of the batch you wish to close.
Fields Overview
To get a comprehensive list of fields, please visit our Required Fields dedicated page.
Updated over 1 year ago
