{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/batch-transactions","auth":"optional","examples":{"codes":[]},"method":"post","results":{"codes":[{"code":"","language":"text"}]},"settings":"","params":[]},"next":{"description":"","pages":[]},"title":"Create Batch Transaction","type":"endpoint","slug":"create-batch-transaction","excerpt":"","body":"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.\n\nThe 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. \n\nThe 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](doc:batch-processing-tutorial#section-example-batch-result).\n[block:callout]\n{\n \"type\": \"info\",\n \"title\": \"Transaction limit per batch\",\n \"body\": \"There is a limit of 2000 transactions per batch.\"\n}\n[/block]\n<a class=\"btn btn-success\" href=\"#section-api-explorer\" role=\"button\">Try it in the API Explorer</a>\n\n###Request Content\n`batch-transaction` *container* <span style=\"color:#F37500\">**required**</span>, contains the following properties (see [batch-transaction](doc:batch-transaction)):\n `batch-id` *string* <span style=\"color:#F37500\">**required**</span>\n `callback-url` *string* <span style=\"color:#F37500\">**required**</span>\n `card-transaction` *container* <span style=\"color:#F37500\">**required** for credit card transactions</span> (see [card-transaction](doc:card-transaction))\n `alt-transaction` *container* <span style=\"color:#F37500\">**required** for ACH/ECP, SEPA, or PayPal transactions</span> (see [alt-transaction](doc:alt-transaction))\n\n###Response Details\nIf successful, the response HTTP status code is 201 Created.\nNote that if an error occurs, the error format is slightly different from other error types. See [Batch transaction errors](doc:batch-errors).\nFor an example of the batch result that is sent to your callback URL after the transactions have been processed, see [Example Batch Result](doc:batch-processing-tutorial#section-example-batch-result).\n\n<hr>\n\n##Examples\n\n###Request Examples\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/batch-transactions \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<batch-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n <batch-id>567890</batch-id>\\n <callback-url>http://example.com/batch_callback</callback-url>\\n <card-transaction>\\n <card-transaction-type>AUTH_CAPTURE</card-transaction-type>\\n <merchant-transaction-id>566</merchant-transaction-id>\\n <amount>20.00</amount>\\n <currency>USD</currency>\\n <card-holder-info>\\n <first-name>Joe</first-name>\\n <last-name>Example</last-name>\\n </card-holder-info>\\n <credit-card>\\n <card-number>4263982640269299</card-number>\\n <expiration-month>02</expiration-month>\\n <expiration-year>2023</expiration-year>\\n </credit-card>\\n </card-transaction>\\n <card-transaction>\\n <card-transaction-type>AUTH_CAPTURE</card-transaction-type>\\n <merchant-transaction-id>567</merchant-transaction-id>\\n <amount>25.00</amount>\\n <currency>USD</currency>\\n <card-holder-info>\\n <first-name>Jane</first-name>\\n <last-name>Shopper</last-name>\\n </card-holder-info>\\n <credit-card>\\n <card-number>4111111111111111</card-number>\\n <expiration-month>07</expiration-month>\\n <expiration-year>2023</expiration-year>\\n </credit-card>\\n </card-transaction>\\n</batch-transaction>'\",\n \"language\": \"curl\",\n \"name\": \"Create Batch Transaction Request: basic\"\n },\n {\n \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/batch-transactions \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<batch-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n <batch-id>unique_0130076552988</batch-id>\\n <callback-url>http://sandbox.bluesnap.com/jsp/batch_callback.jsp</callback-url>\\n <card-transaction>\\n <card-transaction-type>AUTH_CAPTURE</card-transaction-type>\\n <merchant-transaction-id>566</merchant-transaction-id>\\n <soft-descriptor>DescTest txn1</soft-descriptor>\\n <amount>11.00</amount>\\n <currency>USD</currency>\\n <vaulted-shopper-id>19567060</vaulted-shopper-id>\\n </card-transaction>\\n <card-transaction>\\n <card-transaction-type>AUTH_CAPTURE</card-transaction-type>\\n <merchant-transaction-id>567</merchant-transaction-id>\\n <amount>11.00</amount>\\n <currency>USD</currency>\\n <vaulted-shopper-id>20773559</vaulted-shopper-id>\\n <credit-card>\\n <card-last-four-digits>9299</card-last-four-digits>\\n <card-type>VISA</card-type>\\n </credit-card>\\n </card-transaction>\\n</batch-transaction>'\",\n \"language\": \"curl\",\n \"name\": \"with vaulted shoppers\"\n },\n {\n \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/batch-transactions \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<batch-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n <batch-id>shachaf_014</batch-id>\\n <callback-url>http://sandbox.bluesnap.com/jsp/batch_callback.jsp</callback-url>\\n <alt-transaction>\\n <amount>100.00</amount>\\n <currency>USD</currency>\\n <paypal-transaction>\\n <paypal-subscription-id>1234567</paypal-subscription-id>\\n </paypal-transaction>\\n </alt-transaction>\\n</batch-transaction>'\",\n \"language\": \"curl\",\n \"name\": \"with PayPal recurring subscription payment\"\n },\n {\n \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/batch-transactions \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<batch-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n <batch-id>12345</batch-id>\\n <callback-url>http://example.com/batch_callback</callback-url>\\n <card-transaction>\\n <card-transaction-type>AUTH_CAPTURE</card-transaction-type>\\n <merchant-transaction-id>566</merchant-transaction-id>\\n <amount>20.00</amount>\\n <currency>USD</currency>\\n <card-holder-info>\\n <first-name>Joe</first-name>\\n <last-name>Example</last-name>\\n </card-holder-info>\\n <credit-card>\\n <encrypted-card-number>$bsjs_1_0_3$B23uuxq8drUwOYZm3wZi+Qm69V5GPEt8PEio+Edwcm8akczQSK7odgLQH/Au+VqOCsGspW1Q9mPyQIzGLSZLVToAQVfq5C1ld+2ogIIsDL32Hd6IojboLyVlYT1FvPQoDyz19K6N0CUHh5uk0kCLuHSUyjvoJH38ojHZifbJSm/7S5vAtiuC3BJt2z8k9nauQaAXkbyoAYwrS1yDpqOt2k2lGhKcmdQ4ImDR0RL8m8xig6sFrki9oqo3Mju/M5r7wXXVTf7TMtWiQbzdfREOxKUnviXJZpncdHqVjj5GvPYun2qgopKVKr8F5+yd19TVW2gvA1kXBkXonFL9159Gxg==$zckJgo2i8jXDiAHwVVHBKypXFnWqF2e+6luBkmtQQRKniDXyXaalRVKLtYscBaGd$W7Ojqk1Q2iOJVeGL39RAsZTtfup3f1deSzvxrvC9rXA=</encrypted-card-number>\\n <card-type>VISA</card-type>\\n <expiration-month>07</expiration-month>\\n <expiration-year>2016</expiration-year>\\n </card-transaction>\\n <card-transaction>\\n <card-transaction-type>AUTH_CAPTURE</card-transaction-type>\\n <merchant-transaction-id>567</merchant-transaction-id>\\n <amount>25.00</amount>\\n <currency>USD</currency>\\n <card-holder-info>\\n <first-name>Jane</first-name>\\n <last-name>Shopper</last-name>\\n </card-holder-info>\\n <credit-card>\\n <encrypted-card-number>$bsjs_1_0_3$B23uuxq8drUwOYZm3wZi+Qm69V5GPEt8PEio+Edwcm8akczQSK7odgLQH/Au+VqOCsGspW1Q9mPyQIzGLSZLVToAQVfq5C1ld+2ogIIsDL32Hd6IojboLyVlYT1FvPQoDyz19K6N0CUHh5uk0kCLuHSUyjvoJH38ojHZifbJSm/7S5vAtiuC3BJt2z8k9nauQaAXkbyoAYwrS1yDpqOt2k2lGhKcmdQ4ImDR0RL8m8xig6sFrki9oqo3Mju/M5r7wXXVTf7TMtWiQbzdfREOxKUnviXJZpncdHqVjj5GvPYun2qgopKVKr8F5+yd19TVW2gvA1kXBkXonFL9159Gxg==$zckJgo2i8jXDiAHwVVHBKypXFnWqF2e+6luBkmtQQRKniDXyXaalRVKLtYscBaGd$W7Ojqk1Q2iOJVeGL39RAsZTtfup3f1deSzvxrvC9rXA=</encrypted-card-number>\\n <card-type>VISA</card-type>\\n <expiration-month>07</expiration-month>\\n <expiration-year>2016</expiration-year>\\n </credit-card>\\n </card-transaction>\\n</batch-transaction>'\",\n \"language\": \"curl\",\n \"name\": \"with encrypted card details\"\n },\n {\n \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/batch-transactions \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<?xml version=\\\"1.0\\\"?>\\n<batch-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n <batch-id>567891</batch-id>\\n <callback-url>http://example.com/batch_callback</callback-url>\\n <card-transaction>\\n <card-transaction-type>AUTH_CAPTURE</card-transaction-type>\\n <merchant-transaction-id>566</merchant-transaction-id>\\n <soft-descriptor>DescTest txn1</soft-descriptor>\\n <amount>11.00</amount>\\n <currency>USD</currency>\\n <card-holder-info>\\n <first-name>test first name</first-name>\\n <last-name>test last name</last-name>\\n </card-holder-info>\\n <credit-card>\\n <card-number>4012888888881881</card-number>\\n <security-code>111</security-code>\\n <expiration-month>07</expiration-month>\\n <expiration-year>2023</expiration-year>\\n </credit-card>\\n </card-transaction>\\n <alt-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n <soft-descriptor>ABC COMPANY</soft-descriptor>\\n <amount>100.00</amount>\\n <currency>USD</currency>\\n <payer-info>\\n <first-name>John</first-name>\\n <last-name>Doe</last-name>\\n <zip>12345</zip>\\n <phone>1234567890</phone>\\n </payer-info>\\n <ecp-transaction>\\n <account-number>4099999992</account-number>\\n <routing-number>011075150</routing-number>\\n <account-type>CONSUMER_CHECKING</account-type>\\n </ecp-transaction>\\n <authorized-by-shopper>true</authorized-by-shopper>\\n </alt-transaction>\\n <alt-transaction>\\n\\t<soft-descriptor>SepaPapi</soft-descriptor>\\n\\t<amount>20</amount>\\n\\t<currency>EUR</currency>\\n\\t<payer-info>\\n\\t\\t<first-name>John</first-name>\\n\\t\\t<last-name>Doe</last-name>\\n\\t\\t<phone>23123133213</phone>\\n\\t\\t<zip>45353434</zip>\\n\\t\\t<country>IT</country>\\n\\t\\t<state>ca</state>\\n\\t\\t<city>london</city>\\n\\t\\t<address>blue lane 21</address>\\n\\t</payer-info>\\n\\t<sepa-direct-debit-transaction>\\n\\t\\t<iban>DE09100100101234567891</iban>\\n\\t\\t<bic>PBNKDEFFXXX</bic>\\n\\t</sepa-direct-debit-transaction>\\n\\t<authorized-by-shopper>true</authorized-by-shopper>\\n</alt-transaction>\\n</batch-transaction>\",\n \"language\": \"curl\",\n \"name\": \"with multiple alt types\"\n },\n {\n \"code\": \"curl -v -X POST https://sandbox.bluesnap.com/services/2/batch-transactions \\\\\\n-H 'Content-Type: application/xml' \\\\\\n-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \\\\\\n-d '\\n<batch-transaction\\n xmlns=\\\"http://ws.plimus.com\\\">\\n <batch-id>PKB0034</batch-id>\\n <callback-url>https://pavelk-lap.bluesnap.int:7000/d</callback-url>\\n <card-transaction\\n xmlns=\\\"http://ws.plimus.com\\\">\\n <card-transaction-type>CAPTURE</card-transaction-type>\\n <transaction-id>38591012</transaction-id>\\n <merchant-transaction-id>1</merchant-transaction-id>\\n </card-transaction>\\n</batch-transaction>\",\n \"language\": \"curl\",\n \"name\": \"with CAPTURE card-transaction-type\"\n }\n ]\n}\n[/block]\n###Response Example\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"HTTP/ 1.1 201 Created\",\n \"language\": \"http\",\n \"name\": \"Create Batch Transaction Response: 201 Created\"\n }\n ]\n}\n[/block]\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>\n\n<hr>\n\n##Example Descriptions\nFor details about the above examples, see:\n * [Basic Create Batch Transaction](create-batch-transaction#section-basic-create-batch-transaction)\n * [Create Batch Transaction with vaulted shoppers](create-batch-transaction#section-create-batch-transaction-with-vaulted-shoppers)\n * [Create Batch Transaction with PayPal recurring subscription payment](create-batch-transaction#section-create-batch-transaction-with-paypal-recurring-subscription-payment)\n * [Create Batch Transaction with encrypted card details](create-batch-transaction#section-create-batch-transaction-with-encrypted-card-details)\n \n###Basic Create Batch Transaction\nThis example shows a basic Create Batch Transaction request, containing two `card-transaction` resources with the required fields to process a credit card payment. \n\nNote that within each `card-transaction` resource you can use any of the options available for a single [Auth Capture](doc:auth-capture) or [Create PayPal Transaction](doc:create-paypal-transaction) (recurring subscription payment only) request, such as using a vaulted shopper, sending encrypted card information, including metadata, and so on. \n\n###Create Batch Transaction with vaulted shoppers\nTo 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.\n\nRemember to include the card's last four digits if multiple cards are saved for the shopper.\n\nAbove is an example of a request with a vaulted shopper ID within each `card-transaction` resource.\n\n###Create Batch Transaction with PayPal recurring subscription payment\nTo 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.\n\nThe request should contain only one transaction per unique `paypal-subscription-id`.\n\nOn the right is an example of a request with one PayPal subscription transaction.\n\nFor more information, see [Merchant-managed PayPal subscriptions](doc:subscription-management#section-processing-merchant-managed-paypal-subscription-payments).\n\n###Create Batch Transaction with encrypted card details\nYour 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.\n\nOn the right is an example of a request with encrypted credit card numbers within each `card-transaction` resource.\n\n<br>\n<a class=\"btn btn-primary\" href=\"#\" role=\"button\">Back to Top</a>\n\n<hr>\n\n##API Explorer\nTo test out a call, enter the XML portion of the request below and then click **Try it!**\nIn order to get a successful response, you must enter a unique batch ID in the `batch-id` property.\n\n**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.*\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"<batch-transaction xmlns=\\\"http://ws.plimus.com\\\">\\n <batch-id>567890</batch-id>\\n <callback-url>http://example.com/batch_callback</callback-url>\\n <card-transaction>\\n <card-transaction-type>AUTH_CAPTURE</card-transaction-type>\\n <merchant-transaction-id>566</merchant-transaction-id>\\n <amount>20.00</amount>\\n <currency>USD</currency>\\n <card-holder-info>\\n <first-name>Joe</first-name>\\n <last-name>Example</last-name>\\n </card-holder-info>\\n <credit-card>\\n <card-number>4263982640269299</card-number>\\n <expiration-month>02</expiration-month>\\n <expiration-year>2023</expiration-year>\\n </credit-card>\\n </card-transaction>\\n <card-transaction>\\n <card-transaction-type>AUTH_CAPTURE</card-transaction-type>\\n <merchant-transaction-id>567</merchant-transaction-id>\\n <amount>25.00</amount>\\n <currency>USD</currency>\\n <card-holder-info>\\n <first-name>Jane</first-name>\\n <last-name>Shopper</last-name>\\n </card-holder-info>\\n <credit-card>\\n <card-number>4111111111111111</card-number>\\n <expiration-month>07</expiration-month>\\n <expiration-year>2023</expiration-year>\\n </credit-card>\\n </card-transaction>\\n</batch-transaction>\",\n \"language\": \"xml\"\n }\n ]\n}\n[/block]","updates":[],"order":0,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"61a5208deadb750070998ee1","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Batch Transactions","slug":"batch-payment-transaction-service","order":8,"from_sync":false,"reference":true,"_id":"61a5208deadb750070998e8c","version":"61a5208deadb750070998f48","project":"57336fd5a6a9c40e00e13a0b","createdAt":"2015-10-19T18:30:57.575Z","__v":0},"project":"57336fd5a6a9c40e00e13a0b","user":"560d5913af97231900938124","parentDoc":null,"version":{"version":"8976-XML","version_clean":"8976.0.0-XML","codename":"3.40 Release","is_stable":false,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["61a5208deadb750070998e87","61a5208deadb750070998e88","61a5208deadb750070998e89","61a5208deadb750070998e8a","61a5208deadb750070998e8b","61a5208deadb750070998e8c","61a5208deadb750070998e8d","61a5208deadb750070998e8e","61a5208deadb750070998e8f","61a5208deadb750070998e90","61a5208deadb750070998e91","61a5208deadb750070998e92","61a5208deadb750070998e93","61a5208deadb750070998e94","61a5208deadb750070998e95","61a5208deadb750070998e96","61a5208deadb750070998e97","61a5208deadb750070998e98","61a5208deadb750070998e99","61a5208deadb750070998e9a"],"_id":"61a5208deadb750070998f48","project":"57336fd5a6a9c40e00e13a0b","__v":0,"forked_from":"60fed269718a45001c25b4a0","createdAt":"2018-04-24T15:24:22.608Z","releaseDate":"2018-04-24T15:24:22.608Z"},"createdAt":"2016-01-21T19:34:10.183Z","githubsync":"","__v":0}
postCreate Batch Transaction
Definition
Documentation
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):
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>
HTTP/ 1.1 201 Created
Example Descriptions
For details about the above examples, see:
- Basic Create Batch Transaction
- Create Batch Transaction with vaulted shoppers
- Create Batch Transaction with PayPal recurring subscription payment
- Create Batch Transaction with encrypted card details
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.
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>