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 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.

Try it in the API Explorer

Request Content

batch-transaction container    required, contains the following properties (see batch-transaction):
  batch-id string    required
  callback-url string    required
  card-transaction container    required for credit card transactions (see card-transaction)
  alt-transaction container    required for ACH/ECP, SEPA, or PayPal transactions (see alt-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>'
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>12345</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>
       <encrypted-card-number>$bsjs_1_0_3$B23uuxq8drUwOYZm3wZi+Qm69V5GPEt8PEio+Edwcm8akczQSK7odgLQH/Au+VqOCsGspW1Q9mPyQIzGLSZLVToAQVfq5C1ld+2ogIIsDL32Hd6IojboLyVlYT1FvPQoDyz19K6N0CUHh5uk0kCLuHSUyjvoJH38ojHZifbJSm/7S5vAtiuC3BJt2z8k9nauQaAXkbyoAYwrS1yDpqOt2k2lGhKcmdQ4ImDR0RL8m8xig6sFrki9oqo3Mju/M5r7wXXVTf7TMtWiQbzdfREOxKUnviXJZpncdHqVjj5GvPYun2qgopKVKr8F5+yd19TVW2gvA1kXBkXonFL9159Gxg==$zckJgo2i8jXDiAHwVVHBKypXFnWqF2e+6luBkmtQQRKniDXyXaalRVKLtYscBaGd$W7Ojqk1Q2iOJVeGL39RAsZTtfup3f1deSzvxrvC9rXA=</encrypted-card-number>
      <card-type>VISA</card-type>
      <expiration-month>07</expiration-month>
      <expiration-year>2016</expiration-year>
  </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>
       <encrypted-card-number>$bsjs_1_0_3$B23uuxq8drUwOYZm3wZi+Qm69V5GPEt8PEio+Edwcm8akczQSK7odgLQH/Au+VqOCsGspW1Q9mPyQIzGLSZLVToAQVfq5C1ld+2ogIIsDL32Hd6IojboLyVlYT1FvPQoDyz19K6N0CUHh5uk0kCLuHSUyjvoJH38ojHZifbJSm/7S5vAtiuC3BJt2z8k9nauQaAXkbyoAYwrS1yDpqOt2k2lGhKcmdQ4ImDR0RL8m8xig6sFrki9oqo3Mju/M5r7wXXVTf7TMtWiQbzdfREOxKUnviXJZpncdHqVjj5GvPYun2qgopKVKr8F5+yd19TVW2gvA1kXBkXonFL9159Gxg==$zckJgo2i8jXDiAHwVVHBKypXFnWqF2e+6luBkmtQQRKniDXyXaalRVKLtYscBaGd$W7Ojqk1Q2iOJVeGL39RAsZTtfup3f1deSzvxrvC9rXA=</encrypted-card-number>
      <card-type>VISA</card-type>
      <expiration-month>07</expiration-month>
      <expiration-year>2016</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"?>
<batch-transaction xmlns="http://ws.plimus.com">
  <batch-id>567891</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>
    <soft-descriptor>DescTest txn1</soft-descriptor>
    <amount>11.00</amount>
    <currency>USD</currency>
    <card-holder-info>
      <first-name>test first name</first-name>
      <last-name>test last name</last-name>
    </card-holder-info>
    <credit-card>
      <card-number>4012888888881881</card-number>
      <security-code>111</security-code>
      <expiration-month>07</expiration-month>
      <expiration-year>2023</expiration-year>
    </credit-card>
  </card-transaction>
  <alt-transaction xmlns="http://ws.plimus.com">
   <soft-descriptor>ABC COMPANY</soft-descriptor>
   <amount>100.00</amount>
   <currency>USD</currency>
   <payer-info>
      <first-name>John</first-name>
      <last-name>Doe</last-name>
      <zip>12345</zip>
      <phone>1234567890</phone>
   </payer-info>
   <ecp-transaction>
      <account-number>4099999992</account-number>
      <routing-number>011075150</routing-number>
      <account-type>CONSUMER_CHECKING</account-type>
   </ecp-transaction>
   <authorized-by-shopper>true</authorized-by-shopper>
  </alt-transaction>
  <alt-transaction>
	<soft-descriptor>SepaPapi</soft-descriptor>
	<amount>20</amount>
	<currency>EUR</currency>
	<payer-info>
		<first-name>John</first-name>
		<last-name>Doe</last-name>
		<phone>23123133213</phone>
		<zip>45353434</zip>
		<country>IT</country>
		<state>ca</state>
		<city>london</city>
		<address>blue lane 21</address>
	</payer-info>
	<sepa-direct-debit-transaction>
		<iban>DE09100100101234567891</iban>
		<bic>PBNKDEFFXXX</bic>
	</sepa-direct-debit-transaction>
	<authorized-by-shopper>true</authorized-by-shopper>
</alt-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 '
<batch-transaction
    xmlns="http://ws.plimus.com">
    <batch-id>PKB0034</batch-id>
    <callback-url>https://pavelk-lap.bluesnap.int:7000/d</callback-url>
    <card-transaction
        xmlns="http://ws.plimus.com">
        <card-transaction-type>CAPTURE</card-transaction-type>
        <transaction-id>38591012</transaction-id>
        <merchant-transaction-id>1</merchant-transaction-id>
    </card-transaction>
</batch-transaction>

Response Example

HTTP/ 1.1 201 Created

Back to Top


Example Descriptions

For details about the above examples, see:

Basic Create Batch Transaction

This example shows a basic Create Batch Transaction request, containing two card-transaction resources with the required fields to process a credit card payment.

Note that within each card-transaction resource you can use any of the options available for a single Auth Capture or Create PayPal Transaction (recurring subscription payment only) request, such as using a vaulted shopper, sending encrypted card information, including metadata, and so on.

Create Batch Transaction with vaulted shoppers

To perform a Create Batch Transaction request with existing vaulted shoppers, you'll need to include the vaulted-shopper-id property within the card-transaction or alt-transaction resources in your request.

Remember to include the card's last four digits if multiple cards are saved for the shopper.

Above is an example of a request with a vaulted shopper ID within each card-transaction resource.

Create Batch Transaction with PayPal recurring subscription payment

To perform batch transactions with PayPal payments for subscriptions, you will need to send the alt-transaction resource in your request, and include in it the paypal-transaction resource, with the paypal-subscription-id element.

The request should contain only one transaction per unique paypal-subscription-id.

On the right is an example of a request with one PayPal subscription transaction.

For more information, see Merchant-managed PayPal subscriptions.

Create Batch Transaction with encrypted card details

Your PCI compliance requirements and API permission level may require that you send credit card data in encrypted format only. To do this, you'll need to include the encrypted-card-number and encrypted-security-code properties within the card-transaction resources in your request.

On the right is an example of a request with encrypted credit card numbers within each card-transaction resource.


Back to Top

API Explorer

To test out a call, enter the XML portion of the request below and then click Try it!
In order to get a successful response, you must enter a unique batch ID in the batch-id property.

Tip: Copy the XML portion from one of the example requests above, or use the XML code below as a starting point. You can enter different parameters and test credit card numbers to see how your test scenario would work. The request headers, including authorization, are already built in for you in this test area, so you should not include them here.

<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>
Language
Credentials
:
Click Try It! to start a request and see the response here!