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.


πŸ“˜

Tip

You can test out a request that hits our sandbox in real-time. Follow the instructions here to use the "Try It!" feature on the right side.

Request Content

Property

Type

Required

batchTransaction

container

required, contains the following properties (see batchTransaction)

batchId

string

required

callbackUrl

string

required

cardTransaction

container

required for credit card transactions (see cardTransaction)

altTransaction

container

required for ACH/ECP, SEPA, or PayPal transactions (see altTransaction)

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

To test out a basic API request, click the "Try It!" button in the right-hand column to test using the default, pre-populated sample values. To test with your own values, edit the parameter fields below. You'll see them populate in the right-hand column and you can click the "Try It!" button to submit your test request and see a response.

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