How can I access customer.id on the order status page?

I would like to get customer info on the order status page (thank_you page at the end of a checkout)

It is possible to get customer.id from the liquid customer object when the orderer is logged in.

However, threre are no references to the liquid objects customer, checkout.customer, order.customer when the user is not logged in.

This feels like a bug because the customer object is created and can be viewed on the Shopify admin page (same for the order). I dont’ see why this useful info would purposely be excluded from liquid.

So, the questions are

  1. is the fact that the liquid object customer cannot be referenced on the Order status page a bug? or is it purposed? if so why?

  2. Is my approach the problem here? Are there any better ways to get customer.id on the order status page?

I have your issue and plus based on the tests that we have done, sometimes the logged-in customers also are not available on the order status page!!
I have reached out via email to the support and they said:

[Unfortunately, this isn’t possible as the thank-you page is rendered using Liquid, which doesn’t have access to customer and guest user properties.]

Here are our test cases:
For guest users: https://screenrec.com/share/W1PaC3MnJj

For logged-in users: https://screenrec.com/share/jdxgLOEWIk

As you can see the customer id is not available in none of them.

This is the test script we used in the above scenario:

var firstName = '{{customer.first_name}}';
var customerId = '{{customer.id}}';
var customerHasAccount = {{customer.has_account}};

The problem is really not acceptable!

While testing I found out that the customer is sometimes available in the order.customer object but it’s also not reliable, because the customer data in both customer and order.customer is not always missing, sometimes it’s there sometimes it’s not.