Loopfour
Integrations

Stripe actions

Reference for the Stripe actions: how the connection works, each action id and what it does, the step settings, outputs and a complete example.

The Stripe block runs Stripe API calls from a workflow step. For the plain-language guide, see Stripe.

When to use it

Use it to create and send invoices, issue credit notes and refunds, manage customers, products, prices and subscriptions, and read payments, balances and balance transactions. Stripe has no Studio trigger block. A developer can configure a generic webhook trigger for Stripe Connect events tied to a connected account; see Webhook trigger. A schedule, API call, email or another system's event can also start the workflow.

Connection

  • Provider id: stripe.
  • Two ways to connect, chosen in Studio's connect dialog or with authVariant when you start a connect session: oauth (Stripe Connect, the default) and api_key (a Stripe restricted key). Both produce the same kind of connection, and every action works with either.
  • A reconnect keeps the method the account was first connected with.
  • Pin an account with config.connection (a connection id). Without it, the step uses the company's default Stripe connection. A pinned connection that cannot be used stops the run.

Actions

Each step names one action as stripe.<operation>. The table lists every action the block registers, in the order Studio shows them.

Action idStudio labelWhat it does
stripe.getCustomerGet CustomerRetrieve a customer by id.
stripe.createCustomerCreate CustomerCreate a customer. invoicePrefix sets the prefix Stripe uses to number this customer's invoices.
stripe.updateCustomerUpdate CustomerUpdate a customer's email, name, description or metadata.
stripe.listCustomersList CustomersList Customers with optional filters.
stripe.createInvoiceCreate InvoiceCreate an invoice for a customer. collectionMethod defaults to charge_automatically and autoAdvance to true.
stripe.getInvoiceGet InvoiceRetrieve an invoice by id.
stripe.listInvoicesList InvoicesList Invoices with optional filters.
stripe.finalizeInvoiceFinalize InvoiceFinalize a draft invoice.
stripe.sendInvoiceSend InvoiceEmail a finalized invoice to the customer.
stripe.voidInvoiceVoid InvoiceVoid a finalized invoice.
stripe.deleteInvoiceDelete Draft InvoicePermanently delete a DRAFT invoice. Stripe refuses any other status; void a finalized invoice instead.
stripe.updateInvoiceMetadataUpdate Invoice MetadataSet or clear metadata keys on an invoice. Never finalizes, sends, voids or changes amounts.
stripe.createInvoiceItemCreate Invoice ItemAdd a line to a draft invoice, by price, by product and amount, or by amount, with an optional discount and tax rates.
stripe.listInvoiceLineItemsList Invoice Line ItemsList one page of an invoice's line items; page with startingAfter while has_more.
stripe.previewCreditNotePreview Credit NotePreview a credit note without creating it: per-line amounts, tax and totals Stripe would credit.
stripe.createCreditNoteCreate Credit NoteIssue a credit note against a finalized invoice, crediting invoice lines by quantity or amount.
stripe.createProductCreate ProductCreate a product.
stripe.searchProductsSearch ProductsSearch products with Stripe search syntax.
stripe.listPricesList PricesList prices, optionally filtered by product, active flag, type, currency and lookup keys.
stripe.createPriceCreate PriceCreate a one-time or recurring price for an existing product, priced by unit_amount_decimal.
stripe.listCouponsList CouponsList one page of coupons; page with startingAfter while has_more.
stripe.createCouponCreate CouponCreate a percentage or amount coupon; a fixed couponId fails with resource_already_exists when taken.
stripe.listTaxRatesList Tax RatesList tax rates, optionally only active or inclusive ones.
stripe.createTaxRateCreate Tax RateCreate a tax rate.
stripe.createPaymentIntentCreate Payment IntentCreate a payment intent for an amount and currency.
stripe.getPaymentIntentGet Payment IntentRetrieve a payment intent by id.
stripe.listPaymentIntentsList Payment IntentsList Payment Intents with optional filters.
stripe.confirmPaymentIntentConfirm Payment IntentConfirm a payment intent.
stripe.createRefundCreate RefundRefund a payment intent or a charge partially by amount, or in full with fullRefund. Moves money: requires an idempotency key.
stripe.createSubscriptionCreate SubscriptionCreate a subscription for a customer from price items.
stripe.getSubscriptionGet SubscriptionRetrieve a subscription by id.
stripe.listSubscriptionsList SubscriptionsList Subscriptions with optional filters.
stripe.updateSubscriptionUpdate SubscriptionChange a subscription's items, proration or payment behaviour.
stripe.cancelSubscriptionCancel SubscriptionCancel a subscription.
stripe.createSubscriptionScheduleCreate Subscription ScheduleCreate a subscription schedule for a customer.
stripe.cancelSubscriptionScheduleCancel Subscription ScheduleCancel a subscription schedule, and its subscription if one started.
stripe.previewInvoicePreview InvoicePreview the next invoice of a subscription schedule, a customer, or a subscription with proposed item and proration changes, without creating it.
stripe.getBalanceGet BalanceRetrieve the current account balance.
stripe.listBalanceTransactionsList Balance TransactionsList Balance Transactions with optional filters.

