add customer

Highlighted
New Member
7 0 0

HI,

i like to add a customer like in this doc.

https://shopify.dev/docs/admin-api/rest/reference/customers/customer#create-2020-04

 

1 call:

curl --insecure -v -X POST --data '{"customer":{"first_name":"Max","last_name":"Mustermann","email":"blalba@ybla.de","phone":"0155547110815","verified_email":true,"addresses":[{"address1":"Musterweg 2","city":"Wien","province":"Wien","phone":"0155547110815","zip":"1170","last_name":"Mustermann","first_name":"Max","country":"AT"}]}}' https://01234567890123456789@mein.myshopify.com/admin/api/2020-07/customers.json

Result:

{"errors":{"customer":"Required parameter missing or invalid"}}* Connection #0 to host topshopat.myshopify.com left intact

wha is wrong?

Thanks
best regards
WW

0 Likes
Highlighted
New Member
7 0 0

no ideas? no help? Please?

 

thanks
WW

0 Likes
Highlighted
Shopify Partner
539 38 109

When I tried the exact same REST API request using Postman, below is the error I received in the response.

{
    "errors": {
        "email": [
            "contains an invalid domain name"
        ],
        "phone": [
            "is invalid"
        ]
    }
}

 

Apparently Shopify validates the e-mail domain name. Same with phone number formatting, seeing once I added valid e-mail domain name (e.g. - gmail.com) I got a kickback that the phone number was invalid.

0 Likes
Highlighted
Shopify Staff
Shopify Staff
493 98 88

We validate the phone number based on E.164 format. 

Vix | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 


0 Likes