def validateTransactionBody(data):
    """Validates incoming json body

    Arguments:
        data {[dict]} -- [json body]

    Returns:
        [bool] -- [if validation passes]
        [dict] -- [if validation fails]
    """
    keys = [*data]
    allowedKeys = ["amount", "transactionType"]
    if len(keys) != 2:
        return {"error": "two keys are required in transaction body"}
    for key in keys:
        if key not in allowedKeys:
            return {
                "error": "only the following keys are allowed in transaction body:"
                + ",".join(allowedKeys)
            }

    return True