Few of the replies here explain why whether is the correct word choice. Here's a great excerpt that details that logic:
Although in informal writing and speech the two words are often used interchangeably, in formal writing, such as in technical writing at work, it's a good idea to make a distinction between them because the meaning can sometimes be different depending on which word you use. The formal rule is to use if when you have a conditional sentence and whether when you are showing that two alternatives are possible. Some examples will make this more clear.
Here's an example where the two words could be interchangeable:
Squiggly didn't know whether Aardvark would arrive on Friday.
Squiggly didn't know if Aardvark would arrive on Friday.
In either sentence, the meaning is that Aardvark may or may not arrive on Friday.
Now, here are some examples where the words are not interchangeable.
Squiggly didn't know whether Aardvark would arrive on Friday or Saturday.
Because I used whether, you know that there are two possibilities: Aardvark will arrive on Friday or Aardvark will arrive on Saturday.
Now see how the sentence has a different meaning when I use if instead of whether:
Squiggly didn't know if Aardvark would arrive on Friday or Saturday.
Now in addition to arriving on Friday or Saturday, there is the possibility that Aardvark may not arrive at all. These last two sentences show why it is best to use whether when you have two possibilities, and that is why I recommend using whether instead of if when you have two possibilities, even when the meaning wouldn't change if you use if. It's safer and more consistent.
Here's a final pair of examples:
Call Squiggly if you are going to arrive on Friday.
Call Squiggly whether or not you are going to arrive on Friday.
The first sentence is conditional. Call Squiggly if you are going to arrive on Friday means Aardvark is only expected to call if he is coming.
The second sentence is not conditional. Call Squiggly whether or not you are going to arrive on Friday means Aardvark is expected to call either way.
So to sum up, use whether when you have two discrete choices or mean "regardless of whether," and use if for conditional sentences.
From:
https://grammar.quickanddirtytips.com/if ... ether.aspx