If you want to have a 'hidden' ticket type with a discount code, only available to customers who have been given a secret code, first head to the 'Add tickets' section of the event editing page
Create a ticket type for the discounted ticket, here we've called it 'Friends and family', then click 'Options' to the right of it
At the bottom of the dropdown section, add in your desired secret code into the box marked 'A password or discount code people will have to enter to purchase this ticket type'
Thats it! The ticket type won't be shown by default but if someone types in the code they'll be able to purchase that ticket type
Please note, it currently isn't possible to set up a discount code that takes a percentage off of the total sale value. If you are interested in this feature, please get in touch.