import json


def serialize_batch(deserialized_batch):
    """Takes a dictionary of FashionItemState objects and serializes it into bytes.
    Args:
        deserialized_batch (dict): ScanTrust ID of item (str) keys, FashionItemState values
    Returns:
        (bytes): The encoded string, witch is JSON representation of array of decoded payloads
    """
    decoded_payloads = []
    for _, item_state in deserialized_batch.items():
        decoded_payloads.append(item_state.payload.decode())

    return json.dumps(decoded_payloads).encode()