Local storage of PaymentIntent ID and client_secret

107 views
Skip to first unread message

EML

unread,
Jan 26, 2023, 12:26:02 PM1/26/23
to Stripe API Discussion
Can I  make any assumptions about the maximum length of the ID and client secret, for database storage? At the moment, I'm seeing 27-char IDs, and 60-char client secrets. However, a quick look at the API spec on github seems to indicate a maximum length of 5000 chars for each.

Remi J.

unread,
Jan 26, 2023, 12:30:32 PM1/26/23
to api-d...@lists.stripe.com
Hello,

We can change the length of our ids at any time and have done this regularly over the years. Our documentation page on backwards compatible changes here [1] says:

You can safely assume object IDs we generate will never exceed 255 characters, but you should be able to handle IDs of up to that length.

Now, it's important to note that this applies to API resource ids like a Customer id `cus_123` or a PaymentIntent id `pi_123`. It does not apply to other properties that would have their own individual limit, if any, like a Charge's description. For a `client_secret` for example, since it contains the id of a PaymentIntent, it could technically be longer than 255 characters, if the PaymentIntent id was that length. We don't have a specific maximum at the moment so it uses our global default of 5000 which you found!

I hope this helps!
Best,
Remi 


On Thu, Jan 26, 2023 at 9:26 AM EML <elave...@gmail.com> wrote:
Can I  make any assumptions about the maximum length of the ID and client secret, for database storage? At the moment, I'm seeing 27-char IDs, and 60-char client secrets. However, a quick look at the API spec on github seems to indicate a maximum length of 5000 chars for each.

--
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.

EML

unread,
Jan 26, 2023, 3:18:57 PM1/26/23
to Stripe API Discussion, re...@stripe.com
Hi Remi - thanks - I've got the ID as a SQL varchar(255), and the client secret as a varchar(5000).
Reply all
Reply to author
Forward
0 new messages