#jacobwolf
1 messages · Page 1 of 1 (latest)
Create Customer is not a function to call from JS. It should be called on server side, using a secret key
Right. What I mean is this
Is there a way, after that stripe.customers.create, that I'm able to get a returned ID?
So then I can have it execute another function (create subscription) from the user it just created?
ah okie so this is Node.js?
Yes
the customer as response from stripe.customers.create should be an object with an ID, no?
So the code would be similar to what’s return from the lookup?
Trying to avoid it duplicating customers
The look up would returns a list, and this customer is just 1 object
Sorry for what may be a stupid question. Been a long time since I’ve used Node JS. Been focused on React and front end
https://stripe.com/docs/api/customers/create on "Returns"
Returns the customer object if the update succeeded. Raises an error if create parameters are invalid (e.g. specifying an invalid coupon or an invalid source).
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 worry. You can add a log after calling it to see its content
like console.log(customer);