Hi,,
using x++ am trying to send the reference to a third party api
in that process am sending one json file to request and get response from thrid party api
in that json file am not able to separate the header and lines
"items": [
{
"name": "item_name1",
"itemId": "12345",
"price": 12.97,
"currency": "x",
"quantity": 10,
},{
"name": "item_name2",
"itemId": "12345",
"price": 12.97,
"currency": "x",
"quantity": 10,
},
"orderNumber": "12345",
"reference": "CustomCustomerReference1",//
"address":
{
"postcode": "xx",
"telephone": "x",
"line1": "address line 1",
"country": "x"
}]
i need to separate the header and lines while creating the json from sale table reference
but when i try to serialize it the json file using datacontract class is not separating the header and lines it coming like this
[
{
"name": "item_name1",
"itemId": "12345",
"price": 12.97,
"currency": "x",
"quantity": 10,
"name": "item_name2",
"itemId": "12345",
"price": 12.97,
"currency": "x",
"quantity": 10,
"orderNumber": "12345",
"reference": "CustomCustomerReference1",
"name": "First Name Last Name",
"companyName": "Company Name",
"email": "test@mail.com",
"postcode": "xx",
"telephone": "x",
"line1": "address line 1",
"country": "x"
}]
how to separate header and lines