---
title: Customer API
description: >-
The Customer API provides read-only access to customer data. Use this API to
get customer information and build personalized experiences based on the
selected customer context. The API offers the customer identifier for linking
to customer data and enabling customer-specific features.
api_version: 2025-10
api_name: pos-ui-extensions
source_url:
html: >-
https://shopify.dev/docs/api/pos-ui-extensions/latest/target-apis/contextual-apis/customer-api
md: >-
https://shopify.dev/docs/api/pos-ui-extensions/latest/target-apis/contextual-apis/customer-api.md
---
# Customer API
The Customer API provides read-only access to customer data. Use this API to get customer information and build personalized experiences based on the selected customer context. The API offers the customer identifier for linking to customer data and enabling customer-specific features.
#### Use cases
* **Customer search:** Search for customers by name, email, phone, or custom attributes.
* **Profile creation:** Create new customer profiles with contact information and metadata.
* **Profile updates:** Update customer information including details, addresses, and group assignments.
* **Loyalty programs:** Implement loyalty programs by tracking purchase history and applying discounts.
Support
Targets (3)
### Supported targets
* [pos.customer-details.action.menu-item.render](https://shopify.dev/docs/api/pos-ui-extensions/2025-10/targets/customer-details#customer-details-action-menu-item-)
* [pos.customer-details.action.render](https://shopify.dev/docs/api/pos-ui-extensions/2025-10/targets/customer-details#customer-details-action-modal-)
* [pos.customer-details.block.render](https://shopify.dev/docs/api/pos-ui-extensions/2025-10/targets/customer-details#customer-details-block-)
## CustomerApi
The `CustomerApi` object provides access to customer data. Access this property through `shopify.customer` to interact with the current customer context.
* id
number
required
The unique identifier for the customer. Use for customer lookups, applying customer-specific pricing, enabling personalized features, and integrating with external systems.
Examples
### Examples
* #### Retrieve the customer ID
##### Description
Access the unique identifier of the current customer in a customer detail context. This example shows how to use \`shopify.customer.id\` to retrieve the customer ID. This can be used for fetching additional customer data, implementing loyalty features, or building personalized customer experiences.
##### jsx
```jsx
import {render} from 'preact';
export default async () => {
render(, document.body);
};
const Extension = () => {
return (
Customer ID: {shopify.customer.id}
);
};
```
## Best practices
* **Use customer ID for lookups:** Fetch additional customer information from external systems or Shopify APIs using the customer ID.
* **Enable personalized features:** Use customer context for customer-specific pricing, loyalty programs, or product recommendations.
* **Validate customer access:** Verify the customer ID is valid before performing operations or API calls.
## Limitations
Customer data reflects the current POS session and may not include real-time updates from other channels until the session is refreshed.