PHPackages                             quarry/customer-uuid - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. quarry/customer-uuid

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

quarry/customer-uuid
====================

A Magento 2 module that adds a new uuid attribute for customers

1.0.4(2y ago)122OSL-3.0PHPPHP ^8.0

Since Jan 2Pushed 2y ago2 watchersCompare

[ Source](https://github.com/faraazmalak/mage-customer-uuid)[ Packagist](https://packagist.org/packages/quarry/customer-uuid)[ RSS](/packages/quarry-customer-uuid/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

Magento 2 Customer UUID Attribute Extension
===========================================

[](#magento-2-customer-uuid-attribute-extension)

Objective
---------

[](#objective)

This Magento 2 extension introduces a new read-only attribute, `uuid`, for customers. The extension ensures the uniqueness of the UUID for each customer and automatically assigns it to existing and new customers. The `uuid` attribute is exposed through a public GraphQl API for authenticated users and is also be displayed in the customer grid.

Key Features and Implementation Details
---------------------------------------

[](#key-features-and-implementation-details)

1. The extension uses UUID version 4, in accordance with Magento's best practices. UUID version 4 provides a very high probability of uniqueness due to its reliance on random values.
2. The extension uses Magento 2's plugin architecture, to intercept customer save and update operations. During this interception, new UUIDs are assigned and existing ones are re-validated.
3. Upon installation, the extension auto-assigns UUIDs to all the existing customers. This is implemented using Magento's data patches.
4. After the extension is installed, all new customers created thereafter are auto-assigned a UUID, just before the customer record is committed to the database.
5. Before any customer (new or existing) is assigned a UUID, the extension ensures that the same UUID is not assinged to another customer.
6. To enforce data integrity, the extension always re-validates the existing UUID for a customer, whenever changes are made to the customer record, either from admin panel or storefront. If the assigned UUID is invalid, a new one is generated, validated and assigned. A UI notification is also displayed on both admin panel and storefront.
7. UUIDs are displayed on customer grid, as read-only and are filterable, searchable and sortable.
8. An authenticated user can read the UUID through the GraphQl API
9. Extension logs all the UUID transactions to a log file.

Magento Compatability
---------------------

[](#magento-compatability)

This extension has been developed and tested on `Magento 2 version 2.4.6-p2`, with no other third-party extensions installed.

Setting-up Testing Environment
------------------------------

[](#setting-up-testing-environment)

This [docker-compose.yml](https://raw.githubusercontent.com/faraazmalak/magento_docker/main/docker-compose.yml) can be used to quickly spin-up a local testing environment, with Magento 2.4.6-p2, mariadb and elastic search installed. Once the `docker-compose.yml` file is downloaded, `docker-compose up -d` can be used to download the docker images and setup the containers and volumes.

Recommended Steps Before Extension Installation
-----------------------------------------------

[](#recommended-steps-before-extension-installation)

1. Ensure that Magento installation has a few customers created. This will allow the extension to auto-assign UUID during installation.
2. The extension logs all UUID transations to `/var/log/quarry_customeruuid.log`. Please ensure this log file has write-permissions enabled. If not, the extension falls back to PHP's system logger.
3. Enable Magento's developer mode ```
    bin/magento deploy:mode:set developer
    ```
4. Disable Magento's cache ```
    bin/magento cache:disable
    ```

Extension Installation Process
------------------------------

[](#extension-installation-process)

1. Install the extension using composer: ```
    composer require quarry/customer-uuid
    ```
2. Flush Magento's cache ```
    bin/magento cache:flush
    ```
3. Clean Magento's cache ```
    bin/magento cache:clean
    ```
4. Enable the UUID extension ```
    bin/magento module:enable Quarry_CustomerUuid
    ```
5. Run Magento setup upgrade: ```
    bin/magento setup:upgrade
    ```
6. Run di compile: ```
    bin/magento setup:di:compile
    ```

Verify the Extension Installation
---------------------------------

[](#verify-the-extension-installation)

### 1. Existing customers are auto-assigned UUID during extension installation.

[](#1-existing-customers-are-auto-assigned-uuid-during-extension-installation)

Expected outcome:

1. Customer grid, should show a new column labelled `UUID`, with UUIDs assigned to all the existing customers.
2. These read-only UUIDs must be filterable, searchable and sortable in the customer grid. [![customer-grid](https://private-user-images.githubusercontent.com/3054432/293950751-15863948-86f0-452a-a332-a808e1b1e008.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1Ni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UtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDYxNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA2MTZUMTkyNDE5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NDk5NzAzMjVjODg4MTlhN2U5OTBhNzgwYTViNWFlOGVhZTljN2FiMjVjN2QxNWI0OTk0M2E5MzA2OWRjMWY1YiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGanBlZyJ9.f_AcO_-v0KmEtg2Bn97Cqm5NU26Ny3LPPmn-QPO35ac)
3. Log file should show all the exsiting customer IDs, to whom new UUIDs have been assigned. Log entry message should be in following format:

```
[2024-01-04T18:30:41.104753+00:00] logger.WARNING: UUID  changed for customer ID

```

### 2. New customers created from admin panel, are auto-assigned UUID

[](#2-new-customers-created-from-admin-panel-are-auto-assigned-uuid)

Expected outcome:

1. The new customer record must show up in the customer grid, with a UUID assigned.
2. The log file should contain an entry for this transaction. Log entry message should be in following format:

```
[2024-01-04T18:37:06.483549+00:00] logger.INFO: UUID  assigned to new customer ID

```

### 2. New customers created from storefront, are auto-assigned UUID

[](#2-new-customers-created-from-storefront-are-auto-assigned-uuid)

Expected outcome:

1. The new customer record should show up in the admin customer grid, with a UUID assigned.
2. The log file should contain an entry for this transaction. Log entry message should be in following format:

```
[2024-01-04T18:37:06.483549+00:00] logger.INFO: UUID  assigned to new customer ID

```

### 3. UUID is accessible through GraphQl API, for authenticated users.

[](#3-uuid-is-accessible-through-graphql-api-for-authenticated-users)

For authenticated users, UUID is accessible via GraphQL API on the Customer object. Magento's GraphQl endpoint is `/graphql` and can be accessed at `http:///graphql`. It is recommended to use a GraphQl client like Postman to access this endpoint.

First, a bearer toekn must be obtained by calling `GenerateCustomerToken` mutation. Example:

```
mutation GenerateCustomerToken {
    generateCustomerToken(email: "yourname@yourdomain.com", password: "yourpass") {
    token
    }
}

```

Next, this auth token must be passed along with the GraphQl query to retrieve UUID. Sample GraphQl query to retrieve UUID:

```
query Customer {
    customer {
        uuid
    }
}

```

Below is a sample response to the above GraphQl query:

```
{
    "data": {
        "customer": {
            "uuid": "8d56ce70-5ec1-4eaa-91f8-5cee9bb72d90"
        }
    }
}

```

Extension Uninstallation Process
--------------------------------

[](#extension-uninstallation-process)

1. Disable the UUID extension ```
    bin/magento module:disable Quarry_CustomerUuid
    ```
2. Uninstall the UUID extension ```
    bin/magento module:uninstall --non-composer Quarry_CustomerUuid
    ```
3. Remove the extension using composer: ```
    composer remove quarry/customer-uuid
    ```
4. Flush Magento's cache ```
    bin/magento cache:flush
    ```
5. Clean Magento's cache ```
    bin/magento cache:clean
    ```
6. Run Magento setup upgrade: ```
    bin/magento setup:upgrade
    ```
7. Run di compile: ```
    bin/magento setup:di:compile
    ```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

4

Last Release

910d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/52842c355185f767292f5dd1201b12bfcb822853cc61757dd63ef8658afccdb2?d=identicon)[magentodev](/maintainers/magentodev)

---

Top Contributors

[![faraazmalak](https://avatars.githubusercontent.com/u/3054432?v=4)](https://github.com/faraazmalak "faraazmalak (66 commits)")

---

Tags

magentouuidcustomer

### Embed Badge

![Health badge](/badges/quarry-customer-uuid/health.svg)

```
[![Health](https://phpackages.com/badges/quarry-customer-uuid/health.svg)](https://phpackages.com/packages/quarry-customer-uuid)
```

###  Alternatives

[pocketmine/pocketmine-mp

A server software for Minecraft: Bedrock Edition written in PHP

3.5k78.3k90](/packages/pocketmine-pocketmine-mp)[yireo/magento2-extensionchecker

Scan the code of a Magento module

96166.3k3](/packages/yireo-magento2-extensionchecker)[loki/magento2-components

Core module for defining Alpine.js components with advanced AJAX features

1011.8k26](/packages/loki-magento2-components)[opengento/module-saleable

This extension allows to set if a product is saleable and can show its price by scope and customer group.

137.2k](/packages/opengento-module-saleable)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
