This section goes over how to retrieve subscription details using the 'Stripe - GET Subscription details' data call and shows the full response.
How to use the data call
As this is a data call, you can access it using the 'Get data from an external API' Bubble expression. To retrieve the details regarding a subscription we use the 'Stripe - GET Subscription details' option that comes with the plugin.
This call needs the Account ID value from the connected account associated with the subscription and Subscription ID value from the subscription you want to retrieve.
You will have access to a bunch of values like the subscription status (which will be 'cancelled' when you cancel a subscription) (you can see the full response below).
Full response
plain text{ "id": "sub_1KkvXjQ5aFtJWpjqtAdwelQl", "object": "subscription", "application_fee_percent": 20, "automatic_tax": { "enabled": false }, "billing_cycle_anchor": 1649100387, "billing_thresholds": null, "cancel_at": null, "cancel_at_period_end": false, "canceled_at": 1649100910, "collection_method": "charge_automatically", "created": 1649100387, "current_period_end": 1651692387, "current_period_start": 1649100387, "customer": "cus_LRpCEOb5YLZCpJ", "days_until_due": null, "default_payment_method": "pm_1KkvXhQ5aFtJWpjqWFI4WB2d", "default_source": null, "discount": null, "ended_at": 1649100910, "items": { "object": "list", "data": [ { "id": "si_LRpCqqz1vrcRL9", "object": "subscription_item", "billing_thresholds": null, "created": 1649100387, "plan": { "id": "price_1KkvW0Q5aFtJWpjqT6caTDEB", "object": "plan", "active": false, "aggregate_usage": null, "amount": 1000, "amount_decimal": "1000", "billing_scheme": "per_unit", "created": 1649100280, "currency": "usd", "interval": "month", "interval_count": 1, "livemode": false, "nickname": null, "product": "prod_LRp8N5AHZQZP2m", "tiers": null, "tiers_mode": null, "transform_usage": null, "trial_period_days": null, "usage_type": "licensed" }, "price": { "id": "price_1KkvW0Q5aFtJWpjqT6caTDEB", "object": "price", "active": false, "billing_scheme": "per_unit", "created": 1649100280, "currency": "usd", "livemode": false, "lookup_key": null, "nickname": null, "product": "prod_LRp8N5AHZQZP2m", "recurring": { "aggregate_usage": null, "interval": "month", "interval_count": 1, "trial_period_days": null, "usage_type": "licensed" }, "tax_behavior": "unspecified", "tiers_mode": null, "transform_quantity": null, "type": "recurring", "unit_amount": 1000, "unit_amount_decimal": "1000" }, "quantity": 1, "subscription": "sub_1KkvXjQ5aFtJWpjqtAdwelQl" } ], "has_more": false, "total_count": 1, "url": "/v1/subscription_items?subscription=sub_1KkvXjQ5aFtJWpjqtAdwelQl" }, "latest_invoice": "in_1KkvXjQ5aFtJWpjq32gLS7EB", "livemode": false, "next_pending_invoice_item_invoice": null, "pause_collection": null, "payment_settings": { "payment_method_options": null, "payment_method_types": null }, "pending_invoice_item_interval": null, "pending_setup_intent": null, "pending_update": null, "plan": { "id": "price_1KkvW0Q5aFtJWpjqT6caTDEB", "object": "plan", "active": false, "aggregate_usage": null, "amount": 1000, "amount_decimal": "1000", "billing_scheme": "per_unit", "created": 1649100280, "currency": "usd", "interval": "month", "interval_count": 1, "livemode": false, "nickname": null, "product": "prod_LRp8N5AHZQZP2m", "tiers": null, "tiers_mode": null, "transform_usage": null, "trial_period_days": null, "usage_type": "licensed" }, "quantity": 1, "schedule": null, "start_date": 1649100387, "status": "canceled", "tax_percent": null, "test_clock": null, "transfer_data": null, "trial_end": null, "trial_start": null }