#billymeetssloth-errors
1 messages · Page 1 of 1 (latest)
Is there a character limit to promotion codes etc
Hi, can you give example of those errors?
Sure
was making a promotion code
and had the value
code: ${account.properties.accountId}-purchase-on-sign-up,
account id is a UUID
produces 7a331f42-c59d-493c-acad-64d56c6399f3-purchase-on-sign-up
hmm I see, and how is the API response
i read further into the docs, realized i dont need to make specific promotion codes
as long as i tie it to a customer, i can reuse same code
so thats great
but yeah, one sec, resposne from server was
{"message":"This value must match the regex pattern. (/\A[a-zA-Z0-9]+\z/ does not match for the value af7d25a1-08fd-43bf-8ec8-30560371bd57-purchase-on-sign-up).
","stack":["Error: This value must match the regex pattern. (/\A[a-zA-Z0-9]+\z/ does not match for the value af7d25a1-08fd-43bf-8ec8-30560371bd57-purchase-on-sign-up).","
at Function.generate (/opt/veedback/account/node_modules/stripe/lib/Error.js:40:16)","
at IncomingMessage.<anonymous> (/opt/veedback/account/node_modules/stripe/lib/StripeResource.js:180:33)","
at Object.onceWrapper (events.js:421:28)","
at IncomingMessage.emit (events.js:327:22)","
at IncomingMessage.EventEmitter.emit (domain.js:547:15)","
at endReadableNT (_stream_readable.js:1218:12)"," at processTicksAndRejections (internal/process/task_queues.js:84:21)"]}
That is fine if stripe has a limit on characters n stuff
dont mind
just want to know what they are so im not guessing what is valid and what is not
when i read that regex it says, Alphanumeric and thats it
/\A[a-zA-Z0-9]+\z/
i forget what \A does and \z
Yeah it's alphanumeric. I also can't find anywhere in the Doc mentioned that (sorry). But it's alphanumeric
sure sure not a problem
so there isnt any place thats like "Hey, these are how we define these types" in the docs
It should be here https://stripe.com/docs/api/promotion_codes/create#create_promotion_code-code Agree that we should improve the Doc
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
so the regex doesnt specify a length, you know off the top of your head what the max promotion code string length is? 255?
Not that i plan to pass a 255 long promotion code, but just dont want to find out its like 10 or something
Yeah let me try to find that limit
I can confirm the regex is /\A[a-zA-Z0-9]+\z/, which mean Alphanumeric, but no length check so far.
Hey @dawn cape its all good. I dont plan to make anything longer than 10 characters long, no way i will probably butt up against your limit. So if its some deep pain in the butt thing to look up, no need. I feel confident moving forward