Stripe - Create Subscription
Description
Section titled “Description”This module allows you to create recurring subscriptions for customers, linking them to a price/product and configuring options such as trial period, coupons, and collection method.
Configuration
Section titled “Configuration”Required Credentials
Section titled “Required Credentials”- Secret Key: Stripe secret key
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
| credentials_id | credential | Yes | Stripe credentials |
| customer_id | string | Yes | Customer ID (cus_xxx) |
| price_id | string | Yes | Price ID (price_xxx) |
| quantity | number | No | Quantity (default: 1) |
| default_payment_method | string | No | Default payment method |
| trial_period_days | number | No | Trial period days |
| collection_method | select | No | Collection method |
| days_until_due | number | No | Days to pay invoice |
| coupon | string | No | Coupon code |
| cancel_at_period_end | boolean | No | Cancel at end of period |
| metadata | string | No | Custom metadata (JSON) |
Output
Section titled “Output”{ "success": true, "subscription": {...}, "subscription_id": "sub_1MowQVLkdIwHu7ixeRlqHVzs", "status": "active", "current_period_start": 1679609767, "current_period_end": 1682288167, "message": "Suscripción sub_1MowQV... creada (active)"}Usage Example
Section titled “Usage Example”Simple subscription
Section titled “Simple subscription”{ "customer_id": "cus_NffrFeUfNV2Hib", "price_id": "price_1MoC3cLkdIwHu7ixFd9J0pzG"}Subscription with trial period
Section titled “Subscription with trial period”{ "customer_id": "cus_NffrFeUfNV2Hib", "price_id": "price_1MoC3cLkdIwHu7ixFd9J0pzG", "trial_period_days": 14, "default_payment_method": "pm_1234567890"}Subscription with coupon
Section titled “Subscription with coupon”{ "customer_id": "cus_NffrFeUfNV2Hib", "price_id": "price_1MoC3cLkdIwHu7ixFd9J0pzG", "coupon": "DESCUENTO20", "metadata": "{\"plan_name\": \"Premium\"}"}Subscription with invoice
Section titled “Subscription with invoice”{ "customer_id": "cus_NffrFeUfNV2Hib", "price_id": "price_1MoC3cLkdIwHu7ixFd9J0pzG", "collection_method": "send_invoice", "days_until_due": 30}API Used
Section titled “API Used”- Endpoint:
POST /v1/subscriptions - Documentation: Stripe Create Subscription
- The customer must have a valid payment method
- Prices must be previously configured in Stripe
- The trial period does not charge the customer
collection_method: send_invoicesends an invoice by email
Related Nodes
Section titled “Related Nodes”- StripeGetSubscriptions - Get and search existing subscriptions
- StripeCancelSubscription - Cancel active subscriptions
- StripeGetCustomers - Get customer data
- StripeCreateCustomer - Create the customer before subscribing
- StripeGetInvoices - Get invoices generated by the subscription