Lodol Docs

Stripe

API actions for the Stripe integration.

Stripe

Accept payments and automate billing workflows with Stripe.


Confirm a Stripe payment

Complete a payment by confirming it with a payment method.

Parameters

ParameterTypeRequiredDescription
payment_intent_idstringYesThe ID of the Stripe payment to confirm.
payment_methodstringYesThe ID of the payment method to charge, for example pm_card_visa in test mode.

Response

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

Create a Stripe customer

Create a new Stripe customer with contact details.

Parameters

ParameterTypeRequiredDescription
emailstringYesCustomer email
namestringNoCustomer name
descriptionstringNoCustomer description
phonestringNoCustomer phone number

Response

{
  "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.

Parameters

ParameterTypeRequiredDescription
amountnumberYesThe amount to charge, in the smallest currency unit, for example cents for USD (500 means $5.00).
currencystringYesThe three-letter currency code, for example usd.
customer_idstringNoThe ID of a customer to link this payment to (optional).
descriptionstringNoA short note describing what the payment is for.

Response

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

Generate a payment link for a price.

Parameters

ParameterTypeRequiredDescription
price_idstringYesStripe price ID
quantitynumberNoQuantity to purchase

Response

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

Create a Stripe price

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

Parameters

ParameterTypeRequiredDescription
product_idstringYesStripe product ID
unit_amountnumberYesThe price in the smallest currency unit, for example cents for USD (500 means $5.00).
currencystringYesThe three-letter currency code, for example usd.
intervalstringNoHow often the customer is billed: day, week, month, or year.
interval_countnumberNoThe number of billing intervals between charges. For example, 3 with a monthly interval charges every 3 months.

Response

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

Create a Stripe product

Create a product to sell with Stripe.

Parameters

ParameterTypeRequiredDescription
namestringYesProduct name
descriptionstringNoProduct description

Response

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

List Stripe customers

List your most recent Stripe customers.

Parameters

ParameterTypeRequiredDescription
limitnumberNoMaximum customers to return

Response

[
  {
    "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.

Parameters

ParameterTypeRequiredDescription
payment_intent_idstringYesThe ID of the Stripe payment to refund.
amountnumberNoThe amount to refund, in the smallest currency unit, for example cents for USD (200 means $2.00). Leave blank to refund the full payment.

Response

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

Retrieve a Stripe customer

Look up a Stripe customer by their ID.

Parameters

ParameterTypeRequiredDescription
customer_idstringYesStripe customer ID

Response

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

On this page