#Dr. Strain-customer-custom-id

1 messages · Page 1 of 1 (latest)

green python
#

No, there isn't a way to set a custom ID when you create a Stripe customer. Instead, you can store that ID in metadata on the Customer

plucky spear
#

Would that be an effective way to prevent stripe from creating a new customer every time I make a new subscription?

green python
#

How are you creating subscriptions? Through Checkout or with the Subscriptions API?

plucky spear
#

Checkout

green python
#

Gotcha - so to prevent creating a new customer you'll have to add logic on your end to check if they user already has a Customer tied to them, and if they do, you'd pass in the customer when you create the Checkout Session (https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer)

plucky spear
#

So, can I search for a metadata value? Or does my server have to store their customer id and their GUID in a map

green python
#

Your server would have to store the customer ID <-> GUID relationship. We do have a search API (https://stripe.com/docs/search-api) that would allow you to search for metadata but it's currently in beta, and you'd have to sign up and apply for acces

Look up objects in your Stripe data.

plucky spear
#

k, Thank you for the help