> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.mangopay.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mangopay.com/_mcp/server.

# Java SDK - 2.62.1

Apr 30, 2026

## Fixed

### SCA `RedirectUrl` rendering on 401 responses with no body

When the 401 error for SCA redirection (`401 Unauthorized` with the `WWW-Authenticate: PendingUserAction RedirectUrl=...` header) had no response body, `RestTool` reported the wrong outcome. `connection.getErrorStream()` returned `null` for the empty body, and the next line, `checkApiConnection(is)`, threw a `ResponseException` with `responseHttpCode=500` / `responseHttpDescription="Connection to Mangopay API failed"`.

`RestTool` now better detects this case (`responseCode == 401`, error stream `null`, `WWW-Authenticate` header present) in both `readResponse` and `doRequestList`, and routes it through `checkResponseCode(null, headers)`. The thrown `ResponseException` now carries:

* `responseHttpCode = 401` and `responseHttpDescription = "SCA required"`
* `data.RedirectUrl` extracted from the `WWW-Authenticate` header
* `errors.Sca = "SCA required to perform this action."`
* `type = "unauthorized"`