How can I save order query parameters from a product page URL?

Hello. Please help me understand the technical details since studying the documentation and searching in the community has not yet given answers.
Is there any way to save in the order details all query parameters of the URL, by which the client got to the product page? And is it possible to get this information through the REST API in the future?
Maybe somewhere the entire URL is saved and it can be obtained in the details of the order via API? This option is also suitable since the key for us is to find a way to integrate Shopify with an existing referral program. If a buyer lands on this platform, it is important for us to match this with our additional 4 parameters that were added to the site path.
Thanks in advance for your reply.