def METHOD_NAME(resp, idempotency_key=""):
    """Return a ResponseError subclass based on the API payload.
    All errors are documented: https://docs.mollie.com/guides/handling-errors#all-possible-status-codes
    More exceptions should be added here when appropriate, and when useful examples of API errors are available.
    """
    status = resp["status"]
    if status == 400:
        return BadRequestError(resp, idempotency_key=idempotency_key)
    elif status == 401:
        return UnauthorizedError(resp, idempotency_key=idempotency_key)
    elif status == 404:
        return NotFoundError(resp, idempotency_key=idempotency_key)
    elif status == 409:
        return ConflictError(resp, idempotency_key=idempotency_key)
    elif status == 422:
        return UnprocessableEntityError(resp, idempotency_key=idempotency_key)
    else:
        # generic fallback
        return ResponseError(resp, idempotency_key=idempotency_key)