def create_ordering_payload(order=None):
    """Creates a payload for the given order

    :param order: The order, defaults to None
    :type order: dict, optional
    :raises ValueError: If the order is not a dictionnary
    :return: The created payload
    :rtype: dict
    """
    payload = {}
    if not order:
        return payload
    if not isinstance(order, dict):
        return payload
    direction = order.get("direction", "ASC")
    field = order.get("field", None)
    if direction not in ["ASC", "DESC"]:
        raise ValueError("Direction must be ASC or DESC")
    if direction == "DESC":
        field = "-{field}".format(field=field)
    payload["ordering"] = field
    return payload