Error Posting Ecom Order - Missing Name, Price and Quantity

Hello,

I am having an issue posting orders to the DeepData E-Commerce Order resource.

At this point I was able to Post a Customer using the Create Customer resource. Now I am trying to Post an Order for that customer.

I am getting this error, which doesn’t make sense because in the orderProducts object is populated with those attributes.

{"errors":[{"title":"The ecomOrderProduct **name** was not provided.","detail":"","code":"field_missing","error":"ecomOrderProduct_name_was_not_provided","source":{"pointer":"\/data\/attributes\/name"}},{"title":"The ecomOrderProduct **price** was not provided.","detail":"","code":"field_missing","error":"ecomOrderProduct_price_was_not_provided","source":{"pointer":"\/data\/attributes\/price"}},{"title":"The ecomOrderProduct **quantity** was not provided.","detail":"","code":"field_missing","error":"ecomOrderProduct_quantity_was_not_provided","source":{"pointer":"\/data\/attributes\/quantity"}}]}

Below is the copy and pasted RESTSHARP code from AC’s Api Documentation.

            var client = new RestClient("https://company123.api-us1.com/api/3/ecomOrders");
            var request = new RestRequest(Method.POST);
            request.AddHeader("Accept", "application/json");
            request.AddHeader("Content-Type", "application/json");
            request.AddHeader("Api-Token", "Password123");
            request.AddParameter("application/json",
                "{\"ecomOrder\":{\"orderProducts\":{\"name\":\"Mortgage1\",\"price\":2000,\"quantity\":1,\"externalid\":\"11332\"},\"externalid\":\"3246315233\",\"customerid\":1,\"source\":1,\"email\":\"Password@fake.com\",\"totalPrice\":20,\"currency\":\"USD\",\"connectionid\":1,\"externalCreatedDate\":\"2019-09-05T12:16:18-05:00\"}}",
                ParameterType.RequestBody);
            IRestResponse response = client.Execute(request);

Did you ever figure this out @instituteonline1 ? I’m running into similar issues. I figured out that I had to add the connection and the eComm customer first so I could grab their ID - which I was able to do successfully but now it just tells me certain data wasn’t there even if it was.