1select
2 id
3 , customer_id
4 , start_date
5 , canceled_at
6 , id as subscription_id
7 , status
8from
9 {{raw.stripe.subscription}}Example output
+-----------+------------+---------------------+---------------------+----------------+---------+
| id | customer_id| start_date | canceled_at | subscription_id| status |
+-----------+------------+---------------------+---------------------+----------------+---------+
| sub_001 | cus_001 | 2023-01-01 00:00:00 | | sub_001 | active |
| sub_002 | cus_002 | 2023-01-02 00:00:00 | | sub_002 | active |
| ... | ... | ... | ... | ... | ... |
| sub_248 | cus_248 | 2023-01-30 00:00:00 | | sub_248 | active |
| sub_249 | cus_249 | 2023-01-31 00:00:00 | 2023-01-31 00:00:00 | sub_249 | canceled|
| sub_250 | cus_250 | 2023-01-31 00:00:00 | 2023-01-31 00:00:00 | sub_250 | canceled|
| sub_251 | cus_251 | 2023-02-01 00:00:00 | | sub_251 | active |
| ... | ... | ... | ... | ... | ... |
| sub_279 | cus_279 | 2023-02-28 00:00:00 | 2023-02-28 00:00:00 | sub_279 | canceled|
| sub_280 | cus_280 | 2023-02-28 00:00:00 | 2023-02-28 00:00:00 | sub_280 | canceled|
| sub_281 | cus_281 | 2023-03-01 00:00:00 | | sub_281 | active |
| ... | ... | ... | ... | ... | ... |
| sub_314 | cus_314 | 2023-03-31 00:00:00 | | sub_314 | active |
| sub_315 | cus_315 | 2023-03-31 00:00:00 | 2023-03-31 00:00:00 | sub_315 | canceled|
+-----------+------------+---------------------+---------------------+----------------+---------+This SQL model enables businesses to quickly gather a holistic view of their Stripe subscriptions. By listing out essential details like subscription ID, associated customer ID, start date, potential cancellation date, and the subscription's status, businesses can efficiently manage and track their billing processes. This insight is crucial for maintaining customer relationships and ensuring a smooth subscription experience for users.