Phone is invalid

wylanosorio
New Member
4 0 0

Hello,

 

I am getting "Phone is invalid" error when creating an order via Shopify API. While the order json object didn't go through because of phone validation, it saves the customer data resulting to duplicate customer records.

 

Here's the json I am passing:

{
	"order": {
		"name": "GRPN-O1003337299",
		"customer": {
			"first_name": "SANDRA ****"
		},
		"currency": "AUD",
		"billing_address": {
			"name": "SANDRA ****",
			"phone": "+6148377****",
			"address1": "****** WELLINGTON STREET",
			"address2": "",
			"city": "NARRABEEN",
			"zip": "2101",
			"province_code": "NSW",
			"country_code": "AU"
		},
		"shipping_address": {
			"name": "SANDRA ****",
			"phone": "+6148377****",
			"address1": "****** WELLINGTON STREET",
			"address2": "",
			"city": "NARRABEEN",
			"zip": "2101",
			"province_code": "NSW",
			"country_code": "AU"
		},
		"line_items": [
			{
				"product_id": "CILI463371877_FLIL1003627554",
				"sku": "NP1952S-Black-S_CILI-463371877_FLI-L1003627554",
				"price": 49.0,
				"quantity": 1,
				"name": "Men's, Size S, Black: Three-Pack of Calvin Klein Men's Trunk",
				"title": "Men's, Size S, Black: Three-Pack of Calvin Klein Men's Trunk",
				"grams": 300
			}
		],
		"phone": "+6148377****",
		"source_name": "GROUPON",
		"total_price": "49.00",
		"total_weight": 300
	}
}

I just hide some details for security reasons.

 

I am looking forward to your help. Thanks!

0 Likes
_JB
Shopify Staff
Shopify Staff
750 86 163

Hey @wylanosorio,

 

Can you kindly provide the X-Request-ID value from the response headers of a failed call? I will use this to get more details about the error from our logs.

JB | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
wylanosorio
New Member
4 0 0

Here it is ede31142-c762-4749-8e50-77cc569a545e

0 Likes
wylanosorio
New Member
4 0 0

Hi @_JB 
How are you?
Let me know what you found out.

 

Thanks.

0 Likes
wylanosorio
New Member
4 0 0

@_JB I solved it last few days by removing the "phone" field but keeping the "phone" fields under "shipping_address" and "billing_address". But the solution is temporary. May I know an update what have you found out?

0 Likes