def enhanced_transaction_items(items: dict):
    """Return a formatted payload of items for a Google Analytics enhanced ecommerce transaction.

    :param items: Nested Python dictionary containing item data.
    :return: Formatted payload of items matching the below format.
    :example:

    items = {
    1: {'product_id': 'ABC1',
        'product_name': 'Product 1',
        'product_price': 19.99,
        'product_quantity': 1,
        'product_brand': 'Apple',
        'product_category': 'Phones',
        'product_variant': '256GB',
        },
    2: {'product_id': 'ABC2',
        'product_name': 'Product 2',
        'product_price': 20.99,
        'product_quantity': 2,
        'product_brand': 'Apple',
        'product_category': 'Phones',
        'product_variant': '500GB',
        },
    }
    """

    items_payload = {}

    for item in items:
        prefix = 'pr{0}'.format(item)
        payload_item = {}

        if 'product_id' in items[item]:
            payload_item[prefix + 'id'] = items[item]['product_id']

        if 'product_name' in items[item]:
            payload_item[prefix + 'nm'] = items[item]['product_name']

        if 'product_price' in items[item]:
            payload_item[prefix + 'pr'] = items[item]['product_price']

        if 'product_quantity' in items[item]:
            payload_item[prefix + 'qt'] = items[item]['product_quantity']

        if 'product_brand' in items[item]:
            payload_item[prefix + 'br'] = items[item]['product_brand']

        if 'product_category' in items[item]:
            payload_item[prefix + 'ca'] = items[item]['product_category']

        if 'product_variant' in items[item]:
            payload_item[prefix + 'va'] = items[item]['product_variant']

        items_payload = {**items_payload, **payload_item}

    return items_payload