Create Batch Transaction

The Create Batch Transaction request enables you to process multiple transactions at once, including credit card transactions (Auth Capture only), ACH/ECP, SEPA, and PayPal recurring transactions.

The request includes multiple cardTransaction and/or altTransaction resources; a unique batch ID that you define; and a callback URL pointing to where you would like the status of the batch transaction to be sent after processing.

The API sends an immediate response to the Create Batch Transaction request and then the individual transactions in the request are processed. Once all transactions are processed, BlueSnap sends the full batch result to the callback URL you provided in the request. Some of the transactions may be successfully processed and some may fail. However, as long as the batch file was successfully processed, the callback status of the batch will be completed. For an example of the batch result that is sent to your callback URL after the transactions have been processed, see Example Batch Result.

📘

Transaction limit per batch

There is a limit of 2000 transactions per batch.


📘

Send a test request

Go to API Explorer to send a test request to our sandbox environment and receive a response in real time.


Request Content

PropertyTypeRequired
altTransactioncontainerrequired for ACH/ECP, SEPA, or PayPal transactions (see altTransaction)
batchIdstringrequired
batchTransactioncontainerrequired, contains the following properties (see batchTransaction)
callbackUrlstringrequired
cardTransactioncontainerrequired for credit card transactions (see cardTransaction)

Response Details

If successful, the response HTTP status code is 201 Created.
Note that if an error occurs, the error format is slightly different from other error types. See Batch transaction errors.
For an example of the batch result that is sent to your callback URL after the transactions have been processed, see Example Batch Result.

Back to Top


Examples

Request Examples

curl -v -X POST https://sandbox.bluesnap.com/services/2/batch-transactions \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
    "batchId": "PKB0042",
    "callbackUrl": "http://example.com/batch_callback ",
    "cardTransaction": [{
        "cardTransactionType": "AUTH_CAPTURE",
        "merchantTransactionId": "566",
        "amount": 20.00,
        "currency": "USD",
        "cardHolderInfo": {
            "firstName": "Joe",
            "lastName": "Example"
        },
        "creditCard": {
            "cardNumber": "4263982640269299",
            "expirationMonth": "02",
            "expirationYear": "2023"
        }
    },{
        "cardTransactionType": "AUTH_CAPTURE",
        "merchantTransactionId": "567",
        "amount": 25.00,
        "currency": "USD",
        "cardHolderInfo": {
            "firstName": "Jane",
            "lastName": "Shopper"
        },
        "creditCard": {
            "cardNumber": "4111111111111111",
            "expirationMonth": "07",
            "expirationYear": "2023"
        }
    }]
}'
curl -v -X POST https://sandbox.bluesnap.com/services/2/batch-transactions \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
    "batchId": "PKB0043",
    "callbackUrl": "http://example.com/batch_callback ",
    "cardTransaction": [{
        "cardTransactionType": "AUTH_CAPTURE",
        "merchantTransactionId": "566",
        "amount": 11.00,
        "currency": "USD",
        "vaultedShopperId": 19596516
    },{
        "cardTransactionType": "AUTH_CAPTURE",
        "merchantTransactionId": "567",
        "amount": 12.00,
        "currency": "USD",
        "vaultedShopperId": 19596754,
        "creditCard": {
            "cardLastFourDigits": "9299"
        }
    }]
}'
curl -v -X POST https://sandbox.bluesnap.com/services/2/batch-transactions \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
    "batchId": "PKB0044",
    "callbackUrl": "http://example.com/batch_callback ",
    "altTransaction": [{
        "amount": 100.00,
        "currency": "USD",
        "paypalTransaction": {
            "paypalSubscriptionId": 22758655
        }
    }]
}'
curl -v -X POST https://sandbox.bluesnap.com/services/2/batch-transactions \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
{
    "batchId": "PKB0035",
    "callbackUrl": "http://example.com/batch_callback ",
    "cardTransaction": [{
        "cardTransactionType": "CAPTURE",
        "transactionId": "38591014",
        "merchantTransactionId": "1"
    }]
}

Response Example

HTTP/ 1.1 201 Created

Back to Top


API Explorer

BlueSnap provides a sandbox environment so you can test basic requests with this endpoint. You can view the request in the API Explorer console and its response directly below the console.

The console includes a sample request with predefined parameter values. To send a request with custom values, edit the parameter fields below. As you edit the fields, your custom values display in the request in the console.

Click the Try it! button below the request example when you are ready to send your request.

Language
Credentials
Header
Click Try It! to start a request and see the response here!