# usePhone Returns the phone number of the buyer that is interacting with the cart. The value is `undefined` if the app does not have access to customer data. ## ### UsePhoneGeneratedType Returns the phone number of the buyer that is interacting with the cart. The value is `undefined` if the app does not have access to customer data. #### Returns: string | undefined export function usePhone< Target extends RenderExtensionTarget = RenderExtensionTarget, >(): string | undefined { const buyerIdentity = useApi().buyerIdentity; if (!buyerIdentity) { throw new ScopeNotGrantedError( 'Using buyer identity requires having personal customer data permissions granted to your app.', ); } return useSubscription(buyerIdentity.phone); } ## Related - [StandardApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/standardapi) - [CheckoutApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/checkoutapi) - [OrderStatusApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/orderstatusapi) - [CartLineItemApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/cartlineitemapi) - [PickupPointListApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/pickuppointlistapi) - [PickupLocationListApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/pickuplocationlistapi) - [ShippingOptionItemApi](https://shopify.dev/docs/api/checkout-ui-extensions/apis/shippingoptionitemapi) - [ExtensionTargets](https://shopify.dev/docs/api/checkout-ui-extensions/apis/extensiontargets)