Customers API
Bulk upsert customer records for a tenant
Overview
The Customers endpoint supports bulk creation and updates of customer records for a tenant. Each request processes an array of customer objects and applies upsert semantics based on the tenant's identifier configuration.
This endpoint is used to synchronize customer profiles, preferences, and consent attributes from upstream systems into Replenit.
Quick Reference
Endpoints
Authentication
x-replenit-auth-keyheader requiredUsage
- • Create new customer records
- • Update existing customer attributes
- • Synchronize customer profiles
- • Update consent and preference fields
Identifiers
- • At least one of
CustomerIdorEmailrequired - • Matching behavior depends on tenant config
Response
Returns the number of processed records
Endpoints
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| tenantId | GUID | Yes | Tenant identifier |
Request
- Body: JSON array of UpsertCustomerDto objects
- Content-Type: application/json
Success Response
- Status: 200 OK
- Body: Response envelope containing
data.count
Error Responses
| Status | Description |
|---|---|
| 400 | Invalid request payload |
| 404 | Tenant not found |
| 500 | Internal server error |
Identifier Behavior
Customer matching is determined by the tenant's identifier priority configuration.
Identifier Priority
| Priority Setting | Identifier Used | Description |
|---|---|---|
| customerid | CustomerId | External customer identifier |
| Email address |
Matching Rules
- If the configured identifier exists, the customer record is updated
- If the configured identifier does not exist, a new customer record is created
- Secondary identifiers may be stored but are not used for matching
Example
{
"CustomerId": "USER-12345",
"Email": "customer@example.com",
"Name": "Jane",
"Surname": "Doe"
}Identifier priority can be viewed or modified in the tenant configuration within the Replenit panel.
Identifier Alignment, Usage, and PII Considerations
If CustomerId is used as the primary identifier, the same identifier must be configured as the customer identifier in all downstream systems that consume Replenit data, including marketing automation, CRM, analytics, and activation platforms.
If Email is used as the primary identifier, the same email address must be configured as the customer identifier in downstream systems.
When a stable CustomerId is available and consistently used across downstream systems, email address should not be used as the primary identifier for matching. In this case, email may be provided only when required for downstream communication and should not be relied on for identity resolution.
PII and Data Minimization
From a PII and data minimization perspective, Replenit does not require email address to be present when a stable CustomerId is available and used across systems. Where possible, customer records should be ingested using non-PII identifiers.
Inconsistent identifier usage or unnecessary reliance on PII across systems may result in fragmented customer profiles or increased data governance risk.
Request Schema
UpsertCustomerDto
| Field | Type | Max Length | Required | Description |
|---|---|---|---|---|
| CustomerId | string | 100 | Conditional | External customer identifier |
| string | 255 | Conditional | Customer email address | |
| Name | string | 100 | No | First name |
| Surname | string | 100 | No | Last name |
| Phone | string | 20 | No | Phone number |
| Language | string | 10 | No | Language code (BCP 47) |
| Username | string | 500 | No | External username |
| EmailOptin | boolean | – | No | Email consent flag |
| SmsOptin | boolean | – | No | SMS consent flag |
| WhatsappOptin | boolean | – | No | WhatsApp consent flag |
| AppPushOptin | boolean | – | No | App push consent flag |
| GdprOptin | boolean | – | No | Controls whether the customer record may be processed by Replenit |
| IsExcluded | boolean | – | No | Exclude customer from activation |
GDPR Processing Flag
GdprOptin is not technically required for ingestion validation.
GdprOptin is a Replenit-level processing control that determines whether customer data may be processed and used within the platform.
trueCustomer record is eligible for processing and downstream activationfalseCustomer record may be stored but is excluded from processing and activationomittedGDPR opt-in is treated as false by default, and the customer is considered not consented until an explicit opt-in flag is provided
Replenit does not infer consent. Responsibility for setting the correct value remains with the data source.
Notes
- Consent flags control downstream activation eligibility
- Language must follow IETF BCP 47 format
- Field requirements may vary based on tenant configuration
Data Completeness & Decision Quality
Replenit's decisioning accuracy improves with broader and richer data across all entities, including users, products, orders, and events.
You are encouraged to send as many fields as possible for every object, as long as the data is:
- Stable – consistently defined over time
- Complete – high coverage across records
- Reliable – not sparsely populated or frequently changing in meaning
While only a subset of fields is required for ingestion, additional attributes directly enhance:
- Profiling accuracy (user, product, and behavioral)
- Contextual understanding for decisioning
- Reasoning quality for all downstream decisions (replenishment, substitution, cross-sell, churn prevention, etc.)
Rule of thumb:
If a field exists, is well-populated, and carries business meaning, it should be sent.
Optional fields never block ingestion, but richer payloads consistently produce better decisions.
Delete Customer
/customers/{tenantId}/{customerId}Parameters
| Parameter | Type | Required |
|---|---|---|
| tenantId | GUID | Yes |
| customerId | string | Yes |
Success Response
{
"success": true,
"message": "Customer removed.",
"data": {
"customerId": "C-123",
"deletedAt": "2024-12-22T14:02:49Z"
}
}Error Responses
| Status | Description |
|---|---|
| 400 | Missing customer identifier |
| 404 | Tenant or customer not found |
| 500 | Deletion failure |
Examples
Minimal Request
[
{
"CustomerId": "C-126"
}
]*This profile will not be processed by Replenit as GDPR Opt-in will be set as false by default
Email-Based Identifier
[
{
"Email": "customer@example.com",
"Language": "fr-FR",
"GdprOptin": true
}
]Full Payload Example
[
{
"CustomerId": "C-123",
"Email": "john.doe@example.com",
"Name": "John",
"Surname": "Doe",
"Phone": "+1-555-123-4567",
"Language": "en-US",
"Username": "johndoe",
"EmailOptin": true,
"SmsOptin": false,
"WhatsappOptin": true,
"AppPushOptin": true,
"GdprOptin": true,
"IsExcluded": false
}
]Request Examples
curl -X POST "https://api.replen.it/customers/{tenantId}" \
-H "Content-Type: application/json" \
-H "x-replenit-auth-key: YOUR_BASE64_ACCESS_KEY" \
-d @customers.jsonResponse Examples
Success
{
"success": true,
"message": "Customers saved.",
"data": {
"count": 3,
"processedAt": "2024-12-22T14:05:51Z"
}
}Validation Error – Missing Identifier
{
"status": 400,
"errors": {
"": [
"At least one of the following properties must have a value: CustomerId, Email"
]
}
}Validation Error – Field Length
{
"status": 400,
"errors": {
"[0].CustomerId": [
"The field CustomerId must be a string with a maximum length of 100."
]
}
}Tenant Not Found
{
"success": false,
"message": "Tenant not found.",
"data": {}
}Related Documentation
Need help or have questions?
Our team is ready to assist you. Reach out to us at support@replen.it
