#Tobq
1 messages · Page 1 of 1 (latest)
Easiest way to do this going forward is to use Customer objects and associate each invoice with a customer on creation: https://stripe.com/docs/api/invoices/create#create_invoice-customer
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
@torpid wedge are you a bot
No why
idk the name
doens't stripe automatiaclly create a customer on subscriptions?
im handling the "invoice.paid" event
not sure how I'm supposed to know who this "invoice" is for?
No customers aren't automatically created when you create a subscription. In fact, you need to pass the customer to the subscription creation request: https://stripe.com/docs/api/subscriptions/create#create_subscription-customer. Maintaining customer objects is how you keep track of who the invoice is for
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
so the invoices are literally meaningless if I havent setup customers?
In fact, you need to pass the customer to the subscription creation request
I think I created sessions without customers
whats the difference between "checkout"?
It's the Stripe hosted payment page
oh i can build my own?
You can have your own payment form that uses the Stripe API, yes
so with checkout, is it not creating customers?
i assume it internally uses that subscription api
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
which you said requires customers
Depends on that setting ^
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
There's also a dashboard concept of guest customers
But if you need to tie invoices to individual customers, I highly recommend creating the customer objects
Yep that's recommended
so in all:
start subscription
if (existsCustomer(userId))
customer = getCustomer(userId)
else
customer = createCustomer(metadata = userId)
startCheckout(customer, product)
invoice paid event
customer = getCustomer(invoice.customer_id)
user = customer.metadata
@torpid wedge
Yeah logically that makes sense