(no title)
vincentdm | 1 year ago
Imagine you prefix all customer IDs with `cus_`, but at some point decide to rename Customer to Organization in your codebase (e.g. because it turns out some of the entities you are storing are not actually customers). Now you have some legacy prefix that cannot be changed, is permanently out of sync with the code and will confuse every new developer.
codeulike|1 year ago
shawabawa3|1 year ago
Yes you can.
You can support the old cus_<ID> prefix as well as the new org_<ID> prefix, but always return org_<ID> from now on
wongarsu|1 year ago
Though I believe they mostly do it because their IDs are sequential, so without prefix you wouldn't easily notice if you use the wrong kind of id. They also only apply prefixes at the api boundary when they base36 encode the IDs, the database stores integers
chuckadams|1 year ago