#sapir.asras

1 messages · Page 1 of 1 (latest)

rocky steppeBOT
grim gulch
#

should I send the phone number in international format only for the person object?

#

and for companies send the phone number as it is?

slow arrow
#

Hi there, I noticed you've inserted many spaces into the phone number " 1 234 204 3879". A valid phone number should look like "+12342043879"

grim gulch
#

and I send it with +1 and it ignores the +

#

-d "company[phone]"="+12342043879"

slow arrow
grim gulch
#

this is the way I send it:
-d "company[phone]"="+12342043879"
I'm not sure why it's adding an extra space

slow arrow
#

-d "company[phone]"=+12342043879

#

Try this

grim gulch
slow arrow
#

Send me your full Stripe CLI command

grim gulch
#

with the live key?

slow arrow
#

No, without the live key.

grim gulch
#

curl https://api.stripe.com/v1/accounts/acct_1K6xCM2HOUDgIskJ \ -d "company[phone]"=+12342043879"

slow arrow
#

Change -d "company[phone]"=+12342043879"
to
-d "company[phone]"=+12342043879

grim gulch
slow arrow
#

Show me your full command?

grim gulch
#

curl https://api.stripe.com/v1/accounts/acct_1K6xCM2HOUDgIskJ \ -d "company[phone]"=+12342043879

slow arrow
#

looks like it's a problem of how curl interpret the post data

grim gulch
#

but for person object it works fine

#

the same update

slow arrow
#

-d "company[phone]"="%2B12342043879"
Try this

grim gulch
#

it works like that
but what is the difference between this update to this
curl https://api.stripe.com/v1/accounts/acct_1K6xCM2HOUDgIskJ/persons/person_1N0JCH2HOUDgIskJ6m5xkRAg \ -d "phone"="+1 234 204 3879"

#

this working just fine

slow arrow
#

I'm not an expert in curl, please consult the curl manual on how it interpret post data

grim gulch
#

I'm trying to make changes in the code, I'm sending the update with the api I used the crul just to test the updates

rocky steppeBOT
grim gulch
#

so when I use update account it fails if I send it in this format +1XXX but on the person it's faling

#

I just want to make sure what is the format you are expecting because I was told once to send it in this format +1XXX for updating account or person but know I see errors

#

so should I use this format only for persons updates?

desert onyx
#

Hey! Taking over for my colleague. Can you share the requestId of the failure request ?

slow arrow
#

Hi @grim gulch I'd suggest you to test it from the actual code instead of curl.

desert onyx
slow arrow
#

As I explained earlier, the curl command misinterprets the data (i.e., change + character to an empty space), and therefore causes the API fails.

grim gulch
#

just a sec I'll try to find the log of the request that failed from the update sent from the code

slow arrow
#

That's because you added many spaces in between the phone number.

#

Change +1 234 204 3879 to +12342043879

grim gulch
desert onyx
#

If you want to use spaces in all cases upgrade your API the the latest version 2022-11-15, otherwise, remove all spaces in all your current cases.