postCreate PayPal Transaction

Definition

Documentation

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.

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:vaulted-shopper-idpaypal-transaction is returned with the paypal-url and order-id (see paypal-transaction)processing-infofraud-result-info

Basic Create PayPal Transaction

This example shows a basic Create PayPal Transaction request, containing the minimum required fields to process a single PayPal transaction. The request does not include any information about the shopper, so this may be a new shopper or a guest checkout. It does include the required fraud check info in the transaction-fraud-info resource.

Create PayPal Transaction with payer info

To perform a Create PayPal Transaction and send information about the shopper, you'll need to include the payer-info property within the alt-transaction resource in your request. In this property, you can send information such as the shopper's first and last name, email, phone number, and address. See payer-info.

Above is an example of a Create PayPal Transaction request with the shopper's first and last name sent in the payer-info property.

Create PayPal Transaction with vaulted shopper

To perform a Create PayPal Transaction with an existing vaulted shopper, you'll need to include the vaulted-shopper-id property within the alt-transaction resource in your request.

Important: If you set the 'no-shipping' property (in the paypal-transaction resource) to 0 or 2, then the shopper's shipping address will be retrieved from PayPal, and the vaulted shopper will be automatically updated with that shipping address.

Above is an example of a Create PayPal Transaction request with an existing vaulted shopper with the ID 20781033.

Create PayPal Transaction with Merchant Transaction ID and metadata

You may wish to assign your own ID to each transaction, for example in order to track the transactions in your own internal systems. To do this, you will need to include the merchant-transaction-id property within the alt-transaction resource in your request.

You can also send metadata for the transaction, such as a description of the item, or tax or shipping information. To do this, you will need to include the transaction-meta-data property (a container for meta-data key-value pairs) within the alt-transaction resource in your request.

Above is an example of a request that includes a Merchant Transaction ID (MTI), as well as metadata for the transaction, including state tax, city tax, and the shipping amount.

Create PayPal Transaction with transaction description

By default, the PayPal page will show the statement descriptor as the description of the product being purchased. If you prefer to show a different description, you can send it in the transaction-description element.

Above is an example of a Create PayPal Transaction request with the transaction-description.

Create PayPal Transaction with In-Context checkout

Create PayPal Transaction for initial subscription payment

If you are managing subscriptions yourself (or through a third party), you can use the PayPal payment method for subscription payments. In the initial subscription payment, include the recurring property in the paypal-transaction resource, and set the value to 1.

Create PayPal Transaction for recurring subscription payment

After you have processed an initial subscription payment using PayPal, you can then associate the recurring payments with the relevant subscription by including the paypal-subscription-id in the paypal-transaction resource.

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

API Explorer

To test out a call, enter the XML portion of the request below and then click Try it!

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