I'd like to help you set up a foreign contractor in QBO, nancy-yang.
You can also turn on your Multicurrency settings to pay foreign contractors.
However, the option to enter the W-8 information is unavailable in QuickBooks Online. You can reach out to the IRS for instructions about the form.
Let us know if you have other questions.