Make sure the number is added with no gaps between the number, so you enter all 16 digits.
You can add the voucher here https://giffgaff.com/buy/redeem or dial 43430 from your giffgaff sim.
If it does not work, then need to message a giffgaff agent using this link https://support2.giffgaff.com/app/ask/Top-up-balances-and-goodybags/Using-a-top-up-voucher/form/ the agent will need to check the voucher code with O2, to see if it has been used by another number. This can take a day or so, depending on how quickly O2 reply.
I assume the voucher code you purchase was for £10 or more and for either giffgaff, I2 or Tesco mobile. Only these vouchers will work. If you had a voucher for EE, Three, Vodafone etc, then these would not work, as different networks.