GET/customers/:customerId
Method: GET
URL: https://api.mpowerpromo.com/customers/{{customerId}}
Authentication: Required (JWT Bearer token)
| Parameter | Description | Required | Data Type | Example |
|---|---|---|---|---|
customerId |
MongoDB ObjectId of the customer | Yes | ObjectId | 507f1f77bcf86cd799439011 |
| Header | Description | Required | Example |
|---|---|---|---|
Authorization |
Bearer JWT token | Yes | {{vault:bearer-token}} |
Content-Type |
Content type | No | application/json |
portal |
Portal identifier (admin/customer) | No | admin |
None - This endpoint does not accept query parameters.
| Field | Description | Data Type |
|---|---|---|
_id |
Customer's unique MongoDB ID | ObjectId |
customerId |
Sequential customer ID number | Number |
email |
Customer's email address | String |
firstName |
Customer's first name | String |
lastName |
Customer's last name | String |
jobTitle |
Customer's job title | String |
isActive |
Whether account is active | Boolean |
rank |
Customer ranking/priority | Number |
deletedAt |
Soft delete timestamp (if deleted) | Date / null |
createdAt |
Account creation timestamp | Date (ISO 8601) |
updatedAt |
Last update timestamp | Date (ISO 8601) |
| Field | Description | Data Type |
|---|---|---|
companyId |
Company object (populated) | Object / null |
companyId._id |
Company's MongoDB ID | ObjectId |
companyId.companyName |
Company name | String |
companyId.photo |
Company logo URL | String |
companyId.distributorId |
Company's distributor ID | ObjectId |
companyId.referenceFields |
Custom company fields | Object |
companyId.notes |
Company notes | String |
| Field | Description | Data Type |
|---|---|---|
userId |
Account Manager object (populated) | Object / null |
userId._id |
User's MongoDB ID | ObjectId |
userId.firstName |
User's first name | String |
userId.lastName |
User's last name | String |
userId.photo |
User's profile photo URL | String |
adminUserId |
Sales Admin object (populated) | Object / null |
sourceUserId |
User who created customer (populated) | Object / null |
| Field | Description | Data Type |
|---|---|---|
distributorId |
Distributor's MongoDB ID | ObjectId |
supplierId |
Supplier's MongoDB ID (if applicable) | ObjectId / null |
source |
Creation source (Web, API, Import, etc.) | String |
createdBy |
User ID who created the record | ObjectId |
| Field | Description | Data Type |
|---|---|---|
stores |
Array of store IDs customer has access to | Array[ObjectId] |
| Field | Description | Data Type |
|---|---|---|
CustomerPhoneNumbers |
Array of phone number objects | Array[Object] |
CustomerPhoneNumbers[]._id |
Phone record ID | ObjectId |
CustomerPhoneNumbers[].phoneNumber |
Phone number | String |
CustomerPhoneNumbers[].phoneType |
Type: Work, Cell, Home, Fax | String |
CustomerPhoneNumbers[].extension |
Phone extension | String |
| Field | Description | Data Type |
|---|---|---|
CustomerAddresses |
Array of shipping addresses | Array[Object] |
CustomerAddresses[]._id |
Address record ID | ObjectId |
CustomerAddresses[].street |
Street address line 1 | String |
CustomerAddresses[].street1 |
Street address line 2 | String |
CustomerAddresses[].city |
City | String |
CustomerAddresses[].state |
State/Province | String |
CustomerAddresses[].zip |
Zip/Postal code | String |
CustomerAddresses[].country |
Country code | String |
CustomerAddresses[].isDefault |
Default address flag | Boolean |
| Field | Description | Data Type |
|---|---|---|
CustomerBillingAddress |
Array of billing addresses | Array[Object] |
CustomerBillingAddress[]._id |
Billing address record ID | ObjectId |
CustomerBillingAddress[].street |
Street address | String |
CustomerBillingAddress[].city |
City | String |
CustomerBillingAddress[].state |
State/Province | String |
CustomerBillingAddress[].zip |
Zip/Postal code | String |
CustomerBillingAddress[].country |
Country code | String |
CustomerBillingAddress[].isDefault |
Default billing address flag | Boolean |
| Field | Description | Data Type |
|---|---|---|
CustomerShippers |
Array of shipper accounts | Array[Object] |
CustomerShippers[]._id |
Shipper record ID | ObjectId |
CustomerShippers[].shipperName |
Shipper company name | String |
CustomerShippers[].accountNumber |
Account number | String |
CustomerShippers[].isDefault |
Default shipper flag | Boolean |
| Field | Description | Data Type |
|---|---|---|
CustomerNotes |
Array of notes (with user populated) | Array[Object] |
CustomerNotes[]._id |
Note ID | ObjectId |
CustomerNotes[].note |
Note text | String |
CustomerNotes[].userId |
User object who created note | Object |
CustomerNotes[].userId._id |
User's ID | ObjectId |
CustomerNotes[].userId.firstName |
User's first name | String |
CustomerNotes[].userId.lastName |
User's last name | String |
CustomerNotes[].userId.photo |
User's photo URL | String |
CustomerNotes[].createdAt |
Note creation date | Date |
lastContactedAt |
Last contact timestamp | Date / null |
| Field | Description | Data Type |
|---|---|---|
Documents |
Array of document objects (populated) | Array[Object] |
Documents[]._id |
Document ID | ObjectId |
Documents[].fileName |
Original filename | String |
Documents[].title |
Document title | String |
Documents[].url |
S3 URL to document | String |
Documents[].fileSize |
File size in bytes | Number |
Documents[].uploadDate |
Upload timestamp | Date |
Documents[].userId |
User who uploaded (populated) | Object |
| Field | Description | Data Type |
|---|---|---|
roles |
Array of role objects (populated) | Array[Object] |
roles[]._id |
Role ID | ObjectId |
roles[].name |
Role name | String |
roles[].settings |
Role settings/permissions | Object |
| Field | Description | Data Type |
|---|---|---|
customerDevice |
Device info from account creation | Object / null |
customerDevice._id |
Device record ID | ObjectId |
customerDevice.source |
Device source (CREATE_ACCOUNT, etc.) | String |
customerDevice.location |
Location data | Object |
customerDevice.userAgent |
Browser user agent | String |
customerDevice.referrer |
Referrer URL | String |
customerDeviceId |
Current device ID reference | ObjectId / null |
| Field | Description | Data Type |
|---|---|---|
utmData |
UTM tracking data | Object / null |
utmData.utmSource |
UTM source parameter | String |
utmData.utmMedium |
UTM medium parameter | String |
utmData.utmCampaign |
UTM campaign parameter | String |
| Field | Description | Data Type |
|---|---|---|
socialData |
Array of social login connections | Array[Object] |
socialData[].service |
Service name (facebook, google) | String |
socialData[].id |
Social network user ID | String |
| Field | Description | Data Type |
|---|---|---|
registrationsSent |
Array of registration email records | Array[Object] |
registrationsSent[].createdAt |
Email sent date | Date |
registrationsSent[].storeId |
Store ID email was sent for | ObjectId |
hasFollowUps |
Whether customer has active follow-ups | Boolean |
reviewsToken |
Token for product reviews | String |
| Field | Description | Data Type |
|---|---|---|
referenceFields |
Custom fields specific to distributor | Object |
CustomerArtwork |
Array of artwork references | Array[ObjectId] |
These fields are explicitly excluded for security:
❌ password - Encrypted password
❌ passwordResetToken - Password reset token
❌ passwordOrigin - Original plain text password
GET https://api.mpowerpromo.com/customers/507f1f77bcf86cd799439011
Authorization: {{vault:bearer-token}}
{
"_id": "507f1f77bcf86cd799439011",
"customerId": 12345,
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"jobTitle": "Marketing Manager",
"isActive": true,
"rank": 5,
"source": "Web",
"distributorId": "507f1f77bcf86cd799439012",
"stores": [
"507f1f77bcf86cd799439013"
],
"companyId": {
"_id": "507f1f77bcf86cd799439014",
"companyName": "Acme Corporation",
"photo": "https://s3.amazonaws.com/company-logo.png",
"distributorId": "507f1f77bcf86cd799439012",
"referenceFields": {},
"notes": ""
},
"userId": {
"_id": "507f1f77bcf86cd799439015",
"firstName": "Jane",
"lastName": "Smith",
"photo": "https://s3.amazonaws.com/user-photo.png"
},
"adminUserId": {
"_id": "507f1f77bcf86cd799439016",
"firstName": "Bob",
"lastName": "Manager",
"photo": null
},
"sourceUserId": {
"_id": "507f1f77bcf86cd799439017",
"firstName": "Alice",
"lastName": "Creator",
"photo": null
},
"CustomerPhoneNumbers": [
{
"_id": "507f1f77bcf86cd799439018",
"phoneNumber": "555-123-4567",
"phoneType": "Work",
"extension": "123"
},
{
"_id": "507f1f77bcf86cd799439019",
"phoneNumber": "555-987-6543",
"phoneType": "Cell"
}
],
"CustomerAddresses": [
{
"_id": "507f1f77bcf86cd79943901a",
"street": "123 Main Street",
"street1": "Suite 400",
"city": "New York",
"state": "NY",
"zip": "10001",
"country": "US",
"isDefault": true
}
],
"CustomerBillingAddress": [
{
"_id": "507f1f77bcf86cd79943901b",
"street": "123 Main Street",
"city": "New York",
"state": "NY",
"zip": "10001",
"country": "US",
"isDefault": true
}
],
"CustomerShippers": [
{
"_id": "507f1f77bcf86cd79943901c",
"shipperName": "FedEx",
"accountNumber": "123456789",
"isDefault": true
}
],
"CustomerNotes": [
{
"_id": "507f1f77bcf86cd79943901d",
"note": "Prefers email communication",
"userId": {
"_id": "507f1f77bcf86cd799439015",
"firstName": "Jane",
"lastName": "Smith",
"photo": "https://s3.amazonaws.com/user-photo.png"
},
"createdAt": "2025-10-20T10:00:00.000Z"
}
],
"Documents": [
{
"_id": "507f1f77bcf86cd79943901e",
"fileName": "contract.pdf",
"title": "Service Contract",
"url": "https://s3.amazonaws.com/documents/contract.pdf",
"fileSize": 245678,
"uploadDate": "2025-10-15T14:30:00.000Z",
"userId": {
"_id": "507f1f77bcf86cd799439015",
"firstName": "Jane",
"lastName": "Smith",
"photo": "https://s3.amazonaws.com/user-photo.png"
}
}
],
"roles": [
{
"_id": "507f1f77bcf86cd79943901f",
"name": "Customer",
"settings": {
"general": ["view_orders", "place_orders"],
"menu": ["orders", "products"]
}
}
],
"customerDevice": {
"_id": "507f1f77bcf86cd799439020",
"source": "CREATE_ACCOUNT",
"location": {
"city": "New York",
"country": "US",
"ip": "192.168.1.1"
},
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)...",
"referrer": "https://google.com"
},
"utmData": {
"utmSource": "google",
"utmMedium": "cpc",
"utmCampaign": "summer_2025"
},
"socialData": [],
"registrationsSent": [
{
"createdAt": "2025-10-01T09:00:00.000Z",
"storeId": "507f1f77bcf86cd799439013"
}
],
"hasFollowUps": false,
"reviewsToken": "abc123xyz456",
"referenceFields": {},
"createdAt": "2025-10-01T09:00:00.000Z",
"updatedAt": "2025-10-28T10:00:00.000Z"
}
{
"message": "Customer not found"
}
{
"message": "Customer not found!"
}
{
"message": "Unauthorized"
}
Returned when user doesn't have permission to view this customer.
The endpoint applies role-based access:
Admin Users: Can view all customers in the system
Distributor Users: Can only view customers within their distributor
Regular Users: Access based on role settings
Field,Description,Data Type,Populated
_id,Customer's unique MongoDB ID,ObjectId,No
customerId,Sequential customer ID number,Number,No
email,Customer's email address,String,No
firstName,Customer's first name,String,No
lastName,Customer's last name,String,No
jobTitle,Customer's job title,String,No
isActive,Whether account is active,Boolean,No
rank,Customer ranking/priority,Number,No
companyId,Company object,Object,Yes
userId,Account Manager object,Object,Yes
adminUserId,Sales Admin object,Object,Yes
sourceUserId,User who created customer,Object,Yes
distributorId,Distributor's MongoDB ID,ObjectId,No
stores,Array of store IDs,Array[ObjectId],No
CustomerPhoneNumbers,Array of phone numbers,Array[Object],No
CustomerAddresses,Array of shipping addresses,Array[Object],No
CustomerBillingAddress,Array of billing addresses,Array[Object],No
CustomerShippers,Array of shipper accounts,Array[Object],No
CustomerNotes,Array of notes,Array[Object],Yes (userId)
Documents,Array of documents,Array[Object],Yes (full)
roles,Array of role objects,Array[Object],Yes (full)
customerDevice,Device info from creation,Object,No
utmData,UTM tracking data,Object,No
socialData,Social login connections,Array[Object],No
registrationsSent,Registration email records,Array[Object],No
createdAt,Account creation timestamp,Date,No
updatedAt,Last update timestamp,Date,No
Authentication Required: Must provide valid JWT Bearer token
Valid ObjectId: customerId must be a valid 24-character hex string
Excluded Fields: Password fields are never returned
Populated Fields: Related objects (company, users, documents, roles) are fully populated
Null Values: Fields may be null if not set
Access Control: Response filtered based on user permissions
No Query Params: This endpoint doesn't accept filtering or selection parameters
GET/customers
Method: GET
URL: https://api.mpowerpromo.com/customers
Authentication: Required (JWT Bearer token)
| Parameter | Description | Required | Data Type | Default | Example |
|---|---|---|---|---|---|
page |
Page number for pagination | No | Number | 1 | page=1 |
limit |
Number of records per page | No | Number | 25 | limit=25 |
onlyCount |
Return only count, no data | No | Boolean | false | onlyCount=true |
| Parameter | Description | Required | Data Type | Default | Example |
|---|---|---|---|---|---|
ascending |
Sort order (1=ascending, 0=descending) | No | Number | 0 | ascending=1 |
byColumn |
Enable column-specific sorting | No | Number | 0 | byColumn=1 |
orderBy |
Field name to sort by | No | String | - | orderBy=lastName |
| Parameter | Description | Required | Data Type | Default | Example |
|---|---|---|---|---|---|
query |
Search term (searches across multiple fields) | No | String | - | query=john |
email |
Filter by exact email | No | String | - | [email protected] |
firstName |
Filter by first name | No | String | - | firstName=John |
lastName |
Filter by last name | No | String | - | lastName=Doe |
jobTitle |
Filter by job title | No | String | - | jobTitle=Manager |
isActive |
Filter by active status | No | Boolean | - | isActive=true |
rank |
Filter by customer rank | No | Number | - | rank=5 |
source |
Filter by creation source | No | String | - | source=Web |
| Parameter | Description | Required | Data Type | Default | Example |
|---|---|---|---|---|---|
companyId |
Filter by company ID | No | ObjectId | - | companyId=507f1f77bcf86cd799439011 |
stores |
Filter by store ID (alias: store) |
No | ObjectId | - | stores=507f1f77bcf86cd799439012 |
store |
Filter by store ID | No | ObjectId | - | store=507f1f77bcf86cd799439012 |
| Parameter | Description | Required | Data Type | Default | Example |
|---|---|---|---|---|---|
userId |
Filter by account manager | No | ObjectId | - | userId=507f1f77bcf86cd799439013 |
adminUserId |
Filter by sales admin | No | ObjectId | - | adminUserId=507f1f77bcf86cd799439014 |
accountManagerId |
Filter by account manager (alternative) | No | ObjectId | - | accountManagerId=507f1f77bcf86cd799439013 |
salesAdminId |
Filter by sales admin (alternative) | No | ObjectId | - | salesAdminId=507f1f77bcf86cd799439014 |
sourceUserId |
Filter by user who created customer | No | ObjectId | - | sourceUserId=507f1f77bcf86cd799439015 |
| Parameter | Description | Required | Data Type | Default | Example |
|---|---|---|---|---|---|
customerId |
Filter by sequential customer ID | No | Number | - | customerId=12345 |
externalId |
Filter by external/third-party ID | No | String | - | externalId=EXT-12345 |
customerQBId |
Filter by QuickBooks customer ID | No | String | - | customerQBId=QB-12345 |
customerZohoId |
Filter by Zoho CRM customer ID | No | String | - | customerZohoId=ZOHO-12345 |
customerHubspotId |
Filter by HubSpot customer ID | No | String | - | customerHubspotId=HS-12345 |
customerXeroId |
Filter by Xero accounting customer ID | No | String | - | customerXeroId=XERO-12345 |
customerStripeId |
Filter by Stripe customer ID | No | String | - | customerStripeId=cus_12345 |
| Parameter | Description | Required | Data Type | Default | Example |
|---|---|---|---|---|---|
populate |
Array of fields to populate (comma-separated) | No | String | - | populate=companyId,userId |
populate[] |
Array of fields to populate (multiple params) | No | String | - | populate[]=companyId&populate[]=userId |
| Parameter | Description | Required | Data Type | Default | Example |
|---|---|---|---|---|---|
exportFormat |
Export format (csv, xlsx, etc.) | No | String | - | exportFormat=csv |
exportFields |
Fields to include in export | No | String | - | exportFields=email,firstName,lastName |
| Parameter | Description | Required | Data Type | Default | Example |
|---|---|---|---|---|---|
withLastFollowUp |
Include last follow-up information | No | Number | 0 | withLastFollowUp=1 |
hasFollowUps |
Filter by follow-up status | No | Boolean | - | hasFollowUps=true |
noDistributor |
Disable auto distributor filtering | No | Boolean | false | noDistributor=true |
loadByAccountManager |
Load by account manager context | No | Boolean | false | loadByAccountManager=true |
forceQueryByName |
Force search by name even if no results | No | Boolean | false | forceQueryByName=true |
defaultValue |
Include specific customer ID in results | No | ObjectId | - | defaultValue=507f1f77bcf86cd799439016 |
| Parameter | Description | Required | Data Type | Default | Example |
|---|---|---|---|---|---|
createdAt |
Filter by creation date | No | Date / Object | - | createdAt[gte]=2025-01-01 |
updatedAt |
Filter by update date | No | Date / Object | - | updatedAt[lte]=2025-12-31 |
lastContactedAt |
Filter by last contact date | No | Date / Object | - | lastContactedAt[gte]=2025-10-01 |
GET https://api.mpowerpromo.com/customers?page=1&limit=25&ascending=1
Authorization: Bearer {{token}}
GET https://api.mpowerpromo.com/customers?query=john&page=1&limit=25
Authorization: Bearer {{token}}
GET https://api.mpowerpromo.com/customers?externalId=EXT-12345
Authorization: Bearer {{token}}
GET https://api.mpowerpromo.com/customers?customerQBId=QB-12345&populate=companyId
Authorization: Bearer {{token}}
GET https://api.mpowerpromo.com/customers?customerStripeId=cus_abc123xyz
Authorization: Bearer {{token}}
GET https://api.mpowerpromo.com/customers?customerHubspotId=12345678&page=1&limit=1
Authorization: Bearer {{token}}
GET https://api.mpowerpromo.com/customers?store=507f1f77bcf86cd799439012&orderBy=lastName&ascending=1&page=1&limit=50
Authorization: Bearer {{token}}
GET https://api.mpowerpromo.com/customers?page=1&limit=25&withLastFollowUp=1&populate=companyId,userId,stores
Authorization: Bearer {{token}}
GET https://api.mpowerpromo.com/customers?userId=507f1f77bcf86cd799439013&page=1&limit=25&ascending=1
Authorization: Bearer {{token}}
GET https://api.mpowerpromo.com/customers?isActive=true&query=&page=1&limit=25
Authorization: Bearer {{token}}
GET https://api.mpowerpromo.com/customers?onlyCount=true&isActive=true
Authorization: Bearer {{token}}
GET https://api.mpowerpromo.com/customers?exportFormat=csv&exportFields=email,firstName,lastName,companyId,externalId
Authorization: Bearer {{token}}
GET https://api.mpowerpromo.com/customers?createdAt[gte]=2025-10-01&createdAt[lte]=2025-10-31&page=1&limit=25
Authorization: Bearer {{token}}
GET https://api.mpowerpromo.com/customers?store=507f1f77bcf86cd799439012&isActive=true&userId=507f1f77bcf86cd799439013&page=1&limit=25&orderBy=lastName&ascending=1&populate=companyId
Authorization: Bearer {{token}}
GET https://api.mpowerpromo.com/customers?customerId=12345
Authorization: Bearer {{token}}
{
"data": [
{
"_id": "507f1f77bcf86cd799439011",
"customerId": 12345,
"externalId": "EXT-12345",
"customerQBId": "QB-12345",
"customerStripeId": "cus_abc123xyz",
"customerHubspotId": "12345678",
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"jobTitle": "Marketing Manager",
"isActive": true,
"rank": 5,
"distributorId": "507f1f77bcf86cd799439012",
"stores": ["507f1f77bcf86cd799439013"],
"companyId": {
"_id": "507f1f77bcf86cd799439014",
"companyName": "Acme Corp"
},
"userId": {
"_id": "507f1f77bcf86cd799439015",
"firstName": "Jane",
"lastName": "Manager",
"photo": null
},
"source": "Web",
"createdAt": "2025-10-01T09:00:00.000Z",
"updatedAt": "2025-10-28T10:00:00.000Z"
}
],
"count": 150,
"referenceFields": []
}
| Field | Description | Data Type |
|---|---|---|
data |
Array of customer objects | Array[Object] |
count |
Total number of matching records | Number |
referenceFields |
Custom reference fields (if applicable) | Array |
{
"count": 150
}
Returns CSV file as text/plain with customer data.
| Field | Description | Data Type | Populated |
|---|---|---|---|
_id |
Customer MongoDB ID | ObjectId | No |
customerId |
Sequential customer ID | Number | No |
externalId |
External/third-party ID | String | No |
customerQBId |
QuickBooks customer ID | String | No |
customerZohoId |
Zoho CRM customer ID | String | No |
customerHubspotId |
HubSpot customer ID | String | No |
customerXeroId |
Xero accounting customer ID | String | No |
customerStripeId |
Stripe customer ID | String | No |
email |
Email address | String | No |
firstName |
First name | String | No |
lastName |
Last name | String | No |
jobTitle |
Job title | String | No |
isActive |
Active status | Boolean | No |
rank |
Customer rank | Number | No |
distributorId |
Distributor ID | ObjectId | No |
supplierId |
Supplier ID | ObjectId | No |
stores |
Store IDs array | Array[ObjectId] | Optional |
companyId |
Company object | Object | Optional |
userId |
Account manager | Object | Optional |
adminUserId |
Sales admin | Object | Optional |
sourceUserId |
Creator user | Object | Optional |
CustomerPhoneNumbers |
Phone numbers array | Array[Object] | No |
CustomerAddresses |
Addresses array | Array[Object] | No |
source |
Creation source | String | No |
createdAt |
Creation date | Date | No |
updatedAt |
Last update date | Date | No |
lastContactedAt |
Last contact date | Date | No |
hasFollowUps |
Has active follow-ups | Boolean | No |
Note: Password fields (password, passwordOrigin, passwordResetToken) are excluded from responses.
Parameter,Description,Required,Data Type,Example
page,Page number for pagination,No,Number,page=1
limit,Number of records per page,No,Number,limit=25
onlyCount,Return only count no data,No,Boolean,onlyCount=true
ascending,Sort order (1=asc 0=desc),No,Number,ascending=1
byColumn,Enable column sorting,No,Number,byColumn=1
orderBy,Field to sort by,No,String,orderBy=lastName
query,Search term,No,String,query=john
email,Filter by email,No,String,[email protected]
firstName,Filter by first name,No,String,firstName=John
lastName,Filter by last name,No,String,lastName=Doe
jobTitle,Filter by job title,No,String,jobTitle=Manager
isActive,Filter by active status,No,Boolean,isActive=true
rank,Filter by customer rank,No,Number,rank=5
source,Filter by creation source,No,String,source=Web
companyId,Filter by company,No,ObjectId,companyId=507f...
stores,Filter by store,No,ObjectId,stores=507f...
store,Filter by store (alias),No,ObjectId,store=507f...
userId,Filter by account manager,No,ObjectId,userId=507f...
adminUserId,Filter by sales admin,No,ObjectId,adminUserId=507f...
accountManagerId,Filter by account manager,No,ObjectId,accountManagerId=507f...
salesAdminId,Filter by sales admin,No,ObjectId,salesAdminId=507f...
sourceUserId,Filter by creator user,No,ObjectId,sourceUserId=507f...
customerId,Filter by sequential customer ID,No,Number,customerId=12345
externalId,Filter by external/third-party ID,No,String,externalId=EXT-12345
customerQBId,Filter by QuickBooks ID,No,String,customerQBId=QB-12345
customerZohoId,Filter by Zoho CRM ID,No,String,customerZohoId=ZOHO-12345
customerHubspotId,Filter by HubSpot ID,No,String,customerHubspotId=HS-12345
customerXeroId,Filter by Xero accounting ID,No,String,customerXeroId=XERO-12345
customerStripeId,Filter by Stripe customer ID,No,String,customerStripeId=cus_12345
populate,Fields to populate,No,String,populate=companyId,userId
exportFormat,Export format,No,String,exportFormat=csv
exportFields,Fields to export,No,String,exportFields=email,firstName
withLastFollowUp,Include follow-up info,No,Number,withLastFollowUp=1
hasFollowUps,Filter by follow-up status,No,Boolean,hasFollowUps=true
noDistributor,Disable distributor filter,No,Boolean,noDistributor=true
loadByAccountManager,Load by account manager context,No,Boolean,loadByAccountManager=true
forceQueryByName,Force search by name,No,Boolean,forceQueryByName=true
defaultValue,Include specific customer,No,ObjectId,defaultValue=507f...
createdAt,Filter by creation date,No,Date/Object,createdAt[gte]=2025-01-01
updatedAt,Filter by update date,No,Date/Object,updatedAt[lte]=2025-12-31
lastContactedAt,Filter by last contact date,No,Date/Object,lastContactedAt[gte]=2025-10-01
Auto-filtering by Distributor: Results automatically filtered by logged-in user's distributor (unless admin with noDistributor=true)
Deleted Records: Automatically excluded (deletedAt: { $exists: false })
Role-based Access:
Admin roles can view all distributor customers
Regular users see customers based on role settings
Populate: Only populated if explicitly requested via populate parameter
Search Query: Searches across multiple fields (email, firstName, lastName, etc.)
External IDs: All external ID filters perform exact matches
/customers?page=1&limit=25&ascending=1&orderBy=lastName
/customers?query=john&page=1&limit=25
/customers?externalId=EXT-12345
/customers?customerQBId=QB-12345
/customers?customerStripeId=cus_12345
/customers?store=507f1f77bcf86cd799439012&page=1&limit=25
/customers?onlyCount=true&isActive=true
/customers?exportFormat=csv&exportFields=email,firstName,lastName,companyId,externalId
/customers?page=1&limit=25&populate=companyId,userId,stores&withLastFollowUp=1
Required Parameters: None - all parameters are optional
Empty Query String: query="" is valid and returns all customers
Multiple Filters: Can combine multiple filter parameters
Date Filtering: Use MongoDB query operators like [gte], [lte], [gt], [lt]
Populate Performance: Only populate fields you need to reduce response size
Export: When exporting, pagination is ignored and all matching records are returned
Authentication: Valid JWT Bearer token required in all cases
External IDs: All external ID fields are case-sensitive and perform exact matches
Case Sensitivity: Most string filters are case-sensitive unless using query parameter
POST/customers
| Field | Description | Required | Data Type |
|---|---|---|---|
email |
Customer email address (unique per distributor) | Yes | String |
stores |
Array of store IDs customer has access to | Yes | Array[ObjectId] |
firstName |
Customer's first name | No | String |
lastName |
Customer's last name | No | String |
password |
Plain text password (auto-encrypted) | No | String |
passwordOrigin |
Original password (stored separately) | No | String |
| Field | Description | Required | Data Type |
|---|---|---|---|
customerCompany |
Company name (auto-creates company record) | No | String |
companyId |
Direct reference to existing company | No | ObjectId |
jobTitle |
Customer's job title/position | No | String |
| Field | Description | Required | Data Type |
|---|---|---|---|
sourceUserId |
User who created this customer (auto-set) | No | ObjectId |
distributorId |
Distributor ID (auto-assigned) | No | ObjectId |
supplierId |
Supplier ID if applicable | No | ObjectId |
source |
Creation source (defaults to "Web") | No | String |
createdBy |
User who created the record (auto-set) | No | ObjectId |
| Field | Description | Required | Data Type |
|---|---|---|---|
userId |
Account Manager user ID | No | ObjectId |
adminUserId |
Sales Admin user ID | No | ObjectId |
accountManagerId |
Alternative account manager field | No | ObjectId |
salesAdminId |
Alternative sales admin field | No | ObjectId |
isActive |
Whether customer account is active | No | Boolean |
rank |
Customer ranking/priority | No | Number |
customerId |
Sequential customer ID (auto-generated) | No | Number |
| Field | Description | Required | Data Type |
|---|---|---|---|
CustomerPhoneNumbers |
Array of phone number objects | No | Array[Object] |
CustomerPhoneNumbers[].phoneNumber |
Phone number string | No | String |
CustomerPhoneNumbers[].phoneType |
Type: Work, Cell, Home, Fax | No | String |
CustomerPhoneNumbers[].extension |
Phone extension | No | String |
| Field | Description | Required | Data Type |
|---|---|---|---|
CustomerAddresses |
Array of shipping address objects | No | Array[Object] |
CustomerAddresses[].street |
Street address line 1 | No | String |
CustomerAddresses[].street1 |
Street address line 2 | No | String |
CustomerAddresses[].city |
City name | No | String |
CustomerAddresses[].state |
State/Province code | No | String |
CustomerAddresses[].zip |
Zip/Postal code | No | String |
CustomerAddresses[].country |
Country code (ISO 2-letter) | No | String |
CustomerAddresses[].isDefault |
Mark as default address | No | Boolean |
| Field | Description | Required | Data Type |
|---|---|---|---|
CustomerBillingAddress |
Array of billing address objects | No | Array[Object] |
CustomerBillingAddress[].street |
Street address line 1 | No | String |
CustomerBillingAddress[].city |
City name | No | String |
CustomerBillingAddress[].state |
State/Province code | No | String |
CustomerBillingAddress[].zip |
Zip/Postal code | No | String |
CustomerBillingAddress[].country |
Country code (REQUIRED for billing) | Yes* | String |
CustomerBillingAddress[].isDefault |
Mark as default billing address | No | Boolean |
| Field | Description | Required | Data Type |
|---|---|---|---|
CustomerShippers |
Array of shipper account objects | No | Array[Object] |
CustomerShippers[].shipperName |
Shipper company name | No | String |
CustomerShippers[].accountNumber |
Shipper account number | No | String |
CustomerShippers[].isDefault |
Mark as default shipper | No | Boolean |
| Field | Description | Required | Data Type |
|---|---|---|---|
CustomerNotes |
Array of note objects | No | Array[Object] |
CustomerNotes[].note |
Note text content | No | String |
CustomerNotes[].userId |
User who created note | No | ObjectId |
CustomerNotes[].createdAt |
Note creation timestamp | No | Date (ISO 8601) |
Documents |
Array of document/upload IDs | No | Array[ObjectId] |
| Field | Description | Required | Data Type |
|---|---|---|---|
roles |
Array of customer role IDs | No | Array[ObjectId] |
| Field | Description | Required | Data Type |
|---|---|---|---|
socialData |
Array of social login objects | No | Array[Object] |
socialData[].service |
Social network (facebook, google, etc.) | No | String |
socialData[].id |
Social network user ID | No | String |
| Field | Description | Required | Data Type |
|---|---|---|---|
sendRegistrationEmail |
Send welcome email immediately | No | Boolean |
registrationsSent |
Array of registration email records | No | Array[Object] |
| Field | Description | Required | Data Type |
|---|---|---|---|
referenceFields |
Custom fields specific to distributor | No | Object |
CustomerArtwork |
Array of artwork objects (rarely used) | No | Array[Object] |
| Field | Description | Required | Data Type |
|---|---|---|---|
customerDeviceId |
Customer device tracking ID | No | ObjectId |
Required Fields: Only email and stores are strictly required
Auto-Generated: Fields like customerId, createdBy, sourceUserId, and distributorId are auto-set if not provided
Conditional Required: CustomerBillingAddress[].country is required IF you're adding billing addresses
ObjectId Format: Use valid MongoDB ObjectId strings (24 hex characters)
Date Format: Use ISO 8601 format (e.g., "2025-10-28T10:00:00.000Z")
Country Codes: Use ISO 2-letter codes (US, CA, GB, etc.)
Phone Types: Common values are "Work", "Cell", "Home", "Fax"
{
"email": "[email protected]",
"stores": [
"507f1f77bcf86cd799439011"
],
"firstName": "John",
"lastName": "Doe",
"jobTitle": "Marketing Manager",
"password": "SecurePassword123!",
"passwordOrigin": "SecurePassword123!",
"customerCompany": "Acme Corporation",
"source": "Web",
"userId": "507f1f77bcf86cd799439016",
"adminUserId": "507f1f77bcf86cd799439017",
"isActive": true,
"rank": 5,
"sendRegistrationEmail": true,
"CustomerPhoneNumbers": [
{
"phoneNumber": "555-123-4567",
"phoneType": "Work",
"extension": "123"
},
{
"phoneNumber": "555-987-6543",
"phoneType": "Cell"
}
],
"CustomerAddresses": [
{
"street": "123 Main Street",
"street1": "Suite 400",
"city": "New York",
"state": "NY",
"zip": "10001",
"country": "US",
"isDefault": true
}
],
"CustomerBillingAddress": [
{
"street": "123 Main Street",
"city": "New York",
"state": "NY",
"zip": "10001",
"country": "US",
"isDefault": true
}
],
"CustomerShippers": [
{
"shipperName": "FedEx",
"accountNumber": "123456789",
"isDefault": true
}
],
"CustomerNotes": [
{
"note": "Prefers email communication",
"userId": "507f1f77bcf86cd799439018",
"createdAt": "2025-10-28T10:00:00.000Z"
}
],
"roles": [
"507f1f77bcf86cd799439019"
],
"Documents": [],
"socialData": [],
"CustomerArtwork": []
}PUT/customers/:customerId
Method: PUT or PATCH
URL: https://api.mpowerpromo.com/customers/{{customerId}}
Authentication: Required (JWT Bearer token)
Note: Both PUT and PATCH methods are supported and use the same handler.
| Parameter | Description | Required | Data Type | Example |
|---|---|---|---|---|
customerId |
MongoDB ObjectId of the customer | Yes | ObjectId | 507f1f77bcf86cd799439011 |
| Header | Description | Required | Example |
|---|---|---|---|
Authorization |
Bearer JWT token | Yes | {{vault:bearer-token}} |
Content-Type |
Content type | Yes | application/json |
| Field | Description | Required | Data Type | Notes |
|---|---|---|---|---|
email |
Customer email address | No | String | Must be unique per distributor |
firstName |
Customer's first name | No | String | - |
lastName |
Customer's last name | No | String | - |
jobTitle |
Job title/position | No | String | - |
isActive |
Account active status | No | Boolean | - |
rank |
Customer ranking/priority | No | Number | - |
| Field | Description | Required | Data Type | Notes |
|---|---|---|---|---|
customerCompany |
Company name (updates company record) | No | String | Updates linked company's name |
companyId |
Company ObjectId reference | No | ObjectId | - |
| Field | Description | Required | Data Type | Notes |
|---|---|---|---|---|
passwordOrigin |
Original password (plain text) | No | String | Stored separately, encrypts automatically |
Important: password field is automatically removed from updates for security. Use passwordOrigin to update password.
| Field | Description | Required | Data Type | Notes |
|---|---|---|---|---|
userId |
Account Manager ObjectId | No | ObjectId | - |
adminUserId |
Sales Admin ObjectId | No | ObjectId | - |
sourceUserId |
User who created customer | No | ObjectId | - |
| Field | Description | Required | Data Type | Notes |
|---|---|---|---|---|
stores |
Array of store IDs | No | Array[ObjectId] | Duplicates auto-removed |
distributorId |
Distributor ObjectId | No | ObjectId | - |
supplierId |
Supplier ObjectId | No | ObjectId | - |
source |
Creation source | No | String | e.g., "Web", "API", "Import" |
| Field | Description | Required | Data Type | Notes |
|---|---|---|---|---|
externalId |
External/third-party ID | No | String | - |
customerQBId |
QuickBooks customer ID | No | String | - |
customerZohoId |
Zoho CRM customer ID | No | String | - |
customerHubspotId |
HubSpot customer ID | No | String | - |
customerXeroId |
Xero accounting customer ID | No | String | - |
customerStripeId |
Stripe customer ID | No | String | - |
| Field | Description | Required | Data Type | Notes |
|---|---|---|---|---|
CustomerPhoneNumbers |
Complete array of phone objects | No | Array[Object] | Replaces entire array |
CustomerAddresses |
Complete array of address objects | No | Array[Object] | State fields auto-filled |
CustomerBillingAddress |
Complete array of billing address objects | No | Array[Object] | State fields auto-filled |
CustomerShippers |
Complete array of shipper objects | No | Array[Object] | Replaces entire array |
CustomerNotes |
Complete array of note objects | No | Array[Object] | Replaces entire array |
{
"_id": "507f1f77bcf86cd799439011",
"phoneNumber": "555-123-4567",
"phoneType": "Work",
"extension": "123"
}
{
"_id": "507f1f77bcf86cd799439012",
"street": "123 Main Street",
"street1": "Suite 400",
"city": "New York",
"state": "NY",
"zip": "10001",
"country": "US",
"isDefault": true
}
{
"_id": "507f1f77bcf86cd799439013",
"street": "123 Main Street",
"city": "New York",
"state": "NY",
"zip": "10001",
"country": "US",
"isDefault": true
}
{
"_id": "507f1f77bcf86cd799439014",
"shipperName": "FedEx",
"accountNumber": "123456789",
"isDefault": true
}
{
"_id": "507f1f77bcf86cd799439015",
"note": "Important customer note",
"userId": "507f1f77bcf86cd799439016",
"createdAt": "2025-10-28T10:00:00.000Z"
}
| Field | Description | Required | Data Type | Notes |
|---|---|---|---|---|
Documents |
Array of document ObjectIds | No | Array[ObjectId] | - |
roles |
Array of role ObjectIds | No | Array[ObjectId] | - |
socialData |
Array of social login objects | No | Array[Object] | - |
referenceFields |
Custom fields specific to distributor | No | Object | - |
hasFollowUps |
Whether customer has active follow-ups | No | Boolean | - |
lastContactedAt |
Last contact timestamp | No | Date | ISO 8601 format |
These fields are automatically managed and cannot be directly updated:
❌ password - Removed for security (use passwordOrigin)
❌ __v - Mongoose version key
✅ customerId - Auto-generated if missing
✅ updatedAt - Auto-updated on save
PUT https://api.mpowerpromo.com/customers/507f1f77bcf86cd799439011
Authorization: Bearer {{token}}
Content-Type: application/json
{
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]",
"jobTitle": "Senior Marketing Manager"
}
PUT https://api.mpowerpromo.com/customers/507f1f77bcf86cd799439011
Authorization: Bearer {{token}}
Content-Type: application/json
{
"externalId": "EXT-12345",
"customerQBId": "QB-98765",
"customerStripeId": "cus_abc123xyz",
"customerHubspotId": "12345678"
}
PUT https://api.mpowerpromo.com/customers/507f1f77bcf86cd799439011
Authorization: Bearer {{token}}
Content-Type: application/json
{
"passwordOrigin": "NewSecurePassword123!"
}
PUT https://api.mpowerpromo.com/customers/507f1f77bcf86cd799439011
Authorization: Bearer {{token}}
Content-Type: application/json
{
"userId": "507f1f77bcf86cd799439016",
"adminUserId": "507f1f77bcf86cd799439017",
"isActive": true,
"rank": 5
}
PUT https://api.mpowerpromo.com/customers/507f1f77bcf86cd799439011
Authorization: Bearer {{token}}
Content-Type: application/json
{
"customerCompany": "Acme Corporation Updated",
"jobTitle": "VP of Marketing"
}
PUT https://api.mpowerpromo.com/customers/507f1f77bcf86cd799439011
Authorization: Bearer {{token}}
Content-Type: application/json
{
"stores": [
"507f1f77bcf86cd799439020",
"507f1f77bcf86cd799439021"
]
}
PUT https://api.mpowerpromo.com/customers/507f1f77bcf86cd799439011
Authorization: Bearer {{token}}
Content-Type: application/json
{
"CustomerPhoneNumbers": [
{
"phoneNumber": "555-123-4567",
"phoneType": "Work",
"extension": "123"
},
{
"phoneNumber": "555-987-6543",
"phoneType": "Cell"
}
]
}
PUT https://api.mpowerpromo.com/customers/507f1f77bcf86cd799439011
Authorization: Bearer {{token}}
Content-Type: application/json
{
"CustomerAddresses": [
{
"street": "456 Oak Avenue",
"street1": "Building B",
"city": "Los Angeles",
"state": "CA",
"zip": "90001",
"country": "US",
"isDefault": true
}
]
}
PUT https://api.mpowerpromo.com/customers/507f1f77bcf86cd799439011
Authorization: Bearer {{token}}
Content-Type: application/json
{
"CustomerBillingAddress": [
{
"street": "789 Billing Street",
"city": "Chicago",
"state": "IL",
"zip": "60601",
"country": "US",
"isDefault": true
}
]
}
PUT https://api.mpowerpromo.com/customers/507f1f77bcf86cd799439011
Authorization: Bearer {{token}}
Content-Type: application/json
{
"firstName": "Jane",
"lastName": "Smith",
"email": "[email protected]",
"jobTitle": "Director of Operations",
"externalId": "EXT-UPDATED-001",
"customerStripeId": "cus_newstripe123",
"isActive": true,
"rank": 10,
"userId": "507f1f77bcf86cd799439016",
"stores": [
"507f1f77bcf86cd799439020"
],
"CustomerPhoneNumbers": [
{
"phoneNumber": "555-111-2222",
"phoneType": "Work"
}
],
"referenceFields": {
"customField1": "Updated Value",
"customField2": "New Value"
}
}
{
"$$notification": {
"success": "Successfully Saved"
},
"model": {
"_id": "507f1f77bcf86cd799439011",
"customerId": 12345,
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"jobTitle": "Senior Marketing Manager",
"externalId": "EXT-12345",
"customerQBId": "QB-98765",
"customerStripeId": "cus_abc123xyz",
"customerHubspotId": "12345678",
"isActive": true,
"rank": 5,
"distributorId": "507f1f77bcf86cd799439012",
"stores": ["507f1f77bcf86cd799439020"],
"userId": "507f1f77bcf86cd799439016",
"adminUserId": "507f1f77bcf86cd799439017",
"CustomerPhoneNumbers": [
{
"_id": "507f1f77bcf86cd799439018",
"phoneNumber": "555-123-4567",
"phoneType": "Work",
"extension": "123"
}
],
"CustomerAddresses": [
{
"_id": "507f1f77bcf86cd79943901a",
"street": "456 Oak Avenue",
"city": "Los Angeles",
"state": "CA",
"zip": "90001",
"country": "US"
}
],
"createdAt": "2025-10-01T09:00:00.000Z",
"updatedAt": "2025-10-28T10:30:00.000Z"
}
}
{
"$$notification": {
"error": "Email already in use"
}
}
{
"$$notification": {
"error": "Validation error message"
}
}
{
"error": "User is not available"
}
{
"message": "Customer not found"
}
{
"message": "Unauthorized"
}
Validates email is unique across the distributor
Excludes the current customer from uniqueness check
Case-insensitive check
If customerCompany is provided, updates the linked company's name
Uses the existing companyId to find and update the company
password field is automatically removed from request body
passwordOrigin is extracted and handled separately
Password is encrypted automatically before saving
If both CustomerAddresses and CustomerBillingAddress are provided
State fields are automatically filled/validated
If stores array is updated, duplicates are automatically removed
Uses clearStoresDuplicates() helper
stores are updated, customer is automatically synced to SendGridcustomerId from sequenceAll changes are logged to the Log collection
Tracks before/after state with detailed diff
Includes IP, user, and timestamp
Automatically clears all cache keys after update
Clears runtime cache
Automatically removes private/sensitive fields via removePrivateData()
Based on user permissions and context
password - Use passwordOrigin instead (auto-encrypted)
__v - Mongoose version key (auto-managed)
deletedAt - Use DELETE endpoint instead
customerId - Auto-generated sequential ID if missing
updatedAt - Auto-updated timestamp
createdBy - Cannot be changed after creation
Email - Must be valid email format and unique per distributor
CustomerBillingAddress - Entries without country are filtered out
Stores - Duplicates automatically removed
ObjectId Fields - Must be valid MongoDB ObjectIds
SendGrid - Customer synced to SendGrid if stores updated
HubSpot - Customer synced to HubSpot after save
Cache - All caches cleared after update
Logging - Changes tracked in Log collection with full diff
Company - Company name updated if customerCompany provided
Field,Description,Required,Data Type,Updatable,Notes
email,Customer email address,No,String,Yes,Must be unique per distributor
firstName,First name,No,String,Yes,-
lastName,Last name,No,String,Yes,-
jobTitle,Job title,No,String,Yes,-
isActive,Active status,No,Boolean,Yes,-
rank,Customer rank,No,Number,Yes,-
customerCompany,Company name,No,String,Yes,Updates linked company record
companyId,Company reference,No,ObjectId,Yes,-
passwordOrigin,Plain text password,No,String,Yes,Auto-encrypted
userId,Account Manager,No,ObjectId,Yes,-
adminUserId,Sales Admin,No,ObjectId,Yes,-
sourceUserId,Creator user,No,ObjectId,Yes,-
stores,Store IDs array,No,Array[ObjectId],Yes,Auto-deduped
distributorId,Distributor ID,No,ObjectId,Yes,-
supplierId,Supplier ID,No,ObjectId,Yes,-
source,Creation source,No,String,Yes,-
externalId,External/third-party ID,No,String,Yes,-
customerQBId,QuickBooks ID,No,String,Yes,-
customerZohoId,Zoho CRM ID,No,String,Yes,-
customerHubspotId,HubSpot ID,No,String,Yes,-
customerXeroId,Xero ID,No,String,Yes,-
customerStripeId,Stripe ID,No,String,Yes,-
CustomerPhoneNumbers,Phone array,No,Array[Object],Yes,Replaces entire array
CustomerAddresses,Address array,No,Array[Object],Yes,Replaces entire array
CustomerBillingAddress,Billing address array,No,Array[Object],Yes,Replaces entire array
CustomerShippers,Shipper array,No,Array[Object],Yes,Replaces entire array
CustomerNotes,Notes array,No,Array[Object],Yes,Replaces entire array
Documents,Document IDs,No,Array[ObjectId],Yes,-
roles,Role IDs,No,Array[ObjectId],Yes,-
socialData,Social login data,No,Array[Object],Yes,-
referenceFields,Custom fields,No,Object,Yes,-
hasFollowUps,Has follow-ups flag,No,Boolean,Yes,-
lastContactedAt,Last contact date,No,Date,Yes,ISO 8601 format
password,Password (encrypted),No,String,No,Use passwordOrigin instead
customerId,Sequential customer ID,No,Number,No,Auto-generated if missing
__v,Version key,No,Number,No,Auto-managed by Mongoose
Partial Updates: Only send fields you want to update
Email Changes: Verify email uniqueness before updating
Password Updates: Always use passwordOrigin, never password
Array Fields: When updating arrays, send the complete array (not individual items)
External IDs: Use appropriate external ID fields for integrations
Validation: Check for validation errors in response
Logging: All changes are logged - ensure user has proper context
Cache: Updates clear cache - may affect performance in high-volume scenarios
{
"userId": null,
"adminUserId": null,
"email": "[email protected]",
"passwordOrigin": "11111",
"sourceUserId": "5f989350956add0fd61f08bb",
"companyId": null,
"CustomerPhoneNumbers": [],
"CustomerBillingAddress": [
{
"country": "",
"state": ""
}
],
"stores": [
{
"_id": "63911c18053945656f1cecf6",
"storeName": "MPower Distributor Store",
"storeUrl": "storeprod.mpowerpromo.com"
}
],
"states": [],
"isActive": true,
"isTest": false,
"firstName": "Customer",
"lastName": "Lastname"
}DELETE/customers/:customerId
Method: DELETE
URL: https://api.mpowerpromo.com/customers/{{customerId}}
Authentication: Required (JWT Bearer token)
Important: This is a soft delete - the customer record is not permanently removed from the database. Instead, a deletedAt timestamp is set, marking the customer as deleted.
| Parameter | Description | Required | Data Type | Example |
|---|---|---|---|---|
customerId |
MongoDB ObjectId of the customer | Yes | ObjectId | 507f1f77bcf86cd799439011 |
| Header | Description | Required | Example |
|---|---|---|---|
Authorization |
Bearer JWT token | Yes | {{vault:bearer-token}} |
None - This endpoint does not require a request body.
None - This endpoint does not accept query parameters.
DELETE https://api.mpowerpromo.com/customers/507f1f77bcf86cd799439011
Authorization: Bearer {{token}}
Method: DELETE
URL: https://api.mpowerpromo.com/customers/507f1f77bcf86cd799439011
Headers:
Authorization: Bearer {{token}}
Body: None
Returns the deleted customer object with the deletedAt field set:
{
"_id": "507f1f77bcf86cd799439011",
"customerId": 12345,
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"jobTitle": "Marketing Manager",
"externalId": "EXT-12345",
"customerQBId": "QB-98765",
"customerStripeId": "cus_abc123xyz",
"isActive": true,
"distributorId": "507f1f77bcf86cd799439012",
"stores": ["507f1f77bcf86cd799439013"],
"companyId": "507f1f77bcf86cd799439014",
"userId": "507f1f77bcf86cd799439015",
"CustomerPhoneNumbers": [],
"CustomerAddresses": [],
"createdAt": "2025-10-01T09:00:00.000Z",
"updatedAt": "2025-10-28T10:00:00.000Z",
"deletedAt": "2025-10-28T15:30:00.000Z"
}
{
"message": "Customer not found"
}
{
"message": "Unauthorized"
}
{
"message": "Access denied"
}
Soft Delete
Customer record is NOT permanently removed
deletedAt field is set to current timestamp
Customer remains in database but is marked as deleted
API Token Logging
Delete action is logged via logCustomerApiTokenRequest()
Tracks which user/token performed the deletion
Includes timestamp and customer information
Customer Visibility
Deleted customers are automatically excluded from GET /customers list queries
Filter applied: deletedAt: { $exists: false }
Can still be retrieved by direct ID if needed (for audit/recovery)
Related Data
Customer's orders, artwork, documents remain intact
Relationships preserved for historical/audit purposes
No cascade deletion of related records
✅ What This Endpoint Does (Soft Delete):
Sets deletedAt timestamp
Hides customer from normal queries
Preserves all data for audit/recovery
Maintains referential integrity
❌ What This Endpoint Does NOT Do (Hard Delete):
Does not permanently remove the record
Does not delete related orders
Does not delete customer artwork
Does not remove from database
To restore a soft-deleted customer, you would need to:
Use a direct database update to remove the deletedAt field
Or use a custom restore endpoint if available
User must have appropriate permissions to delete customers
Typically restricted to admin users or account managers
Deletion is logged for audit trail
Important for integrations:
External IDs (externalId, customerQBId, customerStripeId, etc.) remain in the database
If re-creating a customer with the same external ID, you may encounter conflicts
Consider checking for soft-deleted customers before creating new ones
Deleted customers can still be queried directly by ID:
GET https://api.mpowerpromo.com/customers/507f1f77bcf86cd799439011
Authorization: Bearer {{token}}
Response will include:
{
"_id": "507f1f77bcf86cd799439011",
"deletedAt": "2025-10-28T15:30:00.000Z",
...
}
Deleted customers are automatically excluded:
GET https://api.mpowerpromo.com/[email protected]
Authorization: Bearer {{token}}
Response:
{
"data": [],
"count": 0
}
DELETE https://api.mpowerpromo.com/customers/507f1f77bcf86cd799439011
Authorization: Bearer {{token}}
DELETE https://api.mpowerpromo.com/customers/507f1f77bcf86cd799439012
Authorization: Bearer {{token}}
DELETE https://api.mpowerpromo.com/customers/507f1f77bcf86cd799439013
Authorization: Bearer {{token}}
Note: For full GDPR compliance, you may need additional steps to anonymize or permanently delete data.
POST https://api.mpowerpromo.com/customers
PUT https://api.mpowerpromo.com/customers/{{customerId}}
GET https://api.mpowerpromo.com/customers/{{customerId}}
GET https://api.mpowerpromo.com/customers?page=1&limit=25
| Aspect | Details |
|---|---|
| Method | DELETE |
| URL | https://api.mpowerpromo.com/customers/:customerId |
| Auth | Required (Bearer token) |
| Body | None |
| Query Params | None |
| Delete Type | Soft delete (sets deletedAt) |
| Returns | Updated customer object with deletedAt |
| Cascade | No - related data preserved |
| Logging | Yes - API token request logged |
| Reversible | Yes - via database update |
| Response Code | 200 (Success), 404 (Not Found), 401 (Unauthorized) |
Field,Value
Method,DELETE
Endpoint,/customers/:customerId
Authentication,Required (JWT Bearer)
Request Body,None
Query Parameters,None
Delete Type,Soft Delete
Sets Field,deletedAt
Returns,Customer object with deletedAt timestamp
Removes Data,No - soft delete only
Cascade Delete,No
Logged,Yes - via logCustomerApiTokenRequest
Reversible,Yes - requires database update
Success Code,200
Error Codes,"404 (Not Found), 401 (Unauthorized), 403 (Forbidden)"
Confirm Before Delete: Always confirm user intent before deleting
Check Dependencies: Review customer's orders/data before deletion
Audit Trail: Deletion is logged - ensure proper user context
External Systems: Notify integrated systems (QuickBooks, Stripe, etc.) about deletion
Recovery Plan: Have a process to restore accidentally deleted customers
GDPR Compliance: If permanent deletion needed for compliance, additional steps required
Batch Operations: For bulk deletions, consider creating a batch endpoint
See how MPower replaces your disconnected tools with one platform — from the first lead to the final shipment.
A product specialist will reach out within one business day to schedule your demo.