So 1. Make sure that you actually have billing information to pull You might not have passed in the customer ID on a order so when your checking it theres no details.
- Can you try passing in a per page?
E.g
var p = await wc.Order.GetAll(new Dictionary<string, string>()
{
{"customer", PassInUserId },
{ "per_page", "100" }
});
If your using the Woocom.net Wrapper you dont need to DeserializeObject the Wrapper does that for you.
Also can you try getting a order by Customer and posting the Response.
Here's a Helpful article
https://www.c-sharpcorner.com/article/json-serialization-and-deserialization-in-c-sharp/
But a detailed explanation
In Deserialization, it does the opposite of Serialization, which means it converts JSON string to a custom .Net object. In the following code, it creates an instance of BlogSite class and assigns values to its properties. Then we create an instance of DataContractJsonSerializer class by passing the parameter BlogSite class and creating an instance of MemoryStream class to write object(BlogSite). Lastly it creates an instance of StreamReader class to read JSON data from MemorySteam object.
The Code Example:
string json = "{\"Description\":\"Share Knowledge\",\"Name\":\"C-sharpcorner\"}";
using (var ms = new MemoryStream(Encoding.Unicode.GetBytes(json)))
{
// Deserialization from JSON
DataContractJsonSerializer deserializer = new DataContractJsonSerializer(typeof(BlogSite));
BlogSite bsObj2 = (BlogSite)deserializer.ReadObject(ms);
Response.Write("Name: " + bsObj2.Name); // Name: C-sharpcorner
Response.Write("Description: " + bsObj2.Description); // Description: Share Knowledge
}
Now you handled this yourself
var data = JsonConvert.DeserializeObject<RootObject>(myJSON);
nameArticles=data.articles.FirstOrDefault().description;
With the Wrapper there is no need for it, Its automatically done threw the Task when you call orders or Products or w.e els
So i'm basically just saying that the Wrapper DeserializeObjects so trying to DeserializeObjects wont work I believe, But what you can do is just get the order by ID then just pull the information from the p so you can get the nested data by accesing threw p so p.Metadata[1].key as an example and use it that way