how to get response in checkout ui extension from third party API without CORS issue

I want to get response form a third party API in a thankyou page in shopify using Post purchase chekcout Ui extension, How can i get this without getting CORS headers error. I have tried several option nothing works, can anybody guide me on this