To create no need to use expand, Expand is used to retrieve . What matters is your JSON body must specify the line as well , below sample JSON to create header and line in single call.
{
"vendorInvoiceNumber":"",
"invoiceDate":"2018-12-25",
"dueDate":"2018-12-25",
"vendorNumber":"10000",
"purchaseInvoiceLines" :
[
{
"sequence":10000,
"lineType":"Item",
"itemId": "715f88b5-c1df-e911-bb22-000d3ab0ebc8",
"description":"12 GG INTERNATIONAL",
"directUnitCost":20000,
"quantity":10,
"unitOfMeasure": {
"code": "PCS",
"displayName": "Piece",
"symbol": null,
"unitConversion": null
}
},
{
"sequence":20000,
"lineType":"Item",
"itemId": "715f88b5-c1df-e911-bb22-000d3ab0ebc8",
"description":"ES TEH MANIS",
"directUnitCost":5000,
"quantity":5,
"unitOfMeasure": {
"code": "PCS",
"displayName": "Piece",
"symbol": null,
"unitConversion": null
}
}
]
}
You can also check my blog post :
https://madearipermadi.com/2019/12/19/postman-collection-to-explore-business-central-api/
it has sample in Postman collection