PHPackages                             aoropeza/customerpartner - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. aoropeza/customerpartner

ActiveMagento2-module[Authentication &amp; Authorization](/categories/authentication)

aoropeza/customerpartner
========================

Module for managing Customer Partners and specific login flows.

001PHP

Since Apr 30Pushed 1mo agoCompare

[ Source](https://github.com/adolforopeza/CustomerPartner)[ Packagist](https://packagist.org/packages/aoropeza/customerpartner)[ RSS](/packages/aoropeza-customerpartner/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

CustomerPartner for Magento 2
=============================

[](#customerpartner-for-magento-2)

This module enables the creation of unique Partner URLs that facilitate the automatic assignment of visitors to specific Customer Groups upon registration or login.

Business Context
----------------

[](#business-context)

The core function of this module is to establish a 1:1 mapping between a specific URL and a Magento Customer Group.

**Example Scenario:**

- **Partner A (e.g., eBay)**: You create a partner entry with URL key `ebay` linked to the "eBay Customers" group.
    - URL: `http://yourstore.com/partner/ebay`
    - Result: Any user registering or logging in via this URL is assigned to the "eBay Customers" group.
- **Partner B (e.g., Amazon)**: You create a partner entry with URL key `amazon` linked to the "Amazon Customers" group.
    - URL: `http://yourstore.com/partner/amazon`
    - Result: Any user registering or logging in via this URL is assigned to the "Amazon Customers" group.

**Key Features:**

1. **URL Registration**: Administrators can register specific URL keys (e.g., `ebay`, `amazon`).
2. **Group Assignment**:
    - **New Users**: If a visitor registers an account after visiting a partner URL, they are immediately assigned to the linked Customer Group.
    - **Existing Users**: If an existing customer logs in via a partner URL, their account is updated to belong to the linked Customer Group.
3. **Partner Specificity**: Each URL is unique to a specific partner and maps to a unique Customer Group context.

*Note: This module handles the assignment logic only. Any specific offers, pricing, or restrictions associated with the Customer Group must be configured separately using standard Magento features (e.g., Cart Price Rules, Catalog Price Rules).*

Installation
------------

[](#installation)

### Composer

[](#composer)

To install the module via Composer:

```
composer require aoropeza/customerpartner
bin/magento module:enable Aoropeza_CustomerPartner
bin/magento setup:upgrade
bin/magento setup:di:compile
```

Usage
-----

[](#usage)

### Admin Configuration

[](#admin-configuration)

1. Go to the Magento Admin Panel.
2. Navigate to the **Aoropeza Customer Partner** grid.
3. **Create New Partner**:
    - **Name**: The name of the partner (e.g., "eBay").
    - **URL Key**: The unique URL segment (e.g., `ebay`).
    - **Customer Group**: The specific group to assign (e.g., "eBay Customers").
    - **Is Active**: Enable/Disable the link.

### Frontend Flow

[](#frontend-flow)

1. A user accesses the partner URL: `http://yourstore.com/partner/{url_key}`.
2. The module sets a tracking cookie for that specific partner.
3. **Registration**: When the user creates an account, the system reads the cookie and assigns the new account to the partner's Customer Group.
4. **Login**: If a user logs in, the system reads the cookie and updates their existing account to the partner's Customer Group.

API Reference
-------------

[](#api-reference)

The module exposes standard REST endpoints for managing Customer Partner entities.

### Base URL

[](#base-url)

`/rest/V1/aoropeza-customerpartner/customer_partner`

### Endpoints

[](#endpoints)

### 1. Create Customer Partner

[](#1-create-customer-partner)

**POST** `/rest/V1/aoropeza-customerpartner/customer_partner`

Request Payload```
{
  "customerPartner": {
    "name": "Summer VIP",
    "url_key": "summer-vip",
    "customer_group_id": 4,
    "is_active": 1,
    "description": "Exclusive access for summer partners"
  }
}
```

Response Example```
{
    "entity_id": 15,
    "name": "Summer VIP",
    "url_key": "summer-vip",
    "customer_group_id": 4,
    "is_active": 1,
    "description": "Exclusive access for summer partners",
    "created": "2026-01-12 10:00:00",
    "updated": "2026-01-12 10:00:00"
}
```

---

### 2. Update Customer Partner

[](#2-update-customer-partner)

**PUT** `/rest/V1/aoropeza-customerpartner/customer_partner/{id}`

Request Payload```
{
  "customerPartner": {
    "name": "Summer VIP Updated",
    "is_active": 0
  }
}
```

Response Example```
{
    "entity_id": 15,
    "name": "Summer VIP Updated",
    "url_key": "summer-vip",
    "customer_group_id": 4,
    "is_active": 0,
    "description": "Exclusive access for summer partners",
    "created": "2026-01-12 10:00:00",
    "updated": "2026-01-12 12:30:00"
}
```

---

### 3. Get Customer Partner Details

[](#3-get-customer-partner-details)

**GET** `/rest/V1/aoropeza-customerpartner/customer_partner/{id}`

Request Payload*None*

Response Example```
{
    "entity_id": 15,
    "name": "Summer VIP Updated",
    "url_key": "summer-vip",
    "customer_group_id": 4,
    "is_active": 0,
    "description": "Exclusive access for summer partners",
    "created": "2026-01-12 10:00:00",
    "updated": "2026-01-12 12:30:00"
}
```

---

### 4. Search/List Customer Partners

[](#4-searchlist-customer-partners)

**GET** `/rest/V1/aoropeza-customerpartner/customer_partner/search`

Request PayloadParameters passed via query string (SearchCriteria). Example: `?searchCriteria[filter_groups][0][filters][0][field]=is_active&searchCriteria[filter_groups][0][filters][0][value]=1`

Response Example```
{
    "items": [
        {
            "entity_id": 15,
            "name": "Summer VIP",
            "url_key": "summer-vip",
            "customer_group_id": 4,
            "is_active": 1,
            "description": "Exclusive access for summer partners",
            "created": "2026-01-12 10:00:00",
            "updated": "2026-01-12 10:00:00"
        }
    ],
    "search_criteria": {
        "filter_groups": [
            {
                "filters": [
                    {
                        "field": "is_active",
                        "value": "1",
                        "condition_type": "eq"
                    }
                ]
            }
        ]
    },
    "total_count": 1
}
```

---

### 5. Delete Customer Partner

[](#5-delete-customer-partner)

**DELETE** `/rest/V1/aoropeza-customerpartner/customer_partner/{id}`

Request Payload*None*

Response Example```
true
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance61

Regular maintenance activity

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3385221?v=4)[Adolfo Oropeza](/maintainers/adolforopeza)[@adolforopeza](https://github.com/adolforopeza)

---

Top Contributors

[![adolforopeza](https://avatars.githubusercontent.com/u/3385221?v=4)](https://github.com/adolforopeza "adolforopeza (3 commits)")

---

Tags

b2bbackendcrmcustom-modulecustomercustomer-accountcustomer-managementcustomer-partnercustomer-servicemagentomagento2magento2-modulepartnerpartner-programphprelationship-managementsales-representative

### Embed Badge

![Health badge](/badges/aoropeza-customerpartner/health.svg)

```
[![Health](https://phpackages.com/badges/aoropeza-customerpartner/health.svg)](https://phpackages.com/packages/aoropeza-customerpartner)
```

###  Alternatives

[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)

PHPackages © 2026

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