#billymeetssloth-errors

1 messages · Page 1 of 1 (latest)

dawn cape
true stag
#

Is there a character limit to promotion codes etc

dawn cape
#

Hi, can you give example of those errors?

true stag
#

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

dawn cape
#

hmm I see, and how is the API response

true stag
#

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

dawn cape
#

Yeah it's alphanumeric. I also can't find anywhere in the Doc mentioned that (sorry). But it's alphanumeric

true stag
#

sure sure not a problem

#

so there isnt any place thats like "Hey, these are how we define these types" in the docs

dawn cape
true stag
#

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

dawn cape
#

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.

true stag
#

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

dawn cape
#

Actually I just found the answer by trying the API myself

#

It can not go over 500 characters, but this is a limit applies to every string value, not just this parameter, I think

true stag
#

lol, thanks! 😄

#

I guess thats one way to find the answer

#

hahahahaha

#

i love it