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 card-transaction
and/or alt-transaction
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.
Request Content
batch-transaction
container required, contains the following properties (see batch-transaction):
Property | Type | Required |
---|---|---|
alt-transaction | container | required for ACH/ECP, SEPA, or PayPal transactions (see alt-transaction) |
batch-id | string | required |
callback-url | string | required |
card-transaction | container | required for credit card transactions (see card-transaction) |
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.
Examples
Request Examples
curl -v -X POST https://sandbox.bluesnap.com/services/2/batch-transactions \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<batch-transaction xmlns="http://ws.plimus.com">
<batch-id>567890</batch-id>
<callback-url>http://example.com/batch_callback</callback-url>
<card-transaction>
<card-transaction-type>AUTH_CAPTURE</card-transaction-type>
<merchant-transaction-id>566</merchant-transaction-id>
<amount>20.00</amount>
<currency>USD</currency>
<card-holder-info>
<first-name>Joe</first-name>
<last-name>Example</last-name>
</card-holder-info>
<credit-card>
<card-number>4263982640269299</card-number>
<expiration-month>02</expiration-month>
<expiration-year>2023</expiration-year>
</credit-card>
</card-transaction>
<card-transaction>
<card-transaction-type>AUTH_CAPTURE</card-transaction-type>
<merchant-transaction-id>567</merchant-transaction-id>
<amount>25.00</amount>
<currency>USD</currency>
<card-holder-info>
<first-name>Jane</first-name>
<last-name>Shopper</last-name>
</card-holder-info>
<credit-card>
<card-number>4111111111111111</card-number>
<expiration-month>07</expiration-month>
<expiration-year>2023</expiration-year>
</credit-card>
</card-transaction>
</batch-transaction>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/batch-transactions \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<batch-transaction xmlns="http://ws.plimus.com">
<batch-id>unique_0130076552988</batch-id>
<callback-url>http://sandbox.bluesnap.com/jsp/batch_callback.jsp</callback-url>
<card-transaction>
<card-transaction-type>AUTH_CAPTURE</card-transaction-type>
<merchant-transaction-id>566</merchant-transaction-id>
<soft-descriptor>DescTest txn1</soft-descriptor>
<amount>11.00</amount>
<currency>USD</currency>
<vaulted-shopper-id>19567060</vaulted-shopper-id>
</card-transaction>
<card-transaction>
<card-transaction-type>AUTH_CAPTURE</card-transaction-type>
<merchant-transaction-id>567</merchant-transaction-id>
<amount>11.00</amount>
<currency>USD</currency>
<vaulted-shopper-id>20773559</vaulted-shopper-id>
<credit-card>
<card-last-four-digits>9299</card-last-four-digits>
<card-type>VISA</card-type>
</credit-card>
</card-transaction>
</batch-transaction>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/batch-transactions \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<batch-transaction xmlns="http://ws.plimus.com">
<batch-id>shachaf_014</batch-id>
<callback-url>http://sandbox.bluesnap.com/jsp/batch_callback.jsp</callback-url>
<alt-transaction>
<amount>100.00</amount>
<currency>USD</currency>
<paypal-transaction>
<paypal-subscription-id>1234567</paypal-subscription-id>
</paypal-transaction>
</alt-transaction>
</batch-transaction>'
Response Example
HTTP/ 1.1 201 Created