"Money can only be created with a numeric value!" error when creating a refund sale

in Development
Hi all, we implemented integration of Lightspeed Retail and Magento via Lightspeed Retail API. Basically, we're pushing orders both ways, products from Lightspeed to Magento, customers and, of course, refunds (or creditmemos in Magento).
For almost past 2 years everything worked well, including refunds which we created as a regular Sale object with negative totals and SaleLines with negative quantity.
Now, we are getting the mentioned error but we are not sure why are we getting it and where it originates.
The creditmemo parameters were the same as always, and also we made a test case - we created one refund in the Lightspeed system directly, and then used those same parameter values to make an API created refund and still getting the error.
I know that Refund call is included in the API now, but that doesn't do us much favor because Sales it creates are not completed, nor they include SaleLine quantites and do not put them back in stock.
Any info and clarification about this error would be highly helpful.
Thank you.
For almost past 2 years everything worked well, including refunds which we created as a regular Sale object with negative totals and SaleLines with negative quantity.
Now, we are getting the mentioned error but we are not sure why are we getting it and where it originates.
The creditmemo parameters were the same as always, and also we made a test case - we created one refund in the Lightspeed system directly, and then used those same parameter values to make an API created refund and still getting the error.
I know that Refund call is included in the API now, but that doesn't do us much favor because Sales it creates are not completed, nor they include SaleLine quantites and do not put them back in stock.
Any info and clarification about this error would be highly helpful.
Thank you.
3 comments
For example my json was:
But the correct is:
I'm php developer too, and we have take care of with that because the php has auto casting, but the api endpoint doesn't have probably.
I understand what you mean, though in my example we only have "unitPrice" and "normalUnitPrice" with quotes around the value.
I'll make some tests to see if that is the issue.
I'm wondering if minus sign is making problems.
Adrian Samuel
Software Developer
Lightspeed HQ