You can buy direct from the racecourse website or the official Jockey Club’s website.
It is always best to buy in advance.