Settings

Fields go in the step's config. "Used by" lists the operations that show the field in Studio. Field names are the same in Studio and in a workflow definition.

FieldStudio labelTypeUsed byRequired for
connectionStripe Accountstring (connection id)AllOptional. Without it the step uses the company default connection for this system
customerIdCustomer IDstringgetCustomer, updateCustomer, createInvoice, createPaymentIntent, createSubscription, listInvoices, listPaymentIntents, listSubscriptions, previewInvoice
emailEmailstringcreateCustomer, updateCustomer, listCustomers
nameNamestringcreateCustomer, updateCustomer, createProductcreateProduct
idempotencyKeyIdempotency keystringcreateProduct, createCreditNote, createRefund, updateSubscriptioncreateCreditNote, createRefund
invoiceIdInvoice IDstringgetInvoice, finalizeInvoice, sendInvoice, voidInvoice, deleteInvoice, updateInvoiceMetadata, createInvoiceItem, listInvoiceLineItems, previewCreditNote, createCreditNotelistInvoiceLineItems, previewCreditNote, createCreditNote, deleteInvoice, updateInvoiceMetadata
linesLines to credit (JSON)jsonpreviewCreditNote, createCreditNotepreviewCreditNote, createCreditNote
creditAmountCredit to customer balance (cents)numberpreviewCreditNote, createCreditNote
refundAmountRefund (cents)numberpreviewCreditNote, createCreditNote
outOfBandAmountCredited outside Stripe (cents)numberpreviewCreditNote, createCreditNote
reasonReasonstring: duplicate, fraudulent, order_change, product_unsatisfactorypreviewCreditNote, createCreditNote
memoMemostringpreviewCreditNote, createCreditNote
descriptionDescriptionstringcreateCustomer, updateCustomer, createInvoice, createInvoiceItem, createPaymentIntent, createProduct, createTaxRate
collectionMethodCollection Methodstring: charge_automatically, send_invoicecreateInvoice, createSubscription
amountAmount (cents)numbercreatePaymentIntent, createInvoiceItem, createRefund
fullRefundRefund the full amountbooleancreateRefund
quantityQuantitystringcreateInvoiceItem
unitAmountUnit amount (cents; used instead of Amount)stringcreateInvoiceItem
discountAmountDiscount (cents)numbercreateInvoiceItem
discountNameDiscount labelstringcreateInvoiceItem
productIdProduct IDstringcreateInvoiceItem, listPrices, createPricecreatePrice
priceIdPrice IDstringcreateInvoiceItem
couponIdCoupon IDstringcreateInvoiceItem, createCoupon
taxRateIdsTax rate IDs (JSON array of up to 10 txr_... ids)jsoncreateInvoiceItem
activeActivebooleancreateProduct, listTaxRates
querySearch query (Stripe search syntax)stringsearchProductssearchProducts
priceTypePrice type (blank for any)string: one_time, recurringlistPrices
priceActiveActive (blank for Stripe default)boolean: true, falselistPrices
priceCurrencyCurrencystringlistPrices
lookupKeysLookup keysstringlistPrices
priceLimitLimit (1-100)numberlistPrices
unitAmountDecimalUnit amount (cents, 0 or more, up to 12 decimals)stringcreatePricecreatePrice
intervalRecurring interval (blank for one-time)string: day, week, month, yearcreatePrice
intervalCountInterval countnumbercreatePrice
nicknameNickname (internal)stringcreatePrice
lookupKeyLookup keystringcreatePrice
taxBehaviorTax behavior (blank uses the account default)string: exclusive, inclusive, unspecifiedcreatePrice
percentOffPercent OffnumbercreateCoupon
amountOffAmount OffnumbercreateCoupon
couponDurationDurationstring: once, forever, repeatingcreateCoupon
durationInMonthsDuration In MonthsnumbercreateCoupon
couponNameCoupon NamestringcreateCoupon
displayNameDisplay name (shown on invoices)stringcreateTaxRatecreateTaxRate
percentagePercentage (0-100, max 4 decimal places)numbercreateTaxRatecreateTaxRate
inclusiveTax inclusivebooleancreateTaxRate, listTaxRates
jurisdictionJurisdictionstringcreateTaxRate
countryCountry (2-letter ISO code)stringcreateTaxRate
stateState / provincestringcreateTaxRate
taxTypeTax type (sales_tax, vat, gst, ...)stringcreateTaxRate
currencyCurrencystringcreatePaymentIntent, createInvoiceItem, createPrice, createCoupon
paymentIntentIdPayment Intent IDstringgetPaymentIntent, confirmPaymentIntent, createRefund
chargeIdCharge IDstringcreateRefund
refundReasonRefund reasonstring: duplicate, fraudulent, requested_by_customercreateRefund
subscriptionIdSubscription IDstringgetSubscription, updateSubscription, cancelSubscription, previewInvoice, listInvoices
itemsSubscription Items (JSON)jsoncreateSubscription, createSubscriptionSchedule, updateSubscription, previewInvoice
prorationBehaviorProration (blank for create_prorations)string: create_prorations, always_invoice, nonecreateSubscription, updateSubscription, previewInvoice
prorationDateProration date (unix seconds)numberupdateSubscription, previewInvoice
paymentBehaviorPayment behavior (blank for the default)string: default_incomplete, allow_incomplete, error_if_incomplete, pending_if_incompletecreateSubscription, updateSubscription
backdateStartDateBackdate start (unix seconds)numbercreateSubscription
billingModeBilling mode (blank for the default)string: flexiblecreateSubscription
endBehaviorWhen the schedule endsstring: release, cancelcreateSubscriptionSchedule
defaultSettingsDefault settings (JSON)jsoncreateSubscriptionSchedule
rejectPastStartDateReject a past start datebooleancreateSubscriptionSchedule
scheduleIdSubscription Schedule IDstringpreviewInvoice, cancelSubscriptionSchedule
limitLimitnumberlistCustomers, listInvoices, listPaymentIntents, listSubscriptions, listBalanceTransactions, searchProducts, listTaxRates, listInvoiceLineItems, listCoupons
startingAfterStarting after (pagination cursor)stringlistCustomers, listInvoices, listPaymentIntents, listSubscriptions, listTaxRates, listBalanceTransactions, listPrices, listInvoiceLineItems, listCoupons
expandAppliesToInclude product restrictionsbooleanlistCoupons
autoPaginateFetch all pagesbooleanlistCustomers, listInvoices, listSubscriptions, listTaxRates
payoutPayout IDstringlistBalanceTransactions
createdFromCreated fromstringlistBalanceTransactions, listInvoices
createdToCreated tostringlistBalanceTransactions, listInvoices
invoicePrefixInvoice Number PrefixstringcreateCustomer
metadataMetadata (JSON)jsoncreateCustomer, updateCustomer, createInvoice, createPaymentIntent, createSubscription, createProduct, createTaxRate, createPrice, previewCreditNote, createCreditNote, createCoupon, createRefund, updateInvoiceMetadataupdateInvoiceMetadata

