Skip to content

Issue with setting fields in payload for POST "/v1/invoices" api #5065

Closed
@ruby10

Description

@ruby10

Hi there,
I have a query regarding following Magento2 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
}
]
}
}

Please clarify following points
a) Am I supposed to set fields "grand_total", "subtotal" on body level?
b) Fields "qty", "row_total", "tax_amount", "discount_amount" inside items array?
These fields are visible on invoice created on Magento2.
Attaching screenshot on created invoice below:
ab

OR mentioning "order_id" and "order_item_id" should be enough??
OR there is some other way , Please do provide info .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions