#JCoDog-SubscriptionWebhooks
1 messages · Page 1 of 1 (latest)
See https://stripe.com/docs/billing/subscriptions/webhooks for the list of situations to handle
(plus the links at the bottom of that article)
I have my stripe setup to send the customer emails, so do I need to also send them?
Do you mean Stripe is sending the emails, or you have set it up that you manually send your own custom ones?
stripe is sending I think. I set it up
https://stripe.com/docs/receipts#receipts-with-billing details what we send for Subscriptions then
Does stripe send anything about the upcoming payment?
That's one of the options on https://dashboard.stripe.com/settings/billing/automatic (take a look at that page to see what we can send)
It should
Can I send data into the subscription via meta to link it to specific things in my database?
Sure, metadata is perfect for that.
So in the create-checkout-session I would just add "meta" => "value" right?
https://stripe.com/docs/api/metadata has the details and you'd use the field in https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data-metadata which sets it on the Subscription (instead of the CheckoutSession itself)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok. What is create-portal-session doing?
Can you elaborate? Not sure what you mean by create-portal-session
Ah, that's the BillingPortal (which is different from a CheckoutSession). https://stripe.com/docs/billing/subscriptions/customer-portal
Ok so other than the method it shows, can I call the portal using a customer ID?
linked via the meta, or do I need to save the checkout session ID?
If and when you want to send them to the BillingPortal, you use the Customer's id, yes.
So when the subsctiption is made, I can use the webhook to save their customer ID?
I also dont see anywhere with my lookup ID for the subscription I made
The webhook events will have the Subscription details, yes. The subscription will have a customer field with the Customer id as well.
Ok and with the lookupID is that just product ID?
Where are you seeing lookupID?
Not 100% sure what that is but I'd guess it's passed for metadata.
No...
Its used to start the checkout
Sorry have to brb, but I cant find a lookup key
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok how do I add a lookup key to a price or product to use that?
You'd update https://stripe.com/docs/api/prices/update#update_price-lookup_key on the Price
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Not on the Dashboard, no. It's not exposed there.
ok... can I make the checkout show two prices the user selects there via a product lookup key instead?
or do I have to start checkout with the price id
You'd need to use the Price ids and pass them in https://stripe.com/docs/api/customer_portal/configurations/create#create_portal_configuration-features-subscription_update-products-prices
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
wait, no, that's the Billing Portal, misread your question
You can't offer a selection in Checkout, just a specific setup.
Ok thank you
Just reading about somethign i am setting up to get metadata to pass in
How do I update the price? I cant see where to do that...
There's only a small set of parameters you can update in https://stripe.com/docs/api/prices/update -- anything else you'd just create a new price
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
No I mean to make it show the lookup key. How do I update that? From command line?
When you say "update that" do you mean change what a given Price's lookup_key is set to be?
yes
and you're using stripe-cli right?
No I have a php website
Does it matter what I use to update it because I can use the CLI if it is easier
Oh no it doesn't matter, just making sure what you mean by using the CLI.
The POST request is https://stripe.com/docs/api/prices/update?lang=php#update_price-lookup_key (there's a cURL version in the examples as well if that's what you want)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I can install the stripe CLI
it might be easier as I dont want to mess with my site to update a price
Either way works.
The format for updating the lookup_key would be (filling in your own Price's id and desired lookup_key value):
stripe prices update price_abc123 -d lookup_key=testing_key
ok seems the \ confused me in the docs
Will checkout let me add multiple things to it for payment, or just one product?
Because I have a setup fee for the service and want to get the first payment of subscription with setup fee
Or is it not possible to do a subscription and a one time payment at the same time?
So for line_items (https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items) you can pass any combination of recurring and one-time Prices. Checkout will know which is which and use the one-time ones as "just the first invoice" items alongside your recurring ones.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
yes