Skip to main content

Customer API

Use the REST API to interact with EverShop customers.

Create a customer

Use this endpoint to create a customer.

Request Schema (application/json)
Field NameField TypeRequired
statusstring or integer ('0', '1', 0, 1)No
emailstringYes
passwordstringYes
full_namestringYes
POST/api/customers
curl
-H "Accept: application/json"
-H "Cookie: asid=<your admin cookie>"
https://<your domain>/api/customers
Sample Of Response
{
"data": {
"customer_id": 21,
"uuid": "e1b20098a66c11edb46b60d819134f39",
"status": 1,
"group_id": 1,
"email": "wkVPyU6LG9nQ1kwTn3Or@email.com",
"full_name": "wkVPyU6LG9nQ1kwTn3Or",
"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

Use this endpoint to update an customer.

Request Schema (application/json)
Field NameField TypeRequired
emailstringNo
passwordstringNo
full_namestringNo
PATCH/api/customers/{id}
curl
-H "Accept: application/json"
-H "Cookie: asid=<your admin cookie>"
https://<your domain>/api/customers/{id}
Sample Of Response
{
"data": {
"customer_id": 21,
"uuid": "e1b20098a66c11edb46b60d819134f39",
"status": 1,
"group_id": 1,
"email": "Ssbvz5pUbOXPCFv5WDrd@gmail.com",
"full_name": "abc",
"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/e1b20098a66c11edb46b60d819134f39",
"action": "GET",
"types": [
"text/xml"
]
}
]
}
}

Delete a customer

Use this endpoint to delete an customer.

Request Schema (application/json)
No request body required
DELETE/api/customers/{id}
curl
-H "Accept: application/json"
-H "Cookie: asid=<your admin cookie>"
https://<your domain>/api/customers/{id}
Sample Of Response
{
"data": {
"customer_id": 21,
"uuid": "e1b20098a66c11edb46b60d819134f39",
"status": 1,
"group_id": 1,
"email": "Ssbvz5pUbOXPCFv5WDrd@gmail.com",
"full_name": "abc",
"created_at": "2023-02-07 14:18:05",
"updated_at": "2023-02-07 14:18:06"
}
}

Login

Use this endpoint to login a customer.

Request Schema (application/json)
Field NameField TypeRequired
emailstringYes
passwordstringYes
POST/customer/login
curl
-H "Accept: application/json"
https://<your domain>/customer/login
Sample Of Response
{
"data": {
"sid": "09d34c21-4af3-4db8-a38b-335ebf6d45fa"
}
}

Logout

Use this endpoint to logout a customer.

Request Schema (application/json)
No request body required
POST/customers/logout
curl
-H "Accept: application/json"
https://<your domain>/customers/logout
Sample Of Response
{
"data": {}
}