Feature request from ruby10, posted on GitHub Jun 21, 2016
Hi there,
I have an issue regarding setting fields in invoice create API
POST "V1/invoices"
with payload
{
"entity": {
"base_discount_tax_compensation_amount": null,
"base_shipping_discount_tax_compensation_amnt": null,
"discount_tax_compensation_amount": null,
"order_id": 58,
"shipping_discount_tax_compensation_amount": 0,
"total_qty": 2,
"grand_total": 155,
"subtotal": 150,
"items": [
{
"base_discount_tax_compensation_amount": null,
"discount_tax_compensation_amount": null,
"order_item_id": 74,
"sku": null,
"qty": 56,
"row_total": 150,
"tax_amount": 152,
"discount_amount": 23,
"price": 154
}
]
}
}
Here I am setting fields "grand_total", "subtotal" on body level and fields "qty", "row_total", "tax_amount", "discount_amount" inside items array.
As a API user, I am expected to pass Magento API with orderId, Items object array with order_item_id and qty, shipping cost ( again validation where this cost should be less then order shipping cost ) ,
but if I just provide these fields , they are displayed as '0' in invoice created on admin panel