TLDR: want to refund X amount from Y payment. From January to the end of March 2023 (at least), using the field ‘amount’ in the refund API was enough and working properly in a production env. Noticed today while testing something related it no longer does. Using ‘refunded’, instead, solved it for a few minutes, but then started getting HTTP 500 Internal Server Error while making such refund requests.
Around 2 months ago we implemented partial refunding, and the payload of /api/v1/payments/refund was something like this:
This worked during March in production. Today I was fixing something related to the refund fields and noticed the refund amount was no longer working leading to ‘partial’ (blue) invoices. And now in the new docs (Invoice Ninja API Spec) it shows the expected payload is the following (which works):
So what was ‘amount’ was changed to ‘refunded’. Was there such a breaking change in the API?
Just noticed the docs I used before were in swagger, so maybe the ‘refunded’ was there all this time. Still, ‘amount’ was enough to correctly refund that value from a given payment. Now using amount leads to some weird refund amounts. and getting http 500 when using ‘refunded’.