PayPal

General information

A PayPal component with implementations of actions and triggers based on the Open Integration Hub (OIH) Standard.

Read the PayPal REST API documentation for more information.

Credentials

To use PayPal API you need to create an app in a developer account and use your Client ID and Secret.

To do this navigate to:

Dashboard  My Apps & Credentials  REST API apps

PayPal Rest API

You will also need to configure your credentials during flow configuration:

PayPal Credentials

Credentials configuration fields

Environment

A required option selection. Indicates which URL base needs to be used, Production (api.PayPal.com) or Sandbox (api.sandbox.PayPal.com).

Client ID

A required string setting. from app.

Secret

A required string setting. from app.

Triggers

Webhook trigger

Creates webhook subscriptions on the PayPal side and receives events to the flow.

Webhook trigger

Configuration fields

Webhook ID

A required string setting. The webhook ID becomes available after a webhook is created.

You must set an Internet-accessible URL configured to listen for incoming POST notification messages containing event information when creating the webhook.

To implement this mechanism, the following steps must be taken:

  1. Create a flow with a random id in the config field

  2. Publish flow, after which the webhook URL will become available.

  3. Copy the URL of the elastic.io webhook

  4. Create a webhook on the PayPal side with the URL generated in the previous step.

  5. Edit the flow and specify the webhook ID created in the previous step.

Output metadata

Data received in the request

Get new and updated objects polling

Polls PayPal API for new and updated objects.

Get New And Updated Objects Polling

Configuration fields

Object Type

A required dropdown setting. This currently only supports Disputes and Transactions objects.

Time stamp field to poll on

A required dropdown setting. Indicates just new items or new and modified items:

  • Created or Updated.

Output metadata

Output metadata is generated dynamically and depends on object type.

Known limitations

  • Transactions always use Created date to poll

  • It takes a maximum of three hours for executed transactions to appear in the list transactions call (this may be longer in sandbox).

Receive instant payment notification

Webhook trigger to receive Instant Payment Notification (IPN). IPN is a message service that automatically notifies merchants of events related to PayPal transactions.

You can test your trigger using the IPN simulator:

  1. Set your webhookURL to IPN handler URL field.

  2. Select any value of Transaction type.

  3. Set receiver_email to the same value as Expected Email Address.

  4. Click Send IPN.

Configuration fields

Expected Email Address

A required string setting.

Output metadata

All Transaction data (including success/fail)

Receive payment data transfer

Webhook trigger to receive a Payment Data Transfer (PDT) notification. PDT is a service that, once activated, can send transaction-related information immediately to merchants who are using PayPal payment buttons.

Configuration fields

Identity Token

A required string setting.

Output metadata

All Transaction data (including success/fail)

Actions

Create object

This action creates a PayPal object.

Create object

Configuration fields

Object Type

A dropdown required setting. For example Orders.

Input metadata

Inputs for request fields.

Output metadata

The object creation result, as reported by the system.

Update object

This action updates a PayPal object

Update Object

Configuration fields

Object Type

A dropdown required setting. For example Orders.

Input metadata

PayPal ID

A string required setting. The ID of the object. Other input fields depend on the selected object.

Output metadata

If the request succeeds, an empty object will be returned.

Make raw request

Executes custom request

Make Raw Request

Configuration fields

Don’t throw error on 404 Response

A optional boolean setting. This setting treats 404 HTTP responses not as error. The default is false.

Input metadata

URL

A string required setting. The path of the resource relative to the base URL.

Method

A required string setting. Declares the HTTP method to use in the request. Accepted values are GET, POST, PUT, PATCH, DELETE.

Request Body

A object optional setting. Body of the request to send

Output metadata

Status Code

A required number setting. The HTTP status code of the response.

HTTP headers

A required object setting. The HTTP headers of the response.

Response Body

An optional object setting. The HTTP response body.

Make a payment

Executes a request to make a new Payment with provided data. Creates a sale, an authorized payment to be captured later, or an order. To create a sale, authorization, or order, include the payment details in the JSON request body. Set the Intent to sale, authorize, or order.

Make a payment

Input Metadata

Intent

A required enum setting. The payment intent:

sale

Makes an immediate payment.

authorize

Authorizes a payment for capture later.

order

Creates an order.

Payer

A required object setting. The source of the funds for this payment. Payment method:

  • PayPal Wallet payment

  • bank direct debit.

The value of the payment_method must be PayPal.

Transactions

A required array setting. An array of objects that are payment-related transactions. The value for this input field should be formed as a JSON array of objects containing all the necessary data as objects. These objects are:

  • amount

  • description

  • custom

  • invoice_number

  • payment_options

  • soft_descriptor

  • item_list.

A transaction defines what the payment is for and who fulfills the payment. For update and execute payment calls, the transactions object accepts the amount object only.

Note To Payer

A required string setting. A free-form field that clients can use to send a note to the payer.

Redirect Urls

A required object setting. A set of redirect URLs that you provide for PayPal-based payments.

Output metadata

The object as reported by the system

Lookup object (at most one)

Action designed to lookup one object by a unique field.

Lookup Object (at most one)

Configuration fields

Object Type

A required dropdown selection. Indicates object type to find

Allow ID to be omitted

An optional checkbox. If selected, this setting makes the ID field optional (otherwise it is a required field).

Allow zero results

An optional checkbox. If selected, this setting emits the empty object {} if zero results are returned (otherwise typically an error would be thrown).

Input metadata

ID value

A string value. Depending on the value of Allow ID to be omitted this setting could be optional or required.

Output Metadata

The object, as reported by the system