They key is just the name/identifier of the parameter (it can literally be anything you want to call it). And the value is the value of that parameter (i.e. the Subscription ID).
So, again, the URL can be https://api.stripe.com/v1/subscriptions/[sub_ID]
In this case the Key is sub_ID
- but you can call it anything you like (subscription_ID, parameter1, URL Path, Mr Smith - literally anything, it makes no difference) , although obviously something descriptive, that you’ll recognise when you need to define it on your pages, is the most sensible thing to do.
And the value is, in this case, a Subscription ID. On your pages that will obviously be a dynamic value (i.e. the ID of the particular subscription you’re trying to retrieve), but in the API connector, in order to initialize the call, it has to be a specific valid Subscription ID.
Thing to achieve 1
User logs into my app where I display Text saying “You are NOT subscribed”.Thing to achieve 2
User clicks subscribe from within my app and goes to Stripe
User fills out card details and subscribes
I display Text on my app saying “You are subscribed”.Thing to achieve 3
User payment is declined
I display Text on my app saying “Your payment was declined, please update card details”.Thing to achieve 4
User clicks unsubscribe from within my app and goes to Stripe
User clicks unsubscribe within Stripe
I display Text on my app saying “You have unsubscribed but you can still enjoy using the app until xx.xx.xxxx”.
All of that is very simple, and none of it requires anything to do with webhooks if you’re simply getting the subscription data from Stripe via an API call and displaying it on the page as and when you need it (although obviously, if you’re getting it from your own database instead then you’ll need to use webhooks, or I suppose recurring API calls, to set that data in the first place).
Although, at this point I’m really not sure I really understand your app, or what your users are paying for?..
Surely your customers are paying for more than just a message saying “You are subscribed”? Surely they’re getting more than that in return for their subscription payment? (other things must be required to happen upon successful payment, surely?)
And if their payment fails, all that happens is they see a message saying “Your payment was declined, please update card details”? So where’s the incentive to pay? What are they paying for exactly? And what will they lose if they don’t pay?
And if they unsubscribe, and cancel their payment, nothing happens apart from they see a message saying “You have unsubscribed but you can still enjoy using the app until xx.xx.xxxx” (surely they’ll lose access to your app after that?)
So, surely you’re going to need to use webhooks to manage all of that?