# Customers

Managing customers in the e-shop.

## List of customers

 - [GET /api/customers](https://api.docs.shoptet.com/shoptet-api/openapi/customers/getlistofcustomers.md): Listing of customers. Supports the Paging.

## Creation of customer

 - [POST /api/customers](https://api.docs.shoptet.com/shoptet-api/openapi/customers/createcustomer.md)

## List of all customers

 - [GET /api/customers/snapshot](https://api.docs.shoptet.com/shoptet-api/openapi/customers/getlistofallcustomers.md): Using this endpoint, you can get list of all customers with detailed info of each customer (like in Customer Detail endpoint) asynchronously. See how Asynchronous requests work on our developer's portal.


Response will be in jsonlines format with each customer taking one line of output file.


One customer in response has the same format as customer detail response. See Customer snapshot schema for more details.


Result file is compressed using GZIP.

## Customer detail

 - [GET /api/customers/{guid}](https://api.docs.shoptet.com/shoptet-api/openapi/customers/getcustomerdetail.md): Additional information about one customer.

## Update of customer

 - [PATCH /api/customers/{guid}](https://api.docs.shoptet.com/shoptet-api/openapi/customers/updatecustomer.md)

## Deletion of customer

 - [DELETE /api/customers/{guid}](https://api.docs.shoptet.com/shoptet-api/openapi/customers/deletecustomer.md)

## Last customer changes

 - [GET /api/customers/changes](https://api.docs.shoptet.com/shoptet-api/openapi/customers/getlastcustomerchanges.md): Returns the list of customers who have been changed (added/changed or deleted). The Endpoint is intended 
to determine the changes after you have loaded the complete list of customers and you need to know, if 
any of these has been changed (or added or deleted).  Guaranteed history is 30 days, the older data are 
deleted progressively.


Each customer in the log is only mentioned with their last change. For example, if the customer was modified 
and then deleted, the log will only show information about the deletion.

Can be filtered by changeType = edit/delete parameter.

Creation is considered as edit action. So, when there is a new item created, it will be displayed like 
edit action.


Endpoint supports Paging.

## List of customer regions

 - [GET /api/customers/regions](https://api.docs.shoptet.com/shoptet-api/openapi/customers/getlistofcustomerregions.md): Returns the list of customer regions. The regions are ordered by id. The list is not paginated.

## List of customer groups

 - [GET /api/customers/groups](https://api.docs.shoptet.com/shoptet-api/openapi/customers/getlistofcustomergroups.md): Returns list of customer groups ordered by priority. List is not paginated.

## Creation of customer group

 - [POST /api/customers/groups](https://api.docs.shoptet.com/shoptet-api/openapi/customers/createcustomergroup.md): Creates a new customer group with specified settings. The customer group name must be unique. Returns the full list of customer groups including the newly created one.

Note: To use wholesale features (registrationAllowed, wholesale, tableLayout, fullProfileRequired), the wholesale module must be active in the e-shop.

## Deletion of customer group

 - [DELETE /api/customers/groups/{id}](https://api.docs.shoptet.com/shoptet-api/openapi/customers/deletecustomergroup.md): Is not possible to delete default customer group. Deletion of customer group will not delete customers assigned to this group, but they will be assigned to default customer group.

## Update of customer group

 - [PATCH /api/customers/groups/{id}](https://api.docs.shoptet.com/shoptet-api/openapi/customers/updatecustomergroup.md): Updates an existing customer group with specified settings. Returns the full list of customer groups including the updated one.

Note: To use wholesale features (registrationAllowed, wholesale, tableLayout, fullProfileRequired), the Wholesale module must be active in the e-shop.

