# PayPal

> Accept payments, manage catalog products, and automate billing with PayPal.

App · Payments & Billing · 6 actions · 1 trigger. Web page: https://docs.lodol.com/docs/integrations/paypal

## Triggers

Start a workflow when something happens in PayPal. See [how triggers work](https://docs.lodol.com/docs/concepts/triggers.md).

### PayPal New Payment

Triggers when a new payment is received in PayPal

**Filters**: Narrow which events start a run.

- `status`: Only run for payments with this PayPal status code: S for completed payments, P pending, V reversed, D denied. Leave empty to run for every payment.

**Event fields**: What a run starts with. Later steps read each field with an @ reference.

- `transaction_id` (text)
- `transaction_status` (text)
- `transaction_amount` (text)
- `transaction_currency` (text)
- `transaction_date` (text)
- `payer_email` (text)
- `payer_name` (text)

## Actions

### Capture a PayPal order

Collect (capture) the payment for an approved PayPal order.

**Inputs**

- Order ID (`order_id`, text, required): The ID of the order to collect payment for

**Outputs**: PayPal capture result object returned by the PayPal API containing payment capture details.

**Example output**

```json
{}
```

### Create a PayPal billing plan

Create a recurring billing plan for a PayPal product.

**Inputs**

- Product ID (`product_id`, text, required): The ID of the PayPal product this plan is for
- Name (`name`, text, required): Plan name
- Interval unit (`interval_unit`, text, required): How often to bill, such as DAY, WEEK, MONTH, or YEAR
- Interval count (`interval_count`, number, required): How many units between each charge. For example, 3 with MONTH bills every 3 months.
- Currency (`currency`, text, required): Billing currency
- Amount (`amount`, number, required): Recurring charge amount

**Outputs**: PayPal billing plan object returned by the PayPal API containing plan configuration details.

**Example output**

```json
{}
```

### Create a PayPal order

Create a PayPal checkout order ready for buyer approval.

**Inputs**

- Amount (`amount`, number, required): Order amount
- Currency (`currency`, text, required): Currency code (e.g. USD)
- Description (`description`, text): Order description

**Outputs**: PayPal order object returned by the PayPal API containing order details and approval links.

**Example output**

```json
{}
```

### Create a PayPal product

Add a product to your PayPal catalog so it can be used in billing plans.

**Inputs**

- Name (`name`, text, required): Product name
- Description (`description`, text): Product description
- Category (`category`, text): Product category, for example SOFTWARE

**Outputs**: PayPal product object returned by the PayPal API containing product details.

**Example output**

```json
{}
```

### Get PayPal order details

Look up the current status and details of a PayPal order.

**Inputs**

- Order ID (`order_id`, text, required): The ID of the order to look up

**Outputs**: PayPal order object returned by the PayPal API with current order state and details.

**Example output**

```json
{}
```

### Refund a PayPal payment

Issue a partial or full refund for a captured PayPal payment.

**Inputs**

- Capture ID (`capture_id`, text, required): The ID of the captured payment to refund
- Amount (`amount`, number): Amount to refund. Leave blank to refund the full amount.
- Currency (`currency`, text): Currency code for the refund (e.g. USD). Required when you enter an amount.

**Outputs**: PayPal refund object returned by the PayPal API containing refund status and details.

**Example output**

```json
{}
```
