π«Customers
This page provides a description of the available API routes for managing customers.
The data model for customer is represented by Customer
class.
API methods
Get customers
GET
http://{server-address}/customers
Returns all customers that matches query parameters. Result is of type QueryResult<Customer>
.
Query Parameters
Name | Type | Description |
---|---|---|
CardSerialNumber | string | Supports NData syntax. Compares |
ExternalId | string | Supports NData syntax. |
CreditRate | decimal | Supports NData syntax. |
DiscountRate | decimal | Supports NData syntax. |
IsActive | bool | Supports NData syntax. |
ExpirationTime | DateTime | Supports NData syntax. |
IsExpired | bool | Boolean values allowed. Compares provided value to |
Search | string | Value is compared with partial case-insensitive match in following properties: |
$skip | int | Pagination property. Describing number of records to skip from beginning of result collection. |
$take | int | Pagination property. Maximum count of items to be returned. |
$sort | string[] | Comma separated list of property names. Please see NData syntax. |
$count | bool | If set to |
Headers
Name | Type | Description |
---|---|---|
Authorization* | string | Authorization header with authorization token. |
Get customer by ID
GET
http://{server-address}/customers/{id}
Result is of type Customer
.
Path Parameters
Name | Type | Description |
---|---|---|
id* | string | Unique customer identifier. |
Headers
Name | Type | Description |
---|---|---|
Authorization* | string | Authorization header with authorization token. |
Create customer
POST
http://{server-address}/customers
Creates new customer. Result is of type Customer
.
Required rights
Authorized user must have CustomerCreate
right assigned.
Headers
Name | Type | Description |
---|---|---|
Authorization* | string | Authorization header with authorization token. |
Request Body
Name | Type | Description |
---|---|---|
(body)* | Customer | Customer model to create |
Create or update customer
PUT
http://{server-address}/customers/{id}
Updates existing or creates new customer. Result is of type Customer
.
Required rights
Authorized user must have assigned CustomerCreate
or CustomerUpdate
right. When updating existing customer, additional roles may be required: if discountRate
property is changed, CustomerSetDiscount
is required; If credit
property is changed, CustomerSetCredit
is required.
Path Parameters
Name | Type | Description |
---|---|---|
id* | string | Unique customer identifier. |
Headers
Name | Type | Description |
---|---|---|
Authorization* | string | Authorization header with authorization token. |
Request Body
Name | Type | Description |
---|---|---|
(body)* | Customer | Customer model to create or update. |
Delete customer by ID
DELETE
http://{server-address}/customers/{id}
Required rights
Authorized user must have CustomerDelete
right assigned.
Path Parameters
Name | Type | Description |
---|---|---|
id* | string | Unique customer identifier. |
Headers
Name | Type | Description |
---|---|---|
Authorization* | string | Authorization header with authorization token. |
Last updated