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 #5125

Closed
ruby10 opened this issue Jun 21, 2016 · 3 comments
Closed

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

ruby10 opened this issue Jun 21, 2016 · 3 comments
Assignees
Labels
improvement Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@ruby10
Copy link

ruby10 commented 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

@karanbhomiagit
Copy link

I am facing the same issue. This is definitely a bug in the code.

@srinivasanithin
Copy link

Those fields should be picked up from the magento sales order rather than we giving it on API. There are serious issues leaving these fields to be given by API user. Once an order is capture for full order with incorrect amount(less than order amount) then there is no way to capture again without re-authorizing the card for customer. Please fix this bug. Magento should be pulling price from order and calculating the row total, grand total rather than api user giving those details

@NadiyaS NadiyaS added the CS label Jun 21, 2016
@NadiyaS NadiyaS self-assigned this Jun 21, 2016
@vkorotun vkorotun removed the CS label Aug 4, 2016
@veloraven veloraven added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development improvement labels Aug 19, 2016
@piotrekkaminski
Copy link
Contributor

Thank you for your submission.

We recently made some changes to the way we process GitHub submissions to more quickly identify and respond to core code issues.

Feature Requests and Improvements should now be submitted to the new Magento 2 Feature Requests and Improvements forum (see details here).

We are closing this GitHub ticket and have moved your request to the new forum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

7 participants