# Stripe

> Accept payments and automate billing workflows with Stripe.

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

## Triggers

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

### New Stripe payment

Runs when a new payment is created in Stripe.

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

- `status`: Only run for payments in this Stripe status, such as succeeded. Leave empty to run for every payment, including ones still waiting for the customer to pay.

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

- `payment_intent_id` (text)
- `status` (text)
- `amount` (number)
- `currency` (text)
- `created` (number)
- `customer` (text)
- `description` (text)

## Actions

### Confirm a Stripe payment

Complete a payment by confirming it with a payment method.

**Inputs**

- Payment ID (`payment_intent_id`, text, required): The ID of the Stripe payment to confirm.
- Payment method (`payment_method`, text, required): The ID of the payment method to charge, for example pm_card_visa in test mode.

**Outputs**: Stripe payment intent object with status updated to 'succeeded'.

**Example output**

```json
{
  "id": "pi_123",
  "status": "succeeded"
}
```

### Create a Stripe customer

Create a new Stripe customer with contact details.

**Inputs**

- Email (`email`, text, required): Customer email
- Name (`name`, text): Customer name
- Description (`description`, text): Customer description
- Phone (`phone`, text): Customer phone number

**Outputs**: Stripe customer object returned by the Stripe API containing customer details.

**Example output**

```json
{
  "email": "customer@example.com",
  "id": "cus_123",
  "name": "Example Customer"
}
```

### Create a Stripe payment

Set up a payment to charge a customer a custom amount.

**Inputs**

- Amount (`amount`, number, required): The amount to charge, in the smallest currency unit, for example cents for USD (500 means $5.00).
- Currency (`currency`, text, required): The three-letter currency code, for example usd.
- Customer ID (`customer_id`, text): The ID of a customer to link this payment to (optional).
- Description (`description`, text): A short note describing what the payment is for.

**Outputs**: Stripe payment intent object returned by the Stripe API containing payment details.

**Example output**

```json
{
  "amount": 500,
  "currency": "usd",
  "id": "pi_123"
}
```

### Create a Stripe payment link

Generate a payment link for a price.

**Inputs**

- Price ID (`price_id`, text, required): Stripe price ID
- Quantity (`quantity`, number): Quantity to purchase

**Outputs**: Stripe payment link object returned by the Stripe API containing the generated link URL.

**Example output**

```json
{
  "id": "plink_123",
  "url": "https://pay.stripe.com/test"
}
```

### Create a Stripe price

Create a one-time or recurring price for a product.

**Inputs**

- Product ID (`product_id`, text, required): Stripe product ID
- Price amount (`unit_amount`, number, required): The price in the smallest currency unit, for example cents for USD (500 means $5.00).
- Currency (`currency`, text, required): The three-letter currency code, for example usd.
- Billing interval (`interval`, text): How often the customer is billed: day, week, month, or year.
- Number of intervals (`interval_count`, number): The number of billing intervals between charges. For example, 3 with a monthly interval charges every 3 months.

**Outputs**: Stripe price object returned by the Stripe API containing pricing details.

**Example output**

```json
{
  "currency": "usd",
  "id": "price_123",
  "unit_amount": 500
}
```

### Create a Stripe product

Create a product to sell with Stripe.

**Inputs**

- Name (`name`, text, required): Product name
- Description (`description`, text): Product description

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

**Example output**

```json
{
  "id": "prod_123",
  "name": "Example Product"
}
```

### List Stripe customers

List your most recent Stripe customers.

**Inputs**

- Limit (`limit`, number): Maximum customers to return. Default: `10`.

**Outputs**: Array of Stripe customer objects returned by the Stripe API.

**Example output**

```json
[
  {
    "email": "customer@example.com",
    "id": "cus_123"
  },
  {
    "email": "other@example.com",
    "id": "cus_124"
  }
]
```

### Refund a Stripe payment

Refund a payment, in full or in part.

**Inputs**

- Payment ID (`payment_intent_id`, text, required): The ID of the Stripe payment to refund.
- Amount (`amount`, number): The amount to refund, in the smallest currency unit, for example cents for USD (200 means $2.00). Leave blank to refund the full payment.

**Outputs**: Stripe refund object returned by the Stripe API containing refund details.

**Example output**

```json
{
  "amount": 200,
  "id": "re_123"
}
```

### Retrieve a Stripe customer

Look up a Stripe customer by their ID. Fails the step when the ID is empty, as it is for a guest checkout (a payment with no customer), so look up only payments that have a customer.

**Inputs**

- Customer ID (`customer_id`, text, required): Stripe customer ID

**Outputs**: Stripe customer object returned by the Stripe API for the requested customer ID.

**Example output**

```json
{
  "email": "customer@example.com",
  "id": "cus_123"
}
```
