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
authVariantwhen you start a connect session:oauth(Stripe Connect, the default) andapi_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 id | Studio label | What it does |
|---|---|---|
stripe.getCustomer | Get Customer | Retrieve a customer by id. |
stripe.createCustomer | Create Customer | Create a customer. invoicePrefix sets the prefix Stripe uses to number this customer's invoices. |
stripe.updateCustomer | Update Customer | Update a customer's email, name, description or metadata. |
stripe.listCustomers | List Customers | List Customers with optional filters. |
stripe.createInvoice | Create Invoice | Create an invoice for a customer. collectionMethod defaults to charge_automatically and autoAdvance to true. |
stripe.getInvoice | Get Invoice | Retrieve an invoice by id. |
stripe.listInvoices | List Invoices | List Invoices with optional filters. |
stripe.finalizeInvoice | Finalize Invoice | Finalize a draft invoice. |
stripe.sendInvoice | Send Invoice | Email a finalized invoice to the customer. |
stripe.voidInvoice | Void Invoice | Void a finalized invoice. |
stripe.deleteInvoice | Delete Draft Invoice | Permanently delete a DRAFT invoice. Stripe refuses any other status; void a finalized invoice instead. |
stripe.updateInvoiceMetadata | Update Invoice Metadata | Set or clear metadata keys on an invoice. Never finalizes, sends, voids or changes amounts. |
stripe.createInvoiceItem | Create Invoice Item | Add a line to a draft invoice, by price, by product and amount, or by amount, with an optional discount and tax rates. |
stripe.listInvoiceLineItems | List Invoice Line Items | List one page of an invoice's line items; page with startingAfter while has_more. |
stripe.previewCreditNote | Preview Credit Note | Preview a credit note without creating it: per-line amounts, tax and totals Stripe would credit. |
stripe.createCreditNote | Create Credit Note | Issue a credit note against a finalized invoice, crediting invoice lines by quantity or amount. |
stripe.createProduct | Create Product | Create a product. |
stripe.searchProducts | Search Products | Search products with Stripe search syntax. |
stripe.listPrices | List Prices | List prices, optionally filtered by product, active flag, type, currency and lookup keys. |
stripe.createPrice | Create Price | Create a one-time or recurring price for an existing product, priced by unit_amount_decimal. |
stripe.listCoupons | List Coupons | List one page of coupons; page with startingAfter while has_more. |
stripe.createCoupon | Create Coupon | Create a percentage or amount coupon; a fixed couponId fails with resource_already_exists when taken. |
stripe.listTaxRates | List Tax Rates | List tax rates, optionally only active or inclusive ones. |
stripe.createTaxRate | Create Tax Rate | Create a tax rate. |
stripe.createPaymentIntent | Create Payment Intent | Create a payment intent for an amount and currency. |
stripe.getPaymentIntent | Get Payment Intent | Retrieve a payment intent by id. |
stripe.listPaymentIntents | List Payment Intents | List Payment Intents with optional filters. |
stripe.confirmPaymentIntent | Confirm Payment Intent | Confirm a payment intent. |
stripe.createRefund | Create Refund | Refund a payment intent or a charge partially by amount, or in full with fullRefund. Moves money: requires an idempotency key. |
stripe.createSubscription | Create Subscription | Create a subscription for a customer from price items. |
stripe.getSubscription | Get Subscription | Retrieve a subscription by id. |
stripe.listSubscriptions | List Subscriptions | List Subscriptions with optional filters. |
stripe.updateSubscription | Update Subscription | Change a subscription's items, proration or payment behaviour. |
stripe.cancelSubscription | Cancel Subscription | Cancel a subscription. |
stripe.createSubscriptionSchedule | Create Subscription Schedule | Create a subscription schedule for a customer. |
stripe.cancelSubscriptionSchedule | Cancel Subscription Schedule | Cancel a subscription schedule, and its subscription if one started. |
stripe.previewInvoice | Preview Invoice | Preview the next invoice of a subscription schedule, a customer, or a subscription with proposed item and proration changes, without creating it. |
stripe.getBalance | Get Balance | Retrieve the current account balance. |
stripe.listBalanceTransactions | List Balance Transactions | List 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.
| Field | Studio label | Type | Used by | Required for |
|---|---|---|---|---|
connection | Stripe Account | string (connection id) | All | Optional. Without it the step uses the company default connection for this system |
customerId | Customer ID | string | getCustomer, updateCustomer, createInvoice, createPaymentIntent, createSubscription, listInvoices, listPaymentIntents, listSubscriptions, previewInvoice | |
email | string | createCustomer, updateCustomer, listCustomers | ||
name | Name | string | createCustomer, updateCustomer, createProduct | createProduct |
idempotencyKey | Idempotency key | string | createProduct, createCreditNote, createRefund, updateSubscription | createCreditNote, createRefund |
invoiceId | Invoice ID | string | getInvoice, finalizeInvoice, sendInvoice, voidInvoice, deleteInvoice, updateInvoiceMetadata, createInvoiceItem, listInvoiceLineItems, previewCreditNote, createCreditNote | listInvoiceLineItems, previewCreditNote, createCreditNote, deleteInvoice, updateInvoiceMetadata |
lines | Lines to credit (JSON) | json | previewCreditNote, createCreditNote | previewCreditNote, createCreditNote |
creditAmount | Credit to customer balance (cents) | number | previewCreditNote, createCreditNote | |
refundAmount | Refund (cents) | number | previewCreditNote, createCreditNote | |
outOfBandAmount | Credited outside Stripe (cents) | number | previewCreditNote, createCreditNote | |
reason | Reason | string: duplicate, fraudulent, order_change, product_unsatisfactory | previewCreditNote, createCreditNote | |
memo | Memo | string | previewCreditNote, createCreditNote | |
description | Description | string | createCustomer, updateCustomer, createInvoice, createInvoiceItem, createPaymentIntent, createProduct, createTaxRate | |
collectionMethod | Collection Method | string: charge_automatically, send_invoice | createInvoice, createSubscription | |
amount | Amount (cents) | number | createPaymentIntent, createInvoiceItem, createRefund | |
fullRefund | Refund the full amount | boolean | createRefund | |
quantity | Quantity | string | createInvoiceItem | |
unitAmount | Unit amount (cents; used instead of Amount) | string | createInvoiceItem | |
discountAmount | Discount (cents) | number | createInvoiceItem | |
discountName | Discount label | string | createInvoiceItem | |
productId | Product ID | string | createInvoiceItem, listPrices, createPrice | createPrice |
priceId | Price ID | string | createInvoiceItem | |
couponId | Coupon ID | string | createInvoiceItem, createCoupon | |
taxRateIds | Tax rate IDs (JSON array of up to 10 txr_... ids) | json | createInvoiceItem | |
active | Active | boolean | createProduct, listTaxRates | |
query | Search query (Stripe search syntax) | string | searchProducts | searchProducts |
priceType | Price type (blank for any) | string: one_time, recurring | listPrices | |
priceActive | Active (blank for Stripe default) | boolean: true, false | listPrices | |
priceCurrency | Currency | string | listPrices | |
lookupKeys | Lookup keys | string | listPrices | |
priceLimit | Limit (1-100) | number | listPrices | |
unitAmountDecimal | Unit amount (cents, 0 or more, up to 12 decimals) | string | createPrice | createPrice |
interval | Recurring interval (blank for one-time) | string: day, week, month, year | createPrice | |
intervalCount | Interval count | number | createPrice | |
nickname | Nickname (internal) | string | createPrice | |
lookupKey | Lookup key | string | createPrice | |
taxBehavior | Tax behavior (blank uses the account default) | string: exclusive, inclusive, unspecified | createPrice | |
percentOff | Percent Off | number | createCoupon | |
amountOff | Amount Off | number | createCoupon | |
couponDuration | Duration | string: once, forever, repeating | createCoupon | |
durationInMonths | Duration In Months | number | createCoupon | |
couponName | Coupon Name | string | createCoupon | |
displayName | Display name (shown on invoices) | string | createTaxRate | createTaxRate |
percentage | Percentage (0-100, max 4 decimal places) | number | createTaxRate | createTaxRate |
inclusive | Tax inclusive | boolean | createTaxRate, listTaxRates | |
jurisdiction | Jurisdiction | string | createTaxRate | |
country | Country (2-letter ISO code) | string | createTaxRate | |
state | State / province | string | createTaxRate | |
taxType | Tax type (sales_tax, vat, gst, ...) | string | createTaxRate | |
currency | Currency | string | createPaymentIntent, createInvoiceItem, createPrice, createCoupon | |
paymentIntentId | Payment Intent ID | string | getPaymentIntent, confirmPaymentIntent, createRefund | |
chargeId | Charge ID | string | createRefund | |
refundReason | Refund reason | string: duplicate, fraudulent, requested_by_customer | createRefund | |
subscriptionId | Subscription ID | string | getSubscription, updateSubscription, cancelSubscription, previewInvoice, listInvoices | |
items | Subscription Items (JSON) | json | createSubscription, createSubscriptionSchedule, updateSubscription, previewInvoice | |
prorationBehavior | Proration (blank for create_prorations) | string: create_prorations, always_invoice, none | createSubscription, updateSubscription, previewInvoice | |
prorationDate | Proration date (unix seconds) | number | updateSubscription, previewInvoice | |
paymentBehavior | Payment behavior (blank for the default) | string: default_incomplete, allow_incomplete, error_if_incomplete, pending_if_incomplete | createSubscription, updateSubscription | |
backdateStartDate | Backdate start (unix seconds) | number | createSubscription | |
billingMode | Billing mode (blank for the default) | string: flexible | createSubscription | |
endBehavior | When the schedule ends | string: release, cancel | createSubscriptionSchedule | |
defaultSettings | Default settings (JSON) | json | createSubscriptionSchedule | |
rejectPastStartDate | Reject a past start date | boolean | createSubscriptionSchedule | |
scheduleId | Subscription Schedule ID | string | previewInvoice, cancelSubscriptionSchedule | |
limit | Limit | number | listCustomers, listInvoices, listPaymentIntents, listSubscriptions, listBalanceTransactions, searchProducts, listTaxRates, listInvoiceLineItems, listCoupons | |
startingAfter | Starting after (pagination cursor) | string | listCustomers, listInvoices, listPaymentIntents, listSubscriptions, listTaxRates, listBalanceTransactions, listPrices, listInvoiceLineItems, listCoupons | |
expandAppliesTo | Include product restrictions | boolean | listCoupons | |
autoPaginate | Fetch all pages | boolean | listCustomers, listInvoices, listSubscriptions, listTaxRates | |
payout | Payout ID | string | listBalanceTransactions | |
createdFrom | Created from | string | listBalanceTransactions, listInvoices | |
createdTo | Created to | string | listBalanceTransactions, listInvoices | |
invoicePrefix | Invoice Number Prefix | string | createCustomer | |
metadata | Metadata (JSON) | json | createCustomer, updateCustomer, createInvoice, createPaymentIntent, createSubscription, createProduct, createTaxRate, createPrice, previewCreditNote, createCreditNote, createCoupon, createRefund, updateInvoiceMetadata | updateInvoiceMetadata |
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).
createRefundandcreateCreditNoterequireidempotencyKey. Build it from ids that stay the same when the step is retried, such asrefund:<invoice id>.createRefundtags 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.createRefundtakespaymentIntentId(pi_...) orchargeId(ch_...orpy_...), andamountas whole positive cents, orfullRefund: true. Any other value stops the step before Stripe is called.deleteInvoicedeletes only a draft. Stripe refuses any other status; usevoidInvoicefor a finalized invoice.updateInvoiceMetadatasends onlymetadata[key]=valuepairs toPOST /v1/invoices/:id, so it cannot change anything else on the invoice. Stripe keeps the keys you do not send; an empty string ornullclears a key. An empty object is refused, because Stripe reads a baremetadata=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.listInvoicesfilters bysubscriptionIdand bycreatedFrom/createdTo(created[gte]/created[lte], ISO 8601 or unix seconds, inclusive; a date-onlycreatedTocovers the whole UTC day).autoPaginatefetches every page at 100 per page and fails the step past 100 pages.createInvoiceItemacceptspriceId, orproductIdwithunitAmountoramount, oramountalone.priceIdcannot be combined withproductId,unitAmountoramount.couponIdcannot be combined withdiscountAmount. A positivediscountAmountcreates a single-use coupon for that line.createInvoicesendscollection_methodcharge_automaticallyandauto_advancetrueunless 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/stripereturns the block's current actions and fields.GET /api/v1/blocks/stripe/actions/<operation>/examplesreturns 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.
Slack actions
Reference for the Slack actions: the workspace connection, each action id, the fields each executor reads, file upload limits, outputs and an example.
Xero actions
Reference for the Xero actions: the connection type, each action and what it does, its inputs and outputs, and the live catalog call.
Loopfour