Create customer API is not working

krishnaa
New Member
2 0 0

Hi,

I have used the admin create customer API but it not working in postman and in frontend. but in the GET method to retrieved data is works fine.

$.ajax({
url: '',
dataType: 'json',
type: 'POST',
data:{
"customers": {
"email": "bob.norman@hostmail.com",
"accepts_marketing": false,
"first_name": "Bob",
"last_name": "Norman",
"verified_email": true,
"phone": "+16136120707"
}
},
success: function() {
alert('Customer is added');
}
});

0 Likes
Greg_Kujawa
Shopify Partner
965 80 204

If using Postman, I'd suggest ensuring it's configured to not send along any client side cookies with the POST and PUT types of API requests. I do recall that Shopify performs some basic validation for new customer records. I can't recall if it validates phone numbers, e-mails, physical addresses, but I do remember that if some of these values are bogus the new record doesn't get created.

I'd suggest pull a valid existing customer record. Use those field values as the basis for creating a new customer record via the API. See how that goes...

0 Likes
krishnaa
New Member
2 0 0

I have given the real data only but I still get the "Could not get any response" error in the POSTMAN and getting 303 status in the browser network.

0 Likes
Greg_Kujawa
Shopify Partner
965 80 204

If you've verified everything then I'd suggest sharing a sanitized version of your API request and response in this thread. Including the request ID that Shopify sends back in the response header will help Shopify staff track down the API call to see what's going on!