My Products
Help
Gabriella Hennings
CHAMPION *

500 error creating salesorder v3 when ordeline unitprice = 0

by Gabriella Hennings

Hi

the API returns 500 with no response message error when you try to create an order and one or more orderlines har unitprice = 0.0 

 

this orderline object returns 500 and no error message. same error if I remove the column:

 

{
"inventoryId": "XXX911",
"description": "Gratis Signaturpåse",
"unitOfMeasure": "STYCK",
"quantity": 1.0,
"unitPrice": 0.0,
"warehouseId": "1",
"taxCategoryId": "99",
"discountAmount": 0.0
}

 

if I change the price like this it works and the order gets created: 

 

{
"inventoryId": "XXX911",
"description": "Gratis Signaturpåse",
"unitOfMeasure": "STYCK",
"quantity": 1.0,
"unitPrice": 1.0,
"warehouseId": "1",
"taxCategoryId": "99",
"discountAmount": 0.0
}

 

I have tried in the GUI and it is possible to create an order when the price = 0.

And you must be able to add items "free of charge" through the API, it's not a problem in the old API.

Best regards
Gabriella Hennings
Cloud Connection AB
3 REPLIES 3
Accepted solution
Joni Wolff
PARTNER

by Joni Wolff
Gabriella Hennings
CHAMPION *

This has appeared as an issue again? but this time I get error and inventory not found?

 

Best regards
Gabriella Hennings
Cloud Connection AB
Joni Wolff
PARTNER

by Joni Wolff (Updated ‎29-03-2023 21:58 by Joni Wolff PARTNER )

Hi!

This is a bug, I can reproduce the error. The issue seem to be with unitPrice and discountAmount both containing 0, where the calculation for some reason fails.

We will try to get a fix out during tomorrow. Until then, you can either exclude the "discountAmount" element, or set it as "discountAmount": null