In designing API endpoints for something like an order or invoice, is it better to have endpoints for Order and Item
eg.
public class CreateOrder
{
public DateTime OrderDate { get; set; }
…
}
public class CreateOrderLineItem
{
public int OrderId {get;set;}
public int ProductId {get; set }
…
}
or single payload
eg.
public class CreateOrderEntry
{
public DateTime OrderDate { get; set; }
public List<LIneItem>
LIneItems {get;set;}
…
}