The executors also read a few fields Studio does not show: daysUntilDue and autoAdvance (createInvoice), customerId (createInvoiceItem), phone and address (createCustomer, updateCustomer), status (listInvoices, listSubscriptions), and phases (createSubscriptionSchedule).

Rules the actions enforce

  • Amounts are integers in the smallest currency unit (cents for USD).
  • createRefund and createCreditNote require idempotencyKey. Build it from ids that stay the same when the step is retried, such as refund:<invoice id>. createRefund tags the refund with the key and, on a re-run, returns the refund it already made; a re-run that asks for a different amount is refused.
  • createRefund takes paymentIntentId (pi_...) or chargeId (ch_... or py_...), and amount as whole positive cents, or fullRefund: true. Any other value stops the step before Stripe is called.
  • deleteInvoice deletes only a draft. Stripe refuses any other status; use voidInvoice for a finalized invoice.
  • updateInvoiceMetadata sends only metadata[key]=value pairs to POST /v1/invoices/:id, so it cannot change anything else on the invoice. Stripe keeps the keys you do not send; an empty string or null clears a key. An empty object is refused, because Stripe reads a bare metadata= as "clear every key". Stripe allows up to 50 keys, key names up to 40 characters without [ or ], and values up to 500 characters (Stripe metadata); the step checks these before calling Stripe.
  • listInvoices filters by subscriptionId and by createdFrom/createdTo (created[gte]/created[lte], ISO 8601 or unix seconds, inclusive; a date-only createdTo covers the whole UTC day). autoPaginate fetches every page at 100 per page and fails the step past 100 pages.
  • createInvoiceItem accepts priceId, or productId with unitAmount or amount, or amount alone. priceId cannot be combined with productId, unitAmount or amount. couponId cannot be combined with discountAmount. A positive discountAmount creates a single-use coupon for that line.
  • createInvoice sends collection_method charge_automatically and auto_advance true unless you set them.

