Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ruby10 opened this issue Jun 16, 2016 · 2 comments
Closed

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

ruby10 opened this issue Jun 16, 2016 · 2 comments

Comments

@ruby10
Copy link

ruby10 commented Jun 16, 2016

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 .

@pboisvert
Copy link

@ruby10 this is a question best direct to the Magento stack exchange account or the Community forums. Github is intended solely for reporting issues.

@srinivasanithin
Copy link

srinivasanithin commented Jun 17, 2016

@pboisvert It should be Magento responsibility to bring the rate and amount based on the qty and item_id field passed in the API while creating the invoice. It should not be expecting these field values from the API user to give it. These can lead to many critical issue like variances in amount capture/invoiced and this can mess up many financial details. Can you review once again it as issue rather than question.

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 )

Thanks,

magento-engcom-team pushed a commit that referenced this issue Nov 27, 2019
- fixed MC-17545: Remove deprecation annotations from the PatchVersionInterface
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants