Create PayPal Transaction

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.

alt-transaction container    required, contains the following properties (see alt-transaction):

PropertyTypeRequired
amountdecimalrequired
currencystringrequired
merchant-transaction-idstringoptional
payer-infocontaineroptional (see payer-info)
paypal-transactioncontainerrequired (see paypal-transaction)
product-descriptionstringoptional
soft-descriptorstringoptional
tax-referencestringoptional
transaction-descriptionstringoptional
transaction-meta-datacontaineroptional (see transaction-meta-data)
vaulted-shopper-idintegeroptional

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:

PropertyNotes
fraud-result-info
paypal-transactionis returned with the paypal-url and order-id (see paypal-transaction)
processing-info
vaulted-shopper-id

Back to Top


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&amp;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&amp;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.