--- title: Manage customer accounts with the Customer Account API description: Learn how to accomplish common tasks like associating an address with a customer and updating their first and last name. source_url: html: https://shopify.dev/docs/storefronts/headless/building-with-the-customer-account-api/customer-accounts md: https://shopify.dev/docs/storefronts/headless/building-with-the-customer-account-api/customer-accounts.md --- ExpandOn this page * [Requirements](https://shopify.dev/docs/storefronts/headless/building-with-the-customer-account-api/customer-accounts#requirements) * [Step 1: Update a customer](https://shopify.dev/docs/storefronts/headless/building-with-the-customer-account-api/customer-accounts#step-1-update-a-customer) * [Step 2: Create an address](https://shopify.dev/docs/storefronts/headless/building-with-the-customer-account-api/customer-accounts#step-2-create-an-address) * [Step 3: Update an address](https://shopify.dev/docs/storefronts/headless/building-with-the-customer-account-api/customer-accounts#step-3-update-an-address) * [Step 4: Delete an address](https://shopify.dev/docs/storefronts/headless/building-with-the-customer-account-api/customer-accounts#step-4-delete-an-address) * [Next steps](https://shopify.dev/docs/storefronts/headless/building-with-the-customer-account-api/customer-accounts#next-steps) # Manage customer accounts with the Customer Account API You can update customer accounts using the [Customer Account API](https://shopify.dev/docs/api/customer). This guide covers how to update a customer, and accomplish common tasks like creating, updating and deleting an address on a customer. *** ## Requirements * You've completed the [Getting started with the Customer Account API](https://shopify.dev/docs/storefronts/headless/building-with-the-customer-account-api/getting-started) guide. *** ## Step 1: Update a customer Customers are automatically created if needed when you call the API. You update a customer using the [`customerUpdate`](https://shopify.dev/docs/api/customer/unstable/mutations/customerUpdate) mutation. You can use this mutation to update the profile of a customer on your storefront. ## POST https\://{shop}.myshopify.com/api/{api\_version}/graphql.json ## GraphQL mutation ```graphql mutation customerUpdate($input:CustomerUpdateInput!) { customerUpdate(input:$input) { customer { id firstName lastName } userErrors { field message code } } } ``` ## Variables ```json { "input": { "firstName": "John", "lastName": "Doe" } } ``` ## JSON response ```json { "data": { "customerUpdate": { "customer": { "id": "gid://shopify/Customer/1", "firstName": "John", "lastName": "Doe" }, "userErrors": [] } }, "extensions": { "cost": { "requestedQueryCost": 10, "actualQueryCost": 10 } } } ``` *** ## Step 2: Create an address The following example shows how to use the [`customerAddressCreate`](https://shopify.dev/docs/api/customer/unstable/mutations/customerAddressCreate) mutation to create a new address for a customer: ## POST \