Extracting customer id from POS modal render extension

Hi Shopify Experts,

I am trying to extract customer id who has been logged into the POS application in the pos extension - ‘pos.home.modal.render’, but unable to do so:

Somewhere I noticed that below could work to extract customer details, but not working for me:

  • api.cart.subscribable.initial.customer.id
  • api.cart.subscribable.initial.customer.email
  • api.cart.subscribable.initial.customer.firstName
  • api.cart.subscribable.initial.customer.lastName

Thanks for your support.

1 Like

After putting this code snippet in the extension file - index.js, extension stopped working - it is throwing error

Eventually able to get customer id, but I had to subscribe to customer events using below code-base:

api.cart.subscribable.subscribe(cart => {console.log(cart.customer)})

1 Like