import json


def get_signature_payload(body) -> str:
    """Returns the signature payload as a string.

    The body of the payload may be a dict or a string.

    :param body: The body to be "stringified".
    :type body: str|dict
    :return: The body as a string.
    :rtype: str
    :raise RuntimeError: IF the body is not a string or dict.
    """
    if not isinstance(body, (str, dict)):
        raise RuntimeError(
            f'Invalid body type. Must be `str` or `dict`, got {type(body)}')

    # Create a string from the body dict.
    if isinstance(body, dict):
        body_string = json.dumps(
            body,
            sort_keys=True,
            indent=None,
            separators=(',', ': ')
        ).strip()
    else:
        body_string = body.strip()  # Strip white space from start and end.

    return body_string