Calculated refund returns "Unprocessable Entity" when doing a partial shipping refund

I’m trying to calculate a refund via this REST endpoint in a Remix application.

When I calculate a refund with a full shipping refund - “shipping”: {“full_refund”: true} - everything works fine.

However, when I’m trying to do a partial shipping refund - “shipping”: {“amount”: 29} - it doesn’t work.

Instead, I get an HTTPError: Response code 422 (Unprocessable Entity).

It’s not the most difficult endpoint in the world, so I suspect a bug. But hard to tell.

Help? :sweat_smile: