1. Overview
Stripe is a comprehensive suite of payment APIs that powers commerce for online businesses of all sizes. It allows businesses to accept payments, send payouts, and manage their operations online.
The GoInsight Stripe node enables you to integrate Stripe's powerful payment processing capabilities directly into your automated workflows. You can manage the entire lifecycle of core payment resources, including:
- Customer Management: Create, retrieve, update, and delete customer records.
- Payment Processing: Create and manage charges and modern Payment Intents.
- Promotions: Generate and look up coupons for discounts.
- Payment Methods: Add, list, and remove customer payment methods (cards).
- Account Information: Retrieve your current account balance.
2. Prerequisites
Before using this node, you need to have a valid Stripe account. You will also need to obtain your API keys (Secret Key) from the Stripe Dashboard to authenticate your requests. You may need developer or administrator permissions to access and manage API keys.
3. Credentials
For a detailed guide on how to obtain and configure your credentials, please refer to our official documentation: Credentials Configuration Guide.
4. Supported Operations
Summary
This node primarily operates on resources such as Balance, Charge, Coupon, Customer, Customer Card, Payment Intent, and Payment Method.
| Resource | Operation | Description |
|---|---|---|
| Balance | Get Balance | Retrieves the current balance from an account, including available, pending, and instant payout balances for all currencies. All amounts are in the smallest currency unit (e.g., cents for USD — divide by 100 to get dollars). Use this to check account balance before initiating payouts or to monitor financial health. |
| Charge | Get Charges | Retrieves charges. Two modes: (1) Single charge: provide ChargeId to get one specific charge. (2) Batch: leave ChargeId empty to list charges with optional filters (CustomerId, PaymentIntentId, Created date range). Results are paginated — check HasMore and pass NextCursor to StartingAfter for the next page. All amounts are in cents (divide by 100 for dollars). |
| Charge | Update Charge | ⚠️ UPDATE STRATEGY: This is an incremental update (PATCH mode). Only the fields you provide will be updated; fields you leave empty will keep their original values. This is NOT a full replacement — unprovided fields are preserved. Provide ChargeId (starts with 'ch_') and at least one field to update. Amount and currency cannot be changed after creation. |
| Coupon | Create Coupon | Creates a new coupon. Provide exactly one of PercentOff (e.g. 25 for 25% off) or AmountOff (e.g. 500 for $5 off, requires Currency). Duration controls how long the discount applies: 'once' (default), 'forever', or 'repeating'. NOTE: Stripe automatically deduplicates coupons with identical parameters. Retrying with the same values returns the existing coupon instead of creating a duplicate. |
| Coupon | Get Coupons | Retrieves coupons. Two modes: (1) Single coupon: provide CouponId to get one specific coupon. (2) Batch: leave CouponId empty to list coupons with optional Created date filter. Results are paginated — check HasMore and pass NextCursor to StartingAfter for the next page. Coupons have either percent_off (percentage discount) or amount_off (fixed amount in cents) — never both. |
| Customer | Create Customer | Creates a new customer. IMPORTANT: At least one of Email or Name is required — if both are empty, the request will fail with StatusCode -1. Duplicate prevention: provide IdempotencyKey to ensure Stripe does not create duplicate customers on retry (guaranteed idempotent for 24 hours with the same key); or call stripe_get_customers to verify the email does not already exist before creating. Optionally attach Phone, Description, and Metadata (custom key-value pairs). Returns the created customer object with its ID (starts with 'cus_') for use in subsequent Stripe operations. |
| Customer | Delete Customers | WARNING: Permanently deletes customers. Cannot be undone. Provide one or more customer IDs (starts with 'cus_'), comma-separated for multiple. Returns per-ID success/failure results. |
| Customer | Get Customers | Retrieves customers. Two modes: (1) By ID: provide CustomerIds (single or comma-separated) to get specific customers. (2) List: leave CustomerIds empty to list customers with optional filters (Email, Created date range). List results are paginated — check HasMore and pass NextCursor to StartingAfter for the next page. |
| Customer | Update Customer | ⚠️ UPDATE STRATEGY: This is an incremental update (PATCH mode). Only the fields you provide will be updated; fields you leave empty will keep their original values. This is NOT a full replacement — unprovided fields are preserved. Metadata is merged: new keys added, existing keys updated, omitted keys unchanged. Provide CustomerId (starts with 'cus_') and at least one field to update. |
| Customer Card | Add Customer Card | Adds a payment card to a customer. Provide CustomerId (starts with 'cus_') and Source (token like 'tok_visa', source ID, or payment method ID). Returns the card object with CardId. |
| Customer Card | Delete Customer Card | WARNING: Permanently deletes a payment card from a customer. This operation cannot be undone. Provide CustomerId and CardId. Returns the deleted card object with Deleted=true. |
| Customer Card | Get Customer Cards | Retrieves payment cards for a customer. Two modes: (1) Single card: provide CardId to get one specific card. (2) List: leave CardId empty to list all cards with pagination. When CardId is provided, pagination parameters are ignored. |
| Payment Intent | Create Payment Intent | Creates a new Payment Intent. Required: Amount (in cents, e.g. 1000 for $10) and Currency (e.g. 'usd'). Returns PaymentIntentId and ClientSecret for frontend confirmation via Stripe.js. Supports multiple payment methods and 3DS authentication. |
| Payment Method | Create Payment Method | Creates a new PaymentMethod object via Stripe Payment Methods API (replaces deprecated Sources API). Required: PaymentMethodType (e.g. 'card', 'sepa_debit'). Optionally attach to a Customer by providing CustomerId. Returns PaymentMethodId ('pm_') for use with Create Payment Intent. |
| Payment Method | Detach Payment Method | Detaches a PaymentMethod from its associated Customer via Stripe Payment Methods API (replaces deprecated Delete Source). Required: PaymentMethodId (starts with 'pm_'). The payment method must be attached to a customer. Returns Detached=true and the previous CustomerId on success. |
| Payment Method | Get Payment Method | Retrieves a PaymentMethod object by ID via Stripe Payment Methods API (replaces deprecated Get Source). Required: PaymentMethodId (starts with 'pm_'). Returns full PaymentMethod details including type, billing info, and attached customer. |
Operation Details
Get Balance
Retrieves the current balance from an account, including available, pending, and instant payout balances for all currencies. All amounts are in the smallest currency unit (e.g., cents for USD — divide by 100 to get dollars). Use this to check account balance before initiating payouts or to monitor financial health.
Output:
- BalanceData (object): Complete balance object from API. Contains: object (string, always 'balance'), livemode (boolean), available (array), pending (array), connect_reserved (array), instant_available (array). Empty object if retrieval failed.
- Available (object-array): Array of available balance objects by currency. Funds ready for transfer or payout. Each object contains: amount (number, in cents — divide by 100 for dollars), currency (string, e.g. 'usd'), source_types (object, e.g. {card: 1000}). Empty array if failed.
- Pending (object-array): Array of pending balance objects by currency. Funds not yet available (recent charges awaiting settlement, typically 2 business days). Same structure as Available. Empty array if failed.
- ConnectReserved (object-array): Array of Stripe Connect platform reserved balance objects. Only for Stripe Connect accounts (platform/marketplace features) — funds held in reserve for potential refunds/disputes. If you're not using Stripe Connect, this will always be empty. Same structure as Available. Empty array if not applicable.
- InstantAvailable (object-array): Array of instant payout available balance objects. Funds eligible for Instant Payouts (receive money in minutes instead of standard 2 business days). Note: Instant Payouts require account eligibility and may incur additional fees. Same structure as Available. Empty array if not applicable.
- OriginalStatusCode (number): The original HTTP status code returned by API (e.g., 200 for success, 401 for auth failure). Default 0 means the request did not reach upstream. Use for debugging.
- StatusCode (number): Operation status code: 200=Success (check ErrorMessage for business errors), -1=Parameter validation error, 500=System error (network timeout/connection failure).
- ErrorMessage (string): Detailed error message if any error occurred. Empty string if the operation succeeded.
Get Charges
Retrieves charges. Two modes: (1) Single charge: provide ChargeId to get one specific charge. (2) Batch: leave ChargeId empty to list charges with optional filters (CustomerId, PaymentIntentId, Created date range). Results are paginated — check HasMore and pass NextCursor to StartingAfter for the next page. All amounts are in cents (divide by 100 for dollars).
Options:
- ChargeId: Specific charge ID to retrieve (starts with 'ch_'). If provided, retrieves only this charge and ignores all other filter parameters. Leave empty to get multiple charges. Obtain from: previous charge creation, charge list output, or Dashboard. Example: 'ch_3MmlLrLkdIwHu7ix0snN0B15'.
- Limit: Number of charges to retrieve per page (1-100). Only used when ChargeId is empty. Default: 10.
- StartingAfter: Charge ID for forward pagination (get next page after this charge). How to use: 1) First request: leave empty. 2) If response HasMore=true, copy NextCursor value here. 3) Repeat until HasMore=false. Cannot be used together with EndingBefore.
- EndingBefore: Charge ID for backward pagination (get previous page before this charge). Use when you want to go back to earlier charges. Cannot be used together with StartingAfter.
- CustomerId: Filter charges by customer ID (starts with 'cus_'). Only returns charges belonging to this customer. Obtain from: stripe_create_customer output or stripe_get_customers output. Example: 'cus_NffrFeUfNV2Hib'.
- PaymentIntentId: Filter charges by Payment Intent ID (starts with 'pi_'). Only returns charges associated with this payment intent.
- Created: Filter charges by creation date using Unix timestamps (seconds). Provide an object with comparison operators: 'gte' (>=), 'lte' (<=), 'gt' (>), 'lt' (<). Example: {"gte": 1704067200, "lte": 1706745599} (2024-01-01 to 2024-01-31). Date conversion: https://www.unixtimestamp.com/
Output:
- Charges (object-array): Array of charge objects. Each contains: id (string), amount (number, cents), currency (string), status ('succeeded'/'pending'/'failed'), customer (string), payment_intent (string), created (number, Unix timestamp), paid (boolean), refunded (boolean), description (string). Empty array if failed.
- ChargeData (object): Complete API response object. For single charge: the charge object. For batch: contains object ('list'), data (array), has_more (boolean). Empty object if failed.
- TotalCount (number): Number of charges returned in the current page (not total across all pages). 0 if failed.
- HasMore (bool): Whether more charges exist beyond this page. If true, pass NextCursor to StartingAfter for the next page.
- NextCursor (string): The ID of the last charge in this page. Pass to StartingAfter to get the next page. Empty if this is the last page.
- OriginalStatusCode (number): The original HTTP status code from API (e.g., 200, 401, 404). Default 0 means request did not reach upstream.
- StatusCode (number): Operation status code: 200=Success (check ErrorMessage for business errors), -1=Parameter validation error, 500=System error.
- ErrorMessage (string): Detailed error message if any error occurred. Empty string on success.
Update Charge
⚠️ UPDATE STRATEGY: This is an incremental update (PATCH mode). Only the fields you provide will be updated; fields you leave empty will keep their original values. This is NOT a full replacement — unprovided fields are preserved. Provide ChargeId (starts with 'ch_') and at least one field to update. Amount and currency cannot be changed after creation.
Input Parameters:
- ChargeId: Required. charge ID (starts with 'ch_'). Obtain from: stripe_get_charges ChargeId output field, or Stripe Dashboard → Payments → click a charge → copy ID. Example: 'ch_3QRmLs2eZvKYlo2C0abc'.
Options:
- Description: Updated description. Optional. Example: 'Order #12345 - Premium subscription'.
- ReceiptEmail: Email for receipt delivery. Optional. Example: 'customer@example.com'.
- Metadata: Custom key-value pairs (object). All keys and values must be strings. Optional. Example: {"order_id": "12345", "customer_name": "John Doe"}
- ShippingName: Recipient name for shipping. Optional. Example: 'John Doe'.
- ShippingAddress: Shipping address (object). Required field: line1. Optional fields: line2, city, state, postal_code, country (2-letter ISO code). Example: {"line1": "123 Main St", "city": "New York", "state": "NY", "postal_code": "10001", "country": "US"}
Output:
- Charge (object): Complete updated charge object from API. Core fields: id (string), amount (number, cents), currency (string), description (string), receipt_email (string), status ('succeeded'/'pending'/'failed'), created (number, Unix timestamp), metadata (object), shipping (object — sub-fields: name (string, recipient), address (object with line1, line2, city, state, postal_code, country)), paid (boolean), refunded (boolean). Empty object if failed.
- ChargeId (string): ID of the updated charge (starts with 'ch_'). Empty string if failed.
- Amount (number): Charge amount in smallest currency unit. For USD: 2000 = $20.00. Cannot be updated.
- Currency (string): Three-letter ISO 4217 currency code (e.g. 'usd'). Empty string if failed.
- Description (string): Charge description after update. Empty string if failed.
- ReceiptEmail (string): Receipt email after update. Empty string if failed.
- Metadata (object): User-defined key-value pairs on the charge. Empty object if failed.
- Status (string): Charge status: 'succeeded' (paid), 'pending' (processing), 'failed'. Empty string if failed.
- Created (number): Unix timestamp (seconds) of charge creation. Example: 1731400774. 0 if failed.
- Message (string): Success message. Empty string if failed.
- OriginalStatusCode (number): Original HTTP status code from API. Default 0 means request did not reach upstream.
- StatusCode (number): Operation status: 200=Success (check ErrorMessage), -1=Param error, 500=System error.
- ErrorMessage (string): Detailed error message. Empty string on success.
Create Coupon
Creates a new coupon. Provide exactly one of PercentOff (e.g. 25 for 25% off) or AmountOff (e.g. 500 for $5 off, requires Currency). Duration controls how long the discount applies: 'once' (default), 'forever', or 'repeating'. NOTE: Stripe automatically deduplicates coupons with identical parameters. Retrying with the same values returns the existing coupon instead of creating a duplicate.
Options:
- PercentOff: Percentage discount (1-100). Mutually exclusive with AmountOff — provide exactly one. Example: 25 for 25% off.
- AmountOff: Fixed amount discount in cents (1 dollar = 100 cents). Mutually exclusive with PercentOff. Requires Currency. Example: 500 for $5.00 off.
- Currency: Three-letter currency code in lowercase (ISO 4217 standard). Required when AmountOff is used. Must be lowercase. Common codes: 'usd' (US Dollar), 'eur' (Euro), 'gbp' (British Pound), 'jpy' (Japanese Yen), 'cny' (Chinese Yuan).
- Duration: 'once' (first payment only), 'forever' (all payments), or 'repeating' (specific months). Default: 'once'.
- Name: Display name shown to customers on invoices. Optional. Example: 'Spring Sale 2024'.
Output:
- Coupon (object): Complete coupon object from API. Fields: id (string, unique identifier), percent_off (number or null, 1-100), amount_off (number or null, cents), currency (string or null, only when amount_off used), duration (string, 'once'/'forever'/'repeating'), duration_in_months (number or null), valid (boolean), times_redeemed (number), max_redemptions (number or null), redeem_by (number or null, Unix timestamp), created (number, Unix timestamp), name (string or null), metadata (object), livemode (boolean). Empty object if failed.
- CouponId (string): ID of the newly created coupon. Use to apply to customers or subscriptions. Empty string if failed.
- Message (string): Human-readable success message. Empty string if failed.
- OriginalStatusCode (number): Original HTTP status code from API (e.g., 200, 400, 401). Default 0 means request did not reach upstream.
- StatusCode (number): Operation status code: 200=Success (check ErrorMessage for business errors), -1=Parameter validation error, 500=System error.
- ErrorMessage (string): Detailed error message if any error occurred. Empty string on success.
Get Coupons
Retrieves coupons. Two modes: (1) Single coupon: provide CouponId to get one specific coupon. (2) Batch: leave CouponId empty to list coupons with optional Created date filter. Results are paginated — check HasMore and pass NextCursor to StartingAfter for the next page. Coupons have either percent_off (percentage discount) or amount_off (fixed amount in cents) — never both.
Options:
- CouponId: Specific coupon ID to retrieve. If provided, retrieves only this coupon and ignores all other filter parameters. Coupon IDs can be custom strings (e.g. '25OFF') or auto-generated. Obtain from: previous coupon creation, coupon list output, or Dashboard.
- Limit: Number of coupons to retrieve per page (1-100). Only used when CouponId is empty. Default: 10.
- StartingAfter: Coupon ID for forward pagination (get next page / newer coupons). How to use: 1) First request: leave empty. 2) If response HasMore=true, copy NextCursor value here. 3) Repeat until HasMore=false. Cannot be used together with EndingBefore.
- EndingBefore: Coupon ID for backward pagination (get previous page / older coupons). Use when you want to go back to earlier coupons. Cannot be used together with StartingAfter.
- Created: Filter coupons by creation date using Unix timestamps (seconds). Provide an object with comparison operators: 'gte' (>=), 'lte' (<=), 'gt' (>), 'lt' (<). Common use cases: Single day: {"gte": 1704067200, "lte": 1704153599} (2024-01-01 00:00 to 23:59). From date onwards: {"gte": 1704067200}. Date range: {"gte": 1704067200, "lte": 1706745599} (2024-01-01 to 2024-01-31). Date conversion: https://www.unixtimestamp.com/
Output:
- Coupons (object-array): Array of coupon objects. Important: Each coupon has either percent_off OR amount_off — never both. Fields: id (string), name (string), percent_off (number or null, e.g. 25.0 for 25% off), amount_off (number or null, fixed discount in cents: 1000 = $10.00, 500 = $5.00), currency (string or null, only present when amount_off is used), duration ('once'/'repeating'/'forever'), duration_in_months (number or null), valid (boolean), times_redeemed (number), max_redemptions (number or null), redeem_by (number or null), created (number, Unix timestamp), metadata (object). Empty array if failed.
- CouponData (object): Complete API response object. For single coupon: the coupon object. For batch: contains object ('list'), data (array), has_more (boolean). Empty object if failed.
- TotalCount (number): Number of coupons returned in the current page (not total across all pages). 0 if failed.
- HasMore (bool): Whether more coupons exist beyond this page. If true, pass NextCursor to StartingAfter for the next page.
- NextCursor (string): The ID of the last coupon in this page. Pass to StartingAfter to get the next page. Empty if last page.
- OriginalStatusCode (number): The original HTTP status code from API (e.g., 200, 401, 404). Default 0 means request did not reach upstream.
- StatusCode (number): Operation status code: 200=Success (check ErrorMessage for business errors), -1=Parameter validation error, 500=System error.
- ErrorMessage (string): Detailed error message if any error occurred. Empty string on success.
Create Customer
Creates a new customer. IMPORTANT: At least one of Email or Name is required — if both are empty, the request will fail with StatusCode -1. Duplicate prevention: provide IdempotencyKey to ensure Stripe does not create duplicate customers on retry (guaranteed idempotent for 24 hours with the same key); or call stripe_get_customers to verify the email does not already exist before creating. Optionally attach Phone, Description, and Metadata (custom key-value pairs). Returns the created customer object with its ID (starts with 'cus_') for use in subsequent Stripe operations.
Options:
- Email: Customer's email address. At least one of Email or Name is required. Both can be provided together. Example: 'john.doe@example.com'.
- Name: Customer's full name. At least one of Email or Name is required. Both can be provided together. Example: 'John Doe'.
- Phone: Customer's phone number. Optional. Example: '+1-555-0100'.
- Description: Internal description or note about the customer. Optional. Example: 'Premium customer from Q4 campaign'.
- Metadata: Custom key-value pairs (object). All keys and values must be strings. Optional. Example: {"user_id": "usr_12345", "plan": "premium", "source": "website"}
- IdempotencyKey: Unique key to prevent duplicate creation on retry. Stripe guarantees the same key won't create duplicate customers within 24 hours. Recommended format: '{workflow_run_id}_{timestamp}' or UUID. Optional. Example: 'wf_run_abc123_1704067200'.
Output:
- Customer (object): Complete customer object from API. Contains: id, email, name, phone, description, created (Unix timestamp), currency, balance, metadata, etc. Empty object if failed.
- CustomerId (string): ID of the newly created customer (starts with 'cus_'). Use in other actions. Empty string if failed.
- Message (string): Human-readable success message. Empty string if failed.
- OriginalStatusCode (number): Original HTTP status code from API (e.g., 200, 400, 401). Default 0 means request did not reach upstream.
- StatusCode (number): Operation status code: 200=Success (check ErrorMessage for business errors), -1=Parameter validation error, 500=System error.
- ErrorMessage (string): Detailed error message if any error occurred. Empty string on success.
Delete Customers
WARNING: Permanently deletes customers. Cannot be undone. Provide one or more customer IDs (starts with 'cus_'), comma-separated for multiple. Returns per-ID success/failure results.
Input Parameters:
- CustomerIds: Required. Customer ID(s) to permanently delete. Format: 'cus_' prefix. Single: 'cus_NffrFeUfNV2Hib'. Multiple: 'cus_abc123,cus_def456' (supports Chinese comma). WARNING: deletion is permanent.
Output:
- DeletedCustomers (string-array): Array of successfully deleted customer IDs. Empty array if all failed.
- SuccessCount (number): Number of customers successfully deleted.
- FailureCount (number): Number of customers that failed to delete.
- Results (string): Detailed per-ID results with ✓/✗ markers, newline-separated.
- Message (string): Summary message. Empty if all failed.
- OriginalStatusCode (number): HTTP status from first failed request. 0 if all succeeded.
- StatusCode (number): Operation status: 200=Completed (check ErrorMessage), -1=Param error, 500=System error.
- ErrorMessage (string): Error details if any deletion failed. Empty if all succeeded.
Get Customers
Retrieves customers. Two modes: (1) By ID: provide CustomerIds (single or comma-separated) to get specific customers. (2) List: leave CustomerIds empty to list customers with optional filters (Email, Created date range). List results are paginated — check HasMore and pass NextCursor to StartingAfter for the next page.
Options:
- CustomerIds: Customer ID(s) to retrieve (starts with 'cus_'). Single or comma-separated for multiple. If provided, ignores all filter/pagination params. Leave empty for list mode. Obtain from: stripe_create_customer CustomerId output field, stripe_get_customers Customers[].id field, or Dashboard → Customers page.
- Email: Filter customers by exact email address match (case-insensitive). Only used in list mode. Example: 'customer@example.com'.
- Limit: Number of customers per page (1-100). Only used in list mode. Default: 10.
- StartingAfter: Customer ID for getting the next page (customers listed after this one). How to use: 1) First request: leave empty. 2) If response HasMore=true, copy NextCursor value here for the next page. Cannot be used with EndingBefore. Only used in list mode.
- EndingBefore: Customer ID for getting the previous page (customers listed before this one). Use when you want to go back to earlier results. Cannot be used with StartingAfter. Only used in list mode.
- Created: Filter by creation date using Unix timestamps (seconds since 1970-01-01 00:00:00 UTC). Provide an object with comparison operators: 'gte' (>=), 'lte' (<=), 'gt' (>), 'lt' (<). Operators can be combined to create date ranges. Common values: 2024-01-01 = 1704067200, 2024-06-01 = 1717200000, 2025-01-01 = 1735689600. Example: {"gte": 1704067200, "lte": 1706745599} (finds customers created in January 2024). Only used in list mode.
Output:
- Customers (object-array): Array of customer objects. Each contains: id (string, starts with 'cus_'), object (string, always 'customer'), email (string or null), name (string or null), created (number, Unix timestamp), currency (string or null, ISO 4217 code e.g. 'usd'), balance (number, cents; negative means customer owes money), metadata (object, custom key-value pairs set during creation; common keys: user_id, order_id, plan, source, referral_source; may be empty {}), default_source (string or null, ID of default payment source). Empty array if failed.
- CustomerData (object): Complete API response object. Structure depends on mode: ID-based mode (CustomerIds provided) — {data: [customer objects]}; List mode (CustomerIds empty) — {object (string, 'list'), data (array of customer objects), has_more (boolean, same as HasMore field), url (string, API path)}. Use the Customers field for easier access to customer data. Empty object if failed.
- TotalCount (number): Number of customers in the current page. 0 if failed.
- HasMore (bool): Whether more customers exist beyond this page. If true, pass NextCursor to StartingAfter. Always false in ID-based mode.
- NextCursor (string): Last customer ID in this page. Pass to StartingAfter for next page. Empty if last page or ID-based mode.
- OriginalStatusCode (number): Original HTTP status code from API (e.g., 200, 401, 404). Default 0 means request did not reach upstream.
- StatusCode (number): Operation status code: 200=Success (check ErrorMessage for business errors), -1=Parameter validation error, 500=System error.
- ErrorMessage (string): Detailed error message if any error occurred. Empty string on success.
Update Customer
⚠️ UPDATE STRATEGY: This is an incremental update (PATCH mode). Only the fields you provide will be updated; fields you leave empty will keep their original values. This is NOT a full replacement — unprovided fields are preserved. Metadata is merged: new keys added, existing keys updated, omitted keys unchanged. Provide CustomerId (starts with 'cus_') and at least one field to update.
Input Parameters:
- CustomerId: Required. customer ID (starts with 'cus_'). Obtain from stripe_create_customer or stripe_get_customers. Example: 'cus_NffrFeUfNV2Hib'.
Options:
- Email: Updated email address. Optional. Example: 'customer@example.com'.
- Name: Updated customer name. Optional. Example: 'John Doe'.
- Phone: Updated phone number (international format). Optional. Example: '+1-555-0100'.
- Description: Updated description or internal note. Optional. Example: 'VIP customer'.
- Metadata: Custom key-value pairs (object). Merged with existing metadata: new keys added, existing keys updated, omitted keys unchanged. All keys and values must be strings. Example: {"user_id": "12345", "plan": "premium", "source": "trade_show"}
Output:
- Customer (object): Updated customer object from Stripe API. Fields: id (string, starts with 'cus_'), object (string, 'customer'), email (string or null), name (string or null), phone (string or null), description (string or null), metadata (object, custom key-value pairs), created (number, Unix timestamp), livemode (boolean), currency (string or null), default_source (string or null), delinquent (boolean). Empty object if failed.
- CustomerId (string): ID of the updated customer (starts with 'cus_'). Empty string if failed.
- Message (string): Success message. Empty string if failed.
- OriginalStatusCode (number): Original HTTP status code from API. Default 0 means request did not reach upstream.
- StatusCode (number): Operation status: 200=Success (check ErrorMessage), -1=Param error, 500=System error.
- ErrorMessage (string): Detailed error message. Empty string on success.
Add Customer Card
Adds a payment card to a customer. Provide CustomerId (starts with 'cus_') and Source (token like 'tok_visa', source ID, or payment method ID). Returns the card object with CardId.
Input Parameters:
- CustomerId: Required. customer ID (starts with 'cus_'). Obtain from stripe_create_customer or stripe_get_customers. Example: 'cus_NffrFeUfNV2Hib'.
- Source: Required. Payment source: token ('tok_visa'), source ID ('src_xxx'), or payment method ID ('pm_xxx'). Example: 'tok_visa'.
Options:
- Metadata: Custom key-value pairs as JSON string or object. Optional. Example: '{"card_name": "Primary Card"}'.
Output:
- Card (object): Complete card object from API. Contains: id, brand (Visa/MasterCard/Amex), last4, exp_month, exp_year, funding (credit/debit), country. Empty object if failed.
- CardId (string): ID of the added card (starts with 'card_'). Empty string if failed.
- Message (string): Human-readable success message. Empty string if failed.
- OriginalStatusCode (number): Original HTTP status code from API (e.g., 200, 402, 404). Default 0 means request did not reach upstream.
- StatusCode (number): Operation status code: 200=Success (check ErrorMessage for business errors), -1=Parameter validation error, 500=System error.
- ErrorMessage (string): Detailed error message. For card declines, includes decline code. Empty string on success.
Delete Customer Card
WARNING: Permanently deletes a payment card from a customer. This operation cannot be undone. Provide CustomerId and CardId. Returns the deleted card object with Deleted=true.
Input Parameters:
- CustomerId: Required. customer ID (starts with 'cus_'). Obtain from stripe_create_customer or stripe_get_customers. Example: 'cus_NffrFeUfNV2Hib'.
- CardId: Required. Card ID (starts with 'card_') or source ID (starts with 'src_'). Obtain from stripe_add_customer_card or stripe_get_customer_cards. Example: 'card_1MvoiKLkdIwHu7ixOeFGbN9D'.
Output:
- DeletedCard (object): Deleted card object from API. Contains: id, object, deleted (true), brand, last4, exp_month, exp_year. Empty object if failed.
- CardId (string): ID of the deleted card. Empty string if failed.
- Deleted (bool): True if card was successfully deleted, False otherwise.
- Message (string): Human-readable success message. Empty string if failed.
- OriginalStatusCode (number): Original HTTP status code from API (e.g., 200, 404). Default 0 means request did not reach upstream.
- StatusCode (number): Operation status code: 200=Success (check ErrorMessage for business errors), -1=Parameter validation error, 500=System error.
- ErrorMessage (string): Detailed error message if any error occurred. Empty string on success.
Get Customer Cards
Retrieves payment cards for a customer. Two modes: (1) Single card: provide CardId to get one specific card. (2) List: leave CardId empty to list all cards with pagination. When CardId is provided, pagination parameters are ignored.
Input Parameters:
- CustomerId: Required. customer ID (starts with 'cus_'). Obtain from: stripe_create_customer output, stripe_get_customers output, or Stripe Dashboard. Example: 'cus_NffrFeUfNV2Hib'.
Options:
- CardId: Specific card ID to retrieve (starts with 'card_'). If provided, retrieves only this card and ignores pagination parameters. Leave empty to list all cards. Obtain from: stripe_add_customer_card output, or Cards array from this action. Example: 'card_1MvoiKLkdIwHu7ixzhJN2xYZ'.
- Limit: Number of cards per page (1-100). Only used when CardId is empty. Default: 10.
- StartingAfter: Card ID for forward pagination (get next page after this card). How to use: 1) First request: leave empty. 2) If response HasMore=true, copy NextCursor value here. Cannot be used with EndingBefore.
- EndingBefore: Card ID for backward pagination (get previous page before this card). Use when you want to go back to earlier cards. Cannot be used with StartingAfter.
Output:
- Cards (object-array): Array of card objects. Each contains: id (string), brand (string, e.g. 'Visa'), last4 (string, e.g. '4242'), exp_month (number), exp_year (number), funding (string, 'credit'/'debit'), country (string, e.g. 'US'), fingerprint (string). Empty array if failed.
- CardData (object): Complete API response object. For single card mode: the card object itself with all fields. For list mode: contains object (string, 'list'), data (array of card objects, each with id/brand/last4/exp_month/exp_year/funding/country/fingerprint/customer fields), has_more (boolean), url (string). Empty object if failed.
- TotalCount (number): Number of cards in the current page. 0 if failed.
- HasMore (bool): Whether more cards exist beyond this page. If true, pass NextCursor to StartingAfter.
- NextCursor (string): Last card ID in this page. Pass to StartingAfter for next page. Empty if last page.
- OriginalStatusCode (number): Original HTTP status code from API (e.g., 200, 401, 404). Default 0 means request did not reach upstream.
- StatusCode (number): Operation status code: 200=Success (check ErrorMessage for business errors), -1=Parameter validation error, 500=System error.
- ErrorMessage (string): Detailed error message if any error occurred. Empty string on success.
Create Payment Intent
Creates a new Payment Intent. Required: Amount (in cents, e.g. 1000 for $10) and Currency (e.g. 'usd'). Returns PaymentIntentId and ClientSecret for frontend confirmation via Stripe.js. Supports multiple payment methods and 3DS authentication.
Input Parameters:
- Amount: Required. Amount in smallest currency unit. For USD: 1000 = $10.00. For JPY: 1000 = ¥1000. Example: 1000.
- Currency: Required. Three-letter ISO 4217 code in lowercase. Example: 'usd', 'eur', 'gbp'.
Options:
- PaymentMethodTypes: Comma-separated payment methods: 'card', 'alipay', 'wechat_pay', 'us_bank_account', 'sepa_debit'. Default: 'card'.
- Description: Payment description for your records. Optional. Example: 'Order #12345 payment'.
- CustomerEmail: Customer email for receipt. Optional. Example: 'customer@example.com'.
- CustomerId: Stripe customer ID (starts with 'cus_'). Obtain from stripe_create_customer or stripe_get_customers. Optional. Example: 'cus_NffrFeUfNV2Hib'.
- ConfirmationMethod: 'automatic' (default, confirms when payment method provided) or 'manual' (explicit confirm needed).
- Metadata: Custom key-value pairs (object). All keys and values must be strings. Optional. Example: {"order_id": "12345", "source": "web"}.
Output:
- PaymentIntentId (string): ID of the created Payment Intent (starts with 'pi_'). Empty string if failed.
- PaymentIntentData (object): Complete Payment Intent object from Stripe API. Key fields: id (string, starts with 'pi_'), object (string, 'payment_intent'), amount (number, smallest currency unit), currency (string, ISO 4217 lowercase), status (string, see PaymentStatus), client_secret (string), payment_method_types (array of strings), customer (string or null), description (string or null), metadata (object), next_action (object or null), created (number, Unix timestamp), livemode (boolean). Empty object if failed.
- ClientSecret (string): Secret for frontend payment confirmation via Stripe.js. Format: 'pi_xxx_secret_yyy'. Keep confidential. Empty string if failed.
- PaymentStatus (string): Payment lifecycle status. Values: 'requires_payment_method' (awaiting card/method), 'requires_confirmation' (needs explicit confirm call), 'requires_action' (3DS or redirect needed, check NextAction), 'processing' (bank is processing), 'succeeded' (payment complete), 'canceled' (intent canceled). Empty string if failed.
- NextAction (object): Next action required when PaymentStatus is 'requires_action'. Key fields: type (string, e.g. 'redirect_to_url' for 3DS, 'use_stripe_sdk' for in-app), redirect_to_url.url (string, redirect user here for 3DS authentication), redirect_to_url.return_url (string, return destination after auth). Empty object if no action required.
- OriginalStatusCode (number): Original HTTP status code from API (e.g., 200, 400, 402). Default 0 means request did not reach upstream.
- StatusCode (number): Operation status code: 200=Success (check ErrorMessage for business errors), -1=Parameter validation error, 500=System error.
- ErrorMessage (string): Detailed error message. For payment failures, includes decline code. Empty string on success.
Create Payment Method
Creates a new PaymentMethod object via Stripe Payment Methods API (replaces deprecated Sources API). Required: PaymentMethodType (e.g. 'card', 'sepa_debit'). Optionally attach to a Customer by providing CustomerId. Returns PaymentMethodId ('pm_') for use with Create Payment Intent.
Input Parameters:
- PaymentMethodType: Required. Payment method type to create. Valid values and use cases: 'card' (credit/debit card, global, requires frontend Stripe.js), 'sepa_debit' (SEPA bank transfer, Eurozone), 'us_bank_account' (ACH transfer, US only), 'ideal' (iDEAL, Netherlands), 'bancontact' (Belgium), 'giropay' (Germany), 'sofort' (Europe), 'alipay' (requires cross-border setup), 'wechat_pay' (requires cross-border setup), 'klarna' (buy now pay later, Europe/NA), 'afterpay_clearpay' (US, UK, AU), 'link' (Stripe Link). Example: 'sepa_debit'.
Options:
- BillingName: Billing cardholder or account holder full name. Optional. Example: 'Jane Doe'.
- BillingEmail: Billing contact email address. Optional. Example: 'jane@example.com'.
- BillingPhone: Billing contact phone number including country code. Optional. Example: '+1-555-0100'.
- BillingAddress: Billing address as an object. Optional. Supported keys: line1 (street address), line2 (apt/suite), city, state, postal_code, country (ISO 3166 2-letter code). Example: {"line1": "123 Main St", "city": "New York", "state": "NY", "postal_code": "10001", "country": "US"}.
- CustomerId: Stripe Customer ID (starts with 'cus_') to attach this payment method to after creation. Optional. Obtain from stripe_create_customer. Example: 'cus_NffrFeUfNV2Hib'.
- Metadata: Custom key-value pairs as an object for internal tracking. Optional. Common keys: order_id (order number), source (acquisition channel), campaign (marketing campaign), customer_segment. Example: {"order_id": "12345", "source": "web", "campaign": "summer_sale"}.
- IdempotencyKey: Optional idempotency key (UUID format) to prevent duplicate PaymentMethod creation on request retry. Stripe returns the same result for the same key within 24 hours. Recommended when network timeout is possible. Example: '550e8400-e29b-41d4-a716-446655440000'.
Output:
- PaymentMethodId (string): ID of the created PaymentMethod (starts with 'pm_'). Use this with Create Payment Intent. Empty string if failed.
- PaymentMethodType (string): Type of the payment method created, e.g. 'card', 'sepa_debit', 'ideal'. Empty string if failed.
- CustomerId (string): Stripe Customer ID (starts with 'cus_') the payment method was attached to. Empty string if not attached to a customer.
- PaymentMethodData (object): Complete PaymentMethod object from Stripe API. Key fields: id (string), type (string), billing_details.name, billing_details.email, billing_details.phone, billing_details.address (line1, line2, city, state, postal_code, country), customer (string, null if detached), created (Unix timestamp), livemode (bool). For 'card' type also includes card.brand, card.last4, card.exp_month, card.exp_year. Empty object if failed.
- OriginalStatusCode (number): Original HTTP status code from upstream API. Default 0 = request did not reach upstream.
- StatusCode (number): Operation status: 200=Success (check ErrorMessage for business errors), -1=Parameter error, 500=Network error.
- ErrorMessage (string): Error details if any error occurred. Empty string on success.
Detach Payment Method
Detaches a PaymentMethod from its associated Customer via Stripe Payment Methods API (replaces deprecated Delete Source). Required: PaymentMethodId (starts with 'pm_'). The payment method must be attached to a customer. Returns Detached=true and the previous CustomerId on success.
Options:
- PaymentMethodId: Required. Stripe PaymentMethod ID to detach from its customer (starts with 'pm_'). Obtain from stripe_create_payment_method or stripe_get_payment_method. The payment method must be currently attached to a customer. Example: 'pm_1PJaseCQ7xV0Lad3XyZKM8HX'.
Output:
- PaymentMethodId (string): ID of the detached PaymentMethod (starts with 'pm_'). Empty string if operation did not reach this step.
- Detached (bool): True if the payment method was successfully detached from its customer. False if detach failed or the method was not attached to any customer.
- CustomerId (string): The Customer ID (starts with 'cus_') the payment method was detached from. Empty string if it was not attached to any customer.
- PaymentMethodData (object): Complete PaymentMethod object returned by Stripe after detach. Key fields: id, type, customer (null after detach), billing_details, created. Empty object if failed.
- OriginalStatusCode (number): Original HTTP status code from upstream API. Default 0 = request did not reach upstream.
- StatusCode (number): Operation status: 200=Success (check ErrorMessage for business errors), -1=Parameter error, 500=Network error.
- ErrorMessage (string): Error details if any error occurred. Empty string on success.
Get Payment Method
Retrieves a PaymentMethod object by ID via Stripe Payment Methods API (replaces deprecated Get Source). Required: PaymentMethodId (starts with 'pm_'). Returns full PaymentMethod details including type, billing info, and attached customer.
Options:
- PaymentMethodId: Required. Stripe PaymentMethod ID to retrieve (starts with 'pm_'). Obtain from stripe_create_payment_method action or Stripe Dashboard. Example: 'pm_1PJaseCQ7xV0Lad3XyZKM8HX'.
Output:
- PaymentMethodId (string): ID of the retrieved PaymentMethod (starts with 'pm_'). Empty string if not found.
- PaymentMethodType (string): Type of the payment method, e.g. 'card', 'sepa_debit', 'ideal', 'alipay'. Empty string if not found.
- CustomerId (string): Stripe Customer ID (starts with 'cus_') the payment method is attached to. Empty string if not attached.
- Status (string): Payment method status string if available. Typically empty for detached payment methods.
- BillingDetails (object): Billing details object. Key fields: name (string), email (string), phone (string), address (object with line1, line2, city, state, postal_code, country). Empty object if not set.
- Created (number): Unix timestamp (seconds) when the PaymentMethod was created. 0 if not found.
- PaymentMethodData (object): Complete PaymentMethod object from Stripe API. Key fields: id, type, billing_details, customer, card (if card type: brand, last4, exp_month, exp_year), created, livemode. Empty object if failed.
- OriginalStatusCode (number): Original HTTP status code from upstream API. Default 0 = request did not reach upstream.
- StatusCode (number): Operation status: 200=Success (check ErrorMessage for business errors), -1=Parameter error, 500=Network error.
- ErrorMessage (string): Error details if any error occurred. Empty string on success.
5. Example Usage
This section will guide you through creating a simple workflow to add a new customer to your Stripe account.
The workflow will consist of three nodes: Start -> Create Stripe Customer -> Answer.
1. Add the Tool Node
- In the workflow canvas, click the "+" button to add a new node.
- In the panel that appears, select the "Tools" tab.
- Find and select "Stripe" from the list of tools.
- In the list of supported operations for Stripe, click "Create Stripe Customer" to add the node to the canvas.
2. Configure the Node
- Click on the newly added "Create Stripe Customer" node to open its configuration panel on the right.
- Credentials: Find the credentials field at the top of the panel. Click the dropdown menu and select your pre-configured Stripe credentials.
- Parameters: Fill in the necessary input parameters for the operation.
- Email: Enter the customer's email address, for example, jane.doe@example.com.
- Name: Enter the customer's full name, for example, Jane Doe.
- Description: You can add an optional description, such as New lead from website.
3. Run and Validate
- Once all required parameters are correctly filled, any error indicators on the workflow canvas will disappear.
- Click the "Run" button in the top-right corner of the canvas to execute the workflow.
- After a successful execution, you can click the log icon in the top-right corner to view the detailed input and output of the node. Check the output for a CustomerId to confirm that the customer was created successfully.
After completing these steps, your workflow is fully configured. When you run it, a new customer will be created in your Stripe account.
6. FAQs
Q: Why am I getting a 401 Unauthorized error?
A: This error typically indicates an issue with your API key. Please check the following:
- Ensure you are using the correct Secret Key from your Stripe Dashboard.
- Verify that the key has not been revoked or expired.
- Confirm that the key has the necessary permissions to perform the requested operation.
Q: How should I format the Amount parameter for charges or payment intents?
A: The Amount parameter must be provided in the smallest currency unit. For example:
- For USD, to charge $10.50, you should provide the value 1050.
- For JPY (a zero-decimal currency), to charge ¥500, you should provide the value 500.
Q: What is the difference between a Source and a Payment Intent?
A: The Payment Intents API is the modern, recommended way to handle payments in Stripe. It automatically handles requirements like Strong Customer Authentication (SCA). The Sources API is a legacy method for accepting various payment methods. For new integrations, you should always prefer using Payment Intents.
7. Official Documentation
For more in-depth information and advanced use cases, please refer to the Stripe Official API Documentation.
Leave a Reply.