import json


def _format_full_payload(_json_field_name, _json_payload, _files_payload):
    """This function formats the full payload for a ``multipart/form-data`` API request including attachments.

    .. versionadded:: 2.8.0

    :param _json_field_name: The name of the highest-level JSON field used in the JSON payload
    :type _json_field_name: str
    :param _json_payload: The JSON payload data as a dictionary
    :type _json_payload: dict
    :param _files_payload: The payload for the attachments containing the IO stream for the file(s)
    :type _files_payload: dict
    :returns: The full payload as a dictionary
    :raises: :py:exc:`TypeError`
    """
    _full_payload = {
        _json_field_name: (None, json.dumps(_json_payload, default=str), 'application/json')
    }
    _full_payload.update(_files_payload)
    return _full_payload