Pass a custom variable to the Thank you page to initiate a redirect

I’ve been looking into creating a custom checkout process that captures the payment information in shopify → creates the order → redirects the customer back into my application (instead of going to the thank you page) based on a URL that I would pass in as a variable.

I’ve tried creating the cart and checkout with the Storefront API, but I am not able to access any custom attributes/notes that I added to the request. I can see the note and custom_attributes on the order that is created, but not in the logs on the thank you page. I was able to access the custom_attributes on the line_items object that gets transformed to ‘properties’, but I do not like that the key/value that I am passing in is visible under the product name in the checkout.

For now, I’ve added a log to the additional scripts section of my order-status page, but this will handle the redirect logic later.

Is there any way for me to pass this Redirect URL to the checkout object that is returned after the payment is captured? I don’t necessarily care how the data is structured, as long as it’s accessible with the scripts and not displayed in the UI. Open to all suggestions, I’ve even looked at creating the cart with a permalink and ref
https://shopify.dev/docs/apps/checkout/cart-permalinks/cart-permalinks

Hi @ReturnLogicDev

Can you explain the logic how and when you will get the redirect URL.