Output

A step's output is the Stripe API object the call returns, stored as is. Read it with {{steps.<stepId>.<path>}}, for example {{steps.create_invoice.id}} or {{steps.create_invoice.hosted_invoice_url}}. List actions return Stripe's list object, with the records under data.

Example

This workflow creates an invoice for the customer passed in at run time, adds one line, finalizes it and emails it.

{
  "name": "Invoice a customer",
  "trigger": { "type": "api" },
  "steps": [
    {
      "id": "create_invoice",
      "type": "action",
      "name": "Create the invoice",
      "action": "stripe.createInvoice",
      "config": {
        "customerId": "{{input.customerId}}",
        "collectionMethod": "send_invoice",
        "daysUntilDue": 30,
        "description": "Services for {{input.period}}"
      }
    },
    {
      "id": "add_line",
      "type": "action",
      "name": "Add the line",
      "action": "stripe.createInvoiceItem",
      "config": {
        "customerId": "{{input.customerId}}",
        "invoiceId": "{{steps.create_invoice.id}}",
        "amount": 125000,
        "currency": "usd",
        "description": "Monthly retainer"
      }
    },
    {
      "id": "finalize",
      "type": "action",
      "name": "Finalize the invoice",
      "action": "stripe.finalizeInvoice",
      "config": { "invoiceId": "{{steps.create_invoice.id}}" }
    },
    {
      "id": "send",
      "type": "action",
      "name": "Email the invoice",
      "action": "stripe.sendInvoice",
      "config": { "invoiceId": "{{steps.create_invoice.id}}" }
    }
  ]
}

Live catalog

  • GET /api/v1/blocks/stripe returns the block's current actions and fields.
  • GET /api/v1/blocks/stripe/actions/<operation>/examples returns the stored input and output examples for one action, where one exists.

See Block and action discovery.

Errors and limits

  • A Stripe API error fails the step, and the step error carries Stripe's own message and code.
  • A validation rule above fails the step before Stripe is called, with a message that names the field.
  • The workflow validator rejects an operation that is not in the table above.

On this page