The Create PayPal Transaction request performs a transaction (purchase) using the PayPal payment method.
Getting started with PayPal in BlueSnap
Go to the PayPal Guide for a walkthrough of implementing the PayPal payment method via the API. To use PayPal, you will need to first connect your PayPal and BlueSnap account, as described in the guide.
Request Content
Important
The API Explorer Try It! feature does not currently send XML requests to our sandbox environment.
For request and response examples, refer to the Examples section.
alt-transaction
container required, contains the following properties (see alt-transaction):
Property | Type | Required |
---|---|---|
amount | decimal | required |
currency | string | required |
merchant-transaction-id | string | optional |
payer-info | container | optional (see payer-info) |
paypal-transaction | container | required (see paypal-transaction) |
product-description | string | optional |
soft-descriptor | string | optional |
tax-reference | string | optional |
transaction-description | string | optional |
transaction-meta-data | container | optional (see transaction-meta-data) |
vaulted-shopper-id | integer | optional |
Response Details
If successful, the response HTTP status code is 200 OK.
The response contains an alt-transaction
resource (see alt-transaction) with the request properties plus these additions:
Property | Notes |
---|---|
fraud-result-info | |
paypal-transaction | is returned with the paypal-url and order-id (see paypal-transaction) |
processing-info | |
vaulted-shopper-id |
Examples
Request Examples
curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
<soft-descriptor>ABC COMPANY</soft-descriptor>
<amount>100.00</amount>
<currency>USD</currency>
<paypal-transaction>
<return-url>http://www.returnURL.com</return-url>
<cancel-url>http://www.cancelURL.com</cancel-url>
</paypal-transaction>
</alt-transaction>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<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>
</payer-info>
<paypal-transaction>
<return-url>http://www.returnURL.com</return-url>
<cancel-url>http://www.cancelURL.com</cancel-url>
</paypal-transaction>
</alt-transaction>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
<soft-descriptor>ABC COMPANY</soft-descriptor>
<amount>100.00</amount>
<currency>USD</currency>
<vaulted-shopper-id>20781033</vaulted-shopper-id>
<paypal-transaction>
<return-url>http://www.returnURL.com</return-url>
<cancel-url>http://www.cancelURL.com</cancel-url>
</paypal-transaction>
</alt-transaction>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
<merchant-transaction-id>3</merchant-transaction-id>
<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>
</payer-info>
<paypal-transaction>
<return-url>http://www.returnURL.com</return-url>
<cancel-url>http://www.cancelURL.com</cancel-url>
</paypal-transaction>
<transaction-meta-data>
<meta-data>
<meta-key>stateTaxAmount</meta-key>
<meta-value>20.00</meta-value>
<meta-description>State Tax Amount</meta-description>
</meta-data>
<meta-data>
<meta-key>cityTaxAmount</meta-key>
<meta-value>20.00</meta-value>
<meta-description>City Tax Amount</meta-description>
</meta-data>
<meta-data>
<meta-key>shippingAmount</meta-key>
<meta-value>10.00</meta-value>
<meta-description>Shipping Amount</meta-description>
</meta-data>
</transaction-meta-data>
</alt-transaction>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<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>
</payer-info>
<paypal-transaction>
<return-url>http://www.returnURL.com</return-url>
<cancel-url>http://www.cancelURL.com</cancel-url>
</paypal-transaction>
<transaction-description>Product description</transaction-description>
</alt-transaction>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
<soft-descriptor>ABC COMPANY</soft-descriptor>
<amount>100.00</amount>
<currency>USD</currency>
<paypal-transaction>
<return-url>http://www.returnURL.com</return-url>
<cancel-url>http://www.cancelURL.com</cancel-url>
<in-context>true</in-context>
</paypal-transaction>
</alt-transaction>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
<merchant-transaction-id>A3bn43</merchant-transaction-id>
<soft-descriptor>ABC COMPANY</soft-descriptor>
<amount>100.00</amount>
<currency>USD</currency>
<paypal-transaction>
<return-url>http://www.returnURL.com</return-url>
<cancel-url>http://www.cancelURL.com</cancel-url>
<recurring>1</recurring>
</paypal-transaction>
</alt-transaction>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
<amount>100.00</amount>
<currency>USD</currency>
<paypal-transaction>
<paypal-subscription-id>1234567</paypal-subscription-id>
</paypal-transaction>
</alt-transaction>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<alt-transaction xmlns="http://ws.plimus.com">
<merchant-transaction-id>testtransaction1</merchant-transaction-id>
<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>
</payer-info>
<paypal-transaction>
<transaction-type>AUTH_ONLY</transaction-type>
<return-url>http://www.returnURL.com</return-url>
<cancel-url>http://www.cancelURL.com</cancel-url>
<max-amount>120.00</max-amount>
</paypal-transaction>
</alt-transaction>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<alt-transaction xmlns="http://ws.plimus.com">
<merchant-transaction-id>testtransaction1</merchant-transaction-id>
<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>
</payer-info>
<paypal-transaction>
<transaction-type>SET_ORDER</transaction-type>
<return-url>http://www.returnURL.com</return-url>
<cancel-url>http://www.cancelURL.com</cancel-url>
<max-amount>120.00</max-amount>
</paypal-transaction>
</alt-transaction>'
curl -v -X POST https://sandbox.bluesnap.com/services/2/alt-transactions/ \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
<soft-descriptor>ABC COMPANY</soft-descriptor>
<amount>120.50</amount>
<currency>USD</currency>
<tax-reference>048deff0-a285-47e1-bc39-42f79bf0095b</tax-reference>
<payer-info>
<first-name>John</first-name>
<last-name>Doe</last-name>
</payer-info>
<paypal-transaction>
<return-url>http://www.returnURL.com</return-url>
<cancel-url>http://www.cancelURL.com</cancel-url>
</paypal-transaction>
</alt-transaction>'
Response Examples
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<alt-transaction xmlns="http://ws.plimus.com">
<soft-descriptor>ABC COMPANY</soft-descriptor>
<amount>100.00</amount>
<currency>USD</currency>
<vaulted-shopper-id>1234</vaulted-shopper-id>
<paypal-transaction>
<paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-3SH38585JS3540821</paypal-url>
<order-id>3979635</order-id>
</paypal-transaction>
<processing-info>
<processing-status>PENDING</processing-status>
</processing-info>
</alt-transaction>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<alt-transaction xmlns="http://ws.plimus.com">
<soft-descriptor>ABC COMPANY</soft-descriptor>
<amount>100.00</amount>
<currency>USD</currency>
<vaulted-shopper-id>1234</vaulted-shopper-id>
<payer-info>
<first-name>John</first-name>
<last-name>Doe</last-name>
</payer-info>
<paypal-transaction>
<paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-0SM33181BF217002W</paypal-url>
<order-id>3979589</order-id>
</paypal-transaction>
<processing-info>
<processing-status>PENDING</processing-status>
</processing-info>
</alt-transaction>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<alt-transaction xmlns="http://ws.plimus.com">
<soft-descriptor>ABC COMPANY</soft-descriptor>
<amount>100.00</amount>
<currency>USD</currency>
<vaulted-shopper-id>20781033</vaulted-shopper-id>
<paypal-transaction>
<paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-9GY47037JY601890L</paypal-url>
<order-id>3979591</order-id>
</paypal-transaction>
<processing-info>
<processing-status>PENDING</processing-status>
</processing-info>
</alt-transaction>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<alt-transaction xmlns="http://ws.plimus.com">
<merchant-transaction-id>3</merchant-transaction-id>
<soft-descriptor>ABC COMPANY</soft-descriptor>
<amount>100.00</amount>
<currency>USD</currency>
<vaulted-shopper-id>1234</vaulted-shopper-id>
<payer-info>
<first-name>John</first-name>
<last-name>Doe</last-name>
</payer-info>
<paypal-transaction>
<paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-7GY45732D90677524</paypal-url>
<order-id>3979657</order-id>
</paypal-transaction>
<transaction-meta-data>
<meta-data>
<meta-key>stateTaxAmount</meta-key>
<meta-value>20.00</meta-value>
<meta-description>State Tax Amount</meta-description>
</meta-data>
<meta-data>
<meta-key>cityTaxAmount</meta-key>
<meta-value>20.00</meta-value>
<meta-description>City Tax Amount</meta-description>
</meta-data>
<meta-data>
<meta-key>shippingAmount</meta-key>
<meta-value>10.00</meta-value>
<meta-description>Shipping Amount</meta-description>
</meta-data>
</transaction-meta-data>
<processing-info>
<processing-status>PENDING</processing-status>
</processing-info>
</alt-transaction>
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
<soft-descriptor>ABC COMPANY</soft-descriptor>
<amount>100.00</amount>
<currency>USD</currency>
<vaulted-shopper-id>1234</vaulted-shopper-id>
<payer-info>
<first-name>John</first-name>
<last-name>Doe</last-name>
</payer-info>
<paypal-transaction>
<paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-0SM33181BF217002W</paypal-url>
<order-id>3979589</order-id>
</paypal-transaction>
<processing-info>
<processing-status>PENDING</processing-status>
</processing-info>
</alt-transaction>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<alt-transaction xmlns="http://ws.plimus.com">
<soft-descriptor>ABC COMPANY</soft-descriptor>
<amount>100.00</amount>
<currency>USD</currency>
<vaulted-shopper-id>1234</vaulted-shopper-id>
<paypal-transaction>
<paypal-url>https://www.sandbox.paypal.com/checkoutnow?token=EC-4UU43831F40425709</paypal-url>
<order-id>3979635</order-id>
<in-context>true</in-context>
</paypal-transaction>
<processing-info>
<processing-status>PENDING</processing-status>
</processing-info>
</alt-transaction>
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
<soft-descriptor>ABC COMPANY</soft-descriptor>
<amount>100.00</amount>
<currency>USD</currency>
<vaulted-shopper-id>1234</vaulted-shopper-id>
<paypal-transaction>
<paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout</paypal-url>
<order-id>980111</order-id>
</paypal-transaction>
<processing-info>
<processing-status>PENDING</processing-status>
</processing-info>
</alt-transaction>
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
<transaction-id>38500786</transaction-id>
<amount>100.00</amount>
<currency>USD</currency>
<transaction-approval-date>10/01/2020</transaction-approval-date>
<transaction-approval-time>10:19:21</transaction-approval-time>
<vaulted-shopper-id>1234</vaulted-shopper-id>
<paypal-transaction>
<paypal-subscription-id>1234567</paypal-subscription-id>
</paypal-transaction>
<processing-info>
<processing-status>SUCCESS</processing-status>
</processing-info>
</alt-transaction>
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
<merchant-transaction-id>A3bn43</merchant-transaction-id>
<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>
</payer-info>
<vaulted-shopper-id>19587618</vaulted-shopper-id>
<paypal-transaction>
<paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-2FK36938XP960042T</paypal-url>
<order-id>4006145</order-id>
</paypal-transaction>
<processing-info>
<processing-status>PENDING</processing-status>
</processing-info>
</alt-transaction>
<?xml version="1.0" encoding="UTF-8"?>
<alt-transaction xmlns="http://ws.plimus.com">
<merchant-transaction-id>A3bn43</merchant-transaction-id>
<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>
</payer-info>
<vaulted-shopper-id>19587618</vaulted-shopper-id>
<paypal-transaction>
<paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-2FK36938XP960042T</paypal-url>
<order-id>4006145</order-id>
</paypal-transaction>
<processing-info>
<processing-status>PENDING</processing-status>
</processing-info>
</alt-transaction>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<alt-transaction xmlns="http://ws.plimus.com">
<soft-descriptor>ABC COMPANY</soft-descriptor>
<amount>100.00</amount>
<currency>USD</currency>
<tax-reference>048deff0-a285-47e1-bc39-42f79bf0095b</tax-reference>
<vaulted-shopper-id>1234</vaulted-shopper-id>
<payer-info>
<first-name>John</first-name>
<last-name>Doe</last-name>
</payer-info>
<paypal-transaction>
<paypal-url>https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&token=EC-0SM33181BF217002W</paypal-url>
<order-id>3979589</order-id>
</paypal-transaction>
<processing-info>
<processing-status>PENDING</processing-status>
</processing-info>
</alt-transaction>
How to get the subscription ID
You can obtain the subscription ID in two ways:
- In the
subscriptionId
field in the Charge IPN that is sent once the initial payment is processed.
or- By sending a Retrieve PayPal Transaction request once the payment has been processed.
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.