Skip to main content

Customer API

Overview

The Customer API provides endpoints for managing customer accounts in your EverShop store. These endpoints allow you to create and manage customer profiles, handle authentication, and maintain customer data securely.

Endpoints

Create A Customer

Creates a new customer account in the system. This endpoint registers a new user with their basic information and credentials.

Request Schema (application/json)
Field NameField TypeRequired
statusstring or integer ('0', '1', 0, 1)No
full_namestringNo
emailstringNo
passwordstringNo
POST/api/customers
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/customers
Sample Of Response
{
"data": {
"customer_id": 21,
"uuid": "e1b20098a66c11edb46b60d819134f39",
"status": 1,
"group_id": 1,
"email": "john.smith@example.com",
"full_name": "John Smith",
"created_at": "2023-02-07 14:18:05",
"updated_at": "2023-02-07 14:18:05",
"links": [
{
"rel": "customerGrid",
"href": "/admin/customers",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "edit",
"href": "/admin/customers/edit/e1b20098a66c11edb46b60d819134f39",
"action": "GET",
"types": [
"text/xml"
]
}
]
}
}

Update A Customer

Modifies an existing customer account. This endpoint allows you to update customer information such as email, name, or password.

Request Schema (application/json)
Field NameField TypeRequired
statusstring or integer ('0', '1', 0, 1)No
full_namestringNo
emailstringNo
passwordstringNo
PATCH/api/customers/433ba97f-8be7-4be9-be3f-a9f341f2b89f
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/customers/433ba97f-8be7-4be9-be3f-a9f341f2b89f
Sample Of Response
{
"data": {
"customer_id": 21,
"uuid": "433ba97f-8be7-4be9-be3f-a9f341f2b89f",
"status": 1,
"group_id": 1,
"email": "john.smith@example.com",
"full_name": "John A. Smith",
"created_at": "2023-02-07 14:18:05",
"updated_at": "2023-02-07 14:18:06",
"links": [
{
"rel": "customerGrid",
"href": "/admin/customers",
"action": "GET",
"types": [
"text/xml"
]
},
{
"rel": "edit",
"href": "/admin/customers/edit/433ba97f-8be7-4be9-be3f-a9f341f2b89f",
"action": "GET",
"types": [
"text/xml"
]
}
]
}
}

Delete a Customer

Permanently removes a customer account from the system. This operation cannot be undone.

Request Schema (application/json)
No request body required
DELETE/api/customers/433ba97f-8be7-4be9-be3f-a9f341f2b89f
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
https://<your domain>/api/customers/433ba97f-8be7-4be9-be3f-a9f341f2b89f
Sample Of Response
{
"data": {
"customer_id": 21,
"uuid": "433ba97f-8be7-4be9-be3f-a9f341f2b89f",
"status": 1,
"group_id": 1,
"email": "john.smith@example.com",
"full_name": "John A. Smith",
"created_at": "2023-02-07 14:18:05",
"updated_at": "2023-02-07 14:18:06"
}
}

Customer Addresses

Create Customer Address

Creates a new address for a customer.

Request Schema (application/json)
Field NameField TypeRequired
full_namestringNo
telephonestringNo
address_1stringNo
address_2stringNo
citystringNo
provincestringNo
countrystringNo
postcodestringNo
is_defaultboolean or integerNo
POST/api/customers/{customer_id}/addresses
curl
-H "Accept: application/json"
--data-raw "<JSON DATA>"
https://<your domain>/api/customers/{customer_id}/addresses
Sample Of Response
{
"data": {
"customer_address_id": 42,
"uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"customer_id": 21,
"full_name": "John Smith",
"address_1": "123 Main St",
"city": "New York",
"province": "NY",
"country": "US",
"postcode": "10001"
}
}

Update Customer Address

Updates an existing customer address.

Request Schema (application/json)
Field NameField TypeRequired
full_namestringNo
telephonestringNo
address_1stringNo
address_2stringNo
citystringNo
provincestringNo
countrystringNo
postcodestringNo
PATCH/api/customers/{customer_id}/addresses/{address_id}
curl
-H "Accept: application/json"
--data-raw "<JSON DATA>"
https://<your domain>/api/customers/{customer_id}/addresses/{address_id}
Sample Of Response
{
"data": {
"customer_address_id": 42,
"uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"full_name": "John A. Smith",
"address_1": "456 Oak Ave"
}
}

Delete Customer Address

Removes a customer address.

Request Schema (application/json)
No request body required
DELETE/api/customers/{customer_id}/addresses/{address_id}
curl
-H "Accept: application/json"
https://<your domain>/api/customers/{customer_id}/addresses/{address_id}
Sample Of Response
{
"data": {
"customer_address_id": 42,
"uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
}

Password Management

Reset Password

Sends a password reset email to the customer.

Request Schema (application/json)
Field NameField TypeRequired
emailstringYes
POST/api/customers/reset-password
curl
-H "Accept: application/json"
--data-raw "<JSON DATA>"
https://<your domain>/api/customers/reset-password
Sample Of Response
{
"data": {
"success": true
}
}

Update Password

Updates a customer's password using a reset token received via email.

Request Schema (application/json)
Field NameField TypeRequired
passwordstringYes
tokenstringYes
POST/api/customers/password
curl
-H "Accept: application/json"
--data-raw "<JSON DATA>"
https://<your domain>/api/customers/password
Sample Of Response
{
"data": {
"success": true
}
}

Get Customer Data with GraphQL

EverShop uses GraphQL for querying customer data. For detailed information on how to query customers, refer to the GraphQL API documentation.