Sep31Bad Request Exception
Exception thrown when the Receiving Anchor returns HTTP 400 Bad Request.
Indicates that the request was malformed or contained invalid parameters. The two domain-specific 400 subcases — customer_info_needed and transaction_info_needed — are dispatched to Sep31CustomerInfoNeededException and Sep31TransactionInfoNeededException respectively; this generic class covers every other 400 response.
Common causes:
Required request fields are missing
Request body JSON is malformed
Amount falls outside the asset's min/max limits
Unsupported asset or destination asset
Invalid or expired SEP-38
quote_idsender_idorreceiver_idreferences an unknown SEP-12 customer
Recovery actions:
Inspect message for the sanitized error returned by the anchor
Verify all required request parameters per the SEP-31 spec
Re-fetch the asset configuration via
GET /infoto confirm limits and supported funding methods
Example - Handle bad request:
try {
val response = sep31Service.postTransactions(request, jwt)
} catch (e: Sep31BadRequestException) {
println("Invalid request (HTTP ${e.statusCode}): ${e.message}")
}See also:
Sep31Exception base class
Parameters
Sanitized error message extracted from the anchor response.
Properties
Anchor response body for local debugging — see the rawResponseBody convention on Sep31Exception. null when no body was captured.
The HTTP status code returned by the Receiving Anchor (always 400 for this exception).