Combine the zucchini, onions and salt and stand for two hours. Rinse well and drain.
Mix the vinegar, sugar, salt and spices in a large saucepan with a lid and bring to a boil and simmer for 5 minutes. Add the zucchini and onion and stand for two more hours turning the zucchini over to marinate in the pickling solution. Reheat and boil for just 5 minutes.
Cool until warm and place in hot sterilised jars. Seal tightly and turn upside down for 15 minutes. Turn right side up and you should have a seal. These will keep in the fridge for 2 months (use a clean fork or spoon when you use them). Or if you do the full canning process which involves boiling the pickles in their jars then they will last for a year on the shelf.