Customers
Register and manage shoppers, their addresses, contact points and tags — the building blocks for a storefront or app. A customer can have multiple emails, phones and addresses, each with a default. Login itself is issued by the auth service (see Authentication).
https://zopping.comCustomers
The shopper record. Create with at least a name, phone/email and organizationId; you may nest an address to create one in the same call. Keep your own id in clientId.
| Field | Type | Description |
|---|---|---|
id | integerread-only | |
organizationId | stringrequired | |
name | stringrequired | |
lastName | string | |
phone | string | Primary phone. |
email | string | Primary email. |
password | string | Optional; set to allow login. |
clientId | stringkey | Your external customer id. |
address | object | Optional nested address to create. |
status | stringread-only | |
totalOrders | integerread-only | |
defaultAddress | objectread-only |
/api/customer-service/customerList customers
| Parameter | Type | Description |
|---|---|---|
organizationIdrequired | string· query | |
page | integer· query | |
limit | integer· query | Default 20. |
phone | string· query | Filter by phone. |
email | string· query | Filter by email. |
clientId | string· query | Filter by your id(s). |
curl "https://zopping.com/api/customer-service/customer?organizationId=<org-id>&phone=9876543210" \
-H "Authorization: Bearer $ZOPPING_TOKEN"{
"data": {
"customer": [
{
"id": 7781,
"name": "Asha",
"phone": "9876543210",
"status": "ENABLED",
"totalOrders": 12
}
],
"count": 1,
"offset": 0,
"limit": 20
}
}/api/customer-service/customerCreate a customer
{
"organizationId": "<org-id>",
"name": "Asha",
"phone": "9876543210",
"email": "asha@example.com",
"clientId": "CRM-7781",
"address": {
"address": "12 MG Road",
"city": "Bengaluru",
"pincode": "560001"
}
}/api/customer-service/customer/{id}Get a customer
| Parameter | Type | Description |
|---|---|---|
idrequired | integer· path |
/api/customer-service/customer/{id}Update a customer
Guest
Create a lightweight guest customer for express checkout; it converts to a registered customer on first login.
/api/customer-service/guestCreate a guest
{
"organizationId": "<org-id>",
"name": "Guest",
"phone": "9876543210",
"email": "guest@example.com",
"password": "••••••"
}Addresses
Delivery addresses for a customer, with optional geo-coordinates used by fulfilment to resolve a delivery zone.
| Field | Type | Description |
|---|---|---|
id | integerread-only | |
customerId | integerrequired | |
address | stringrequired | |
city | stringrequired | |
pincode | string | |
landmark | string | |
latitude | number | |
longitude | number | |
state | string | |
clientId | stringkey |
/api/customer-service/addressList addresses
| Parameter | Type | Description |
|---|---|---|
organizationIdrequired | string· query | |
customerIdrequired | integer· query |
/api/customer-service/addressAdd an address
{
"organizationId": "<org-id>",
"customerId": 7781,
"address": "12 MG Road",
"city": "Bengaluru",
"pincode": "560001",
"latitude": 12.9758,
"longitude": 77.6096
}/api/customer-service/address/{id}Update an address
| Parameter | Type | Description |
|---|---|---|
idrequired | integer· path |
/api/customer-service/address/{id}Delete an address
| Parameter | Type | Description |
|---|---|---|
idrequired | integer· path |
Emails & phones
A customer can hold multiple emails and phones. Add, update status, or remove them. The wire field for a phone number is phone.
/api/customer-service/emailAdd an email
{
"organizationId": "<org-id>",
"customerId": 7781,
"email": "asha2@example.com"
}/api/customer-service/email/{id}Remove an email
| Parameter | Type | Description |
|---|---|---|
idrequired | integer· path |
/api/customer-service/phoneAdd a phone
{
"organizationId": "<org-id>",
"customerId": 7781,
"phone": "9988776655"
}/api/customer-service/phone/{id}Remove a phone
| Parameter | Type | Description |
|---|---|---|
idrequired | integer· path |
Passwords
Let customers change their password, or kick off a reset by email/phone username.
/api/customer-service/change-passwordChange password
{
"customerId": 7781,
"oldPassword": "••••",
"newPassword": "••••••"
}/api/customer-service/reset-passwordRequest a password reset
{
"organizationId": "<org-id>",
"username": "asha@example.com"
}