Configuration

Configure the Customer ID extension to match your business requirements.

Access Configuration

Navigate to Stores >Configuration > MageB2B > Customer ID

General Settings

Enable Customer ID

Enable or disable the customer ID functionality.

Options:

  • Yes - Enable customer ID assignment
  • No - Disable (existing IDs remain)

ID Template

Define the format for customer IDs using sprintf syntax.

Examples:

  • %d - Simple number: 1, 2, 3
  • %05d - Zero-padded 5 digits: 00001, 00002
  • CUST-%05d - With prefix: CUST-00001, CUST-00002
  • B2B-%06d - Business format: B2B-000001
  • %d-%s - With suffix: 1-A, 2-B

Default: %d

Starting Number

The first customer ID to assign.

Example: 1000 (IDs will start from 1000)

Note: Only applies to new customers. Existing customers keep their IDs.

ID Range (Optional)

Minimum ID

Minimum allowed customer ID number.

Example: 1000

Maximum ID

Maximum allowed customer ID number.

Example: 9999

Use Case: Separate ranges for different websites:

  • Website A: 1000-4999
  • Website B: 5000-9999

Login Settings

Enable Login with Customer ID

Allow customers to log in using their customer ID instead of email.

Options:

  • Yes - Enable login with customer ID
  • No - Email login only

How it works:

  1. Customer enters customer ID in email field
  2. System detects numeric format
  3. Looks up customer by ID
  4. Authenticates with password

Show Customer ID in Account

Display customer ID in customer account dashboard.

Options:

  • Yes - Show in "My Account"
  • No - Hide from frontend

Advanced Settings

Auto-Assign on Registration

Automatically assign customer ID when customer registers.

Options:

  • Yes - Assign immediately (recommended)
  • No - Manual assignment only

Allow Manual Override

Allow admin to manually set customer ID.

Options:

  • Yes - Admin can override auto-generated ID
  • No - Always use auto-increment

Warning: Manual override can cause duplicates if not careful.

Validate Uniqueness

Check for duplicate customer IDs before saving.

Options:

  • Yes - Prevent duplicates (recommended)
  • No - Allow duplicates (not recommended)

Multi-Website Configuration

Per-Website Ranges

To configure different ID ranges per website:

  1. Change Configuration Scope to specific website
  2. Set different Starting Number and ID Range
  3. Save configuration

Example Setup:

Website A (B2B):

  • Starting Number: 1000
  • Minimum ID: 1000
  • Maximum ID: 4999
  • Template: B2B-%04d

Website B (Retail):

  • Starting Number: 5000
  • Minimum ID: 5000
  • Maximum ID: 9999
  • Template: RET-%04d

API Configuration

Expose in API

Include customer ID in REST/SOAP API responses.

Options:

  • Yes - Available via extension attributes
  • No - Not exposed in API

API Field: customer_id_number in extension attributes

Save Configuration

After configuring, click Save Config and clear cache:

php bin/magento cache:flush

Configuration Examples

Simple Sequential IDs

Enable: Yes Template: %d Starting Number: 1

Result: 1, 2, 3, 4...

Zero-Padded IDs

Enable: Yes Template: %05d Starting Number: 1

Result: 00001, 00002, 00003...

B2B Customer IDs

Enable: Yes Template: B2B-%06d Starting Number: 100000

Result: B2B-100000, B2B-100001...

Range-Based IDs

Enable: Yes Template: %d Starting Number: 1000 Minimum ID: 1000 Maximum ID: 2500

Result: 1000-2500 (then stops)

Troubleshooting

IDs Not Assigned

  • Check "Enable Customer ID" is set to Yes
  • Verify "Auto-Assign on Registration" is enabled
  • Clear cache after configuration changes

Duplicate IDs

  • Enable "Validate Uniqueness"
  • Check for manual overrides
  • Verify range settings don't overlap between websites

Login Not Working

  • Ensure "Enable Login with Customer ID" is Yes
  • Customer ID must be numeric (template affects this)
  • Clear cache and test

Range Exceeded

  • Increase Maximum ID
  • Or start new range for new website

Next Steps

Found an issue with this documentation? Let us know