Skip to main content
⭐️ If you love EverShop, give it a star on GitHub. Thanks!

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: admin_token=<your jwt token id>"  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: admin_token=<your jwt token id>"  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: admin_token=<your jwt token id>"  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"  }}

Create a customer session

Use this endpoint to create a customer session (login).

Request Schema (application/json)
Field NameField TypeRequired
emailstringYes
passwordstringYes
POST/api/customers/sessions
curl  -H "Accept: application/json"  -H "Cookie: admin_token=<your jwt token id>"  https://<your domain>/api/customers/sessions
Sample Of Response
{  "data": {    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lciI6eyJjdXN0b21lcklkIjoyMiwidXVpZCI6ImQ3YTVlOGI1YTY3MzExZWRiNDZiNjBkODE5MTM0ZjM5Iiwic3RhdHVzIjoxLCJncm91cElkIjoxLCJlbWFpbCI6ImtjMDRBY25MNHU2dUNldDJoSFVxQGVtYWlsLmNvbSIsImZ1bGxOYW1lIjoia2MwNEFjbkw0dTZ1Q2V0MmhIVXEiLCJjcmVhdGVkQXQiOiIyMDIzLTAyLTA3IDE1OjA3OjU1IiwidXBkYXRlZEF0IjoiMjAyMy0wMi0wNyAxNTowNzo1NSJ9LCJzaWQiOiIwOWQzNGMyMS00YWYzLTRkYjgtYTM4Yi0zMzVlYmY2ZDQ1ZmEiLCJpYXQiOjE2NzU2NDk2MTgsImV4cCI6MTY3NTgyMjQxOH0.KVViMcH55nQKHGffvNaVzEENAYS4kEh2xz-KfHHjOWA",    "sid": "09d34c21-4af3-4db8-a38b-335ebf6d45fa"  }}

Delete a customer session

Use this endpoint to delete a customer session (logout).

Request Schema (application/json)
No request body required
POST/api/customers/sessions/{ids}
curl  -H "Accept: application/json"  -H "Cookie: admin_token=<your jwt token id>"  https://<your domain>/api/customers/sessions/{ids}
Sample Of Response
{  "data": {}}