Below is data in a json format.
{
"count": 1,
"orders": [
{
"instructions": "",
"coupons": [],
"tax_list": [
{
"type": "item",
"value": 1.83,
"rate": 0.18
}
],
"missed_reason": null,
"billing_details": null,
"fulfillment_option": null,
"id": 213102806,
"total_price": 12,
"sub_total_price": 12,
"tax_value": 1.83,
"persons": 0,
"latitude": "38.43105653776779",
"longitude": "27.141175570348768",
"client_first_name": "Sinem1",
"client_last_name": "Coşkun1",
"client_email": "sunarferhat851@gmail.com",
"client_phone": "+905071420000",
"restaurant_name": "Bobs Döner",
"currency": "TRY",
"type": "delivery",
"status": "pending",
"source": "website",
"pin_skipped": false,
"accepted_at": null,
"tax_type": "GROSS",
"tax_name": "KDV",
"fulfill_at": null,
"client_language": "tr",
"integration_payment_provider": null,
"integration_payment_amount": 0,
"reference": null,
"restaurant_id": 2178794,
"client_id": 199145778,
"updated_at": "2021-01-04T13:01:22.000Z",
"restaurant_phone": "+90 232 445 44 44",
"restaurant_timezone": "Europe/Istanbul",
"card_type": null,
"used_payment_methods": [
"CASH"
],
"company_account_id": 895916,
"pos_system_id": 30000097,
"restaurant_key": "qQM9yqtQaVepdJZ",
"restaurant_country": "Turkey",
"restaurant_city": "İzmir",
"restaurant_zipcode": "35210",
"restaurant_street": "No:1 D:No:3, 35210 Konak/İzmir",
"restaurant_latitude": "39.42531962962631",
"restaurant_longitude": "37.13854324236258",
"client_marketing_consent": true,
"restaurant_token": "dony",
"gateway_transaction_id": null,
"gateway_type": null,
"api_version": 2,
"payment": "CASH",
"for_later": false,
"client_address": "Caz Mah. 1625 Sk., İzmir",
"client_address_parts": {
"street": "Caz Mah. 1625 Sk.",
"city": "İzmir"
},
"items": [
{
"id": 287217709,
"name": "Tavuk Dürüm",
"total_item_price": 12,
"price": 12,
"quantity": 1,
"instructions": "",
"type": "item",
"type_id": 6416211,
"tax_rate": 0.18,
"tax_value": 1.8305,
"parent_id": null,
"item_discount": 0,
"cart_discount_rate": 0,
"cart_discount": 0,
"tax_type": "GROSS",
"options": [
{
"id": 271793671,
"name": "Tavuk Dürüm",
"price": 0,
"group_name": "Boy",
"quantity": 1,
"type": "size",
"type_id": 3429180
}
]
}
]
}
]
}
I'm trying to get this data in list type and the error I got is like this!
To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal.
The topic I ask you to help with is the data in json, and the Items list under Order.
I tried the two options below and the result did not change.
var des = (Root) JsonConvert.DeserializeObject (response.Content, typeof (Root));
var model = JsonConvert.DeserializeObject <List <Order>> (response.Content);
I would be very happy if you could help with this topic.
Thank you.