ShopifySharp icon indicating copy to clipboard operation
ShopifySharp copied to clipboard

OrderService - UpdateAsync - Missing phone error

Open dkershner6 opened this issue 5 years ago • 3 comments

shipping_address: phone can't be blank   at ShopifySharp.ShopifyService.CheckResponseExceptions(HttpResponseMessage response, String rawResponse)
[3/12/2019 10:05:41 PM]    at ShopifySharp.ShopifyService.<>c__DisplayClass21_0`1.<<ExecuteRequestAsync>b__0>d.MoveNext()
[3/12/2019 10:05:41 PM] --- End of stack trace from previous location where exception was thrown ---
[3/12/2019 10:05:41 PM]    at ShopifySharp.DefaultRequestExecutionPolicy.Run[T](CloneableRequestMessage request, ExecuteRequestAsync`1 executeRequestAsync)
[3/12/2019 10:05:41 PM]    at ShopifySharp.ShopifyService.ExecuteRequestAsync[T](RequestUri uri, HttpMethod method, HttpContent content, String rootElement)
[3/12/2019 10:05:41 PM]    at ShopifySharp.OrderService.UpdateAsync(Int64 orderId, Order order)

I am just grabbing an existing order, changing some tags, then updating, and I receive this error. I am doing nothing with addresses, so its obviously a valid order going in...maybe we just need to ignore a field?

dkershner6 avatar Mar 12 '19 22:03 dkershner6

Strange, I wonder if it being null vs empty would make a difference?

nozzlegear avatar Mar 14 '19 18:03 nozzlegear

A fair question. Let me look at the order.

dkershner6 avatar Mar 14 '19 19:03 dkershner6

You appear to be correct, shopify's API returns a string.Empty. Bug on their end, but we should probably work around it somehow.

"phone": "",

dkershner6 avatar Mar 14 '19 19:03 dkershner6