#geewee-ProductId

1 messages · Page 1 of 1 (latest)

marble badger
#

Hi there, are you setting the product ID by yourself?

opal tapir
#

Yeah I'm specifying the product_id manually via the API - felt like the easiest way to see if I could provoke a collision

marble badger
#

So you want to mange the IDs by yourself and ensure all of them are unqiue?

opal tapir
#

Basically, I'm building a service that interacts with the stripe API. I want to save some metadata related to each product.

I wanted to know if I can save the data, keyed by "product_id" as a key (as it would always be unique), or if I need to save it with both product_id and account_id, as the product_id is only unique inside each account.

marble badger
#

if the product ID is generated by Stripe, then you can rest assured that it's globally unqiue.

opal tapir
#

Is there any way I can tell whether or not the product_id is generated by Stripe? I have just manually created a product with the same ID, as another product in another account, so I'm assuming there's potential for collisions there?

marble badger
#

If you specify the ID when creating a product, Stripe will generate one for you.

opal tapir
#

Right, but let's take an example.
The first image is a "real" product from one account
The second image is a product I've created on a different account, but manually specifying the ID to be the same as the first product.
Notice that the ids are both identical.

So I guess I can't count on product_id's being unique?

marble badger
#

That's because you set it manually.