PORTOS Developers
  • πŸ‘‹Introduction
  • πŸ“–Glossary
  • HTTP Status codes
  • Error models
  • Error codes
  • Validation constraints
  • Resource names
  • πŸ”’User rights
  • Device environments
  • 🌍Localization
  • πŸ”NData query syntax
  • OpenAPI specification
  • Data models
  • Authentication
    • πŸ”Authentication schemes
      • JWT Bearer Authentication
      • HMAC Authentication
  • ⚑Notifications
    • SignalR
    • Webhooks
  • API reference
    • πŸ”‘API keys
    • πŸ›οΈArticle categories
    • πŸ’ΌCompanies
    • πŸ’±Currencies
    • πŸ‘«Customers
    • πŸ“ˆDaily sales reports
    • πŸ–₯️Devices
    • πŸ–¨οΈFiscals
    • ❀️Health check
    • πŸ“ƒLicense
    • 🎚️Modifiers
    • πŸ‘¨β€πŸ³Order endpoints
    • πŸ›ŽοΈOrders
    • πŸͺ™Payment types
    • β˜•Plus
    • πŸ”Roles
    • πŸ”Sessions
    • βš™οΈSettings
    • πŸ”ŽStock takings
    • πŸ”’Stock transfer numbering
    • 🚚Stock transfers
    • πŸ“¦Stocks
    • 🧾Tickets
      • Ticket Model States
      • Ticket Operations and User Rights
      • Ticket Model Mathematics
    • πŸ‘¨β€πŸ’ΌUsers
    • βš–οΈVats
    • πŸͺ‘Zones
  • 3rd Party Integrations
    • Introduction
    • Online orders API
    • Rewards API
    • PDA Files
  • Previous versions
    • Migration to V4.1
    • Migration to V4
    • Legacy documentation
Powered by GitBook
On this page
  • API methods
  • Get customers
  • Get customer by ID
  • Create customer
  • Create or update customer
  • Delete customer by ID

Was this helpful?

  1. API reference

Customers

This page provides a description of the available API routes for managing customers.

PreviousCurrenciesNextDaily sales reports

Last updated 1 year ago

Was this helpful?

The data model for customer is represented by class.

API methods

Get customers

GET http://{server-address}/customers

Returns all customers that matches query parameters. Result is of type .

Query Parameters

Name
Type
Description

CardSerialNumber

string

Supports NData syntax. Compares SerialNumber property of elements in Cards collection.

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 Status property based on ActivationTime and ExpirationTime.

Search

string

Value is compared with partial case-insensitive match in following properties: FirstName, LastName, Company.Name, Company.VatId, Company.TaxId and Note.

$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 true, response will not contain items collection. Use to get resource count, not the resources themselves.

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

{
    "items":
    [
        {
            "id": "customer-id",
            "externalId": null,
            "isActive": true,
            "status": "Valid",
            "activationTime": null,
            "expirationTime": null,
            "firstName": "John",
            "lastName": "Doe",
            "fullName": "John Doe",
            "gender": null,
            "birthDate": null,
            "email": "john.doe@portos.sk",
            "phone": null,
            "isCompany": false,
            "company": null,
            "address": null,
            "deliveryAddress": null,
            "credit":
            {
                "amount": 0.0,
                "currencyLabel": null
            },
            "creditTransactions": [],
            "cards":
            [
                {
                    "externalId": "external-card-id",
                    "isActive": true,
                    "isVirtual": true,
                    "serialNumber": "card-serial-number",
                    "processor": "P",
                    "status": "Valid",
                    "statusTime": null,
                    "statusReason": null,
                    "activationTime": "2022-11-01T00:00:00.00Z",
                    "expirationTime": null,
                    "note": null,
                    "meta": null
                }
            ],
            "creditRate": 0.0,
            "discountRate": 0.0,
            "note": null,
            "meta": {},
            "_v": 1
        }
    ],
    "count": 1,
    "totalCount": 1
}

Get customer by ID

GET http://{server-address}/customers/{id}

Path Parameters

Name
Type
Description

id*

string

Unique customer identifier.

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

{
    "id": "customer-id",
    "externalId": null,
    "isActive": true,
    "status": "Valid",
    "activationTime": null,
    "expirationTime": null,
    "firstName": "John",
    "lastName": "Doe",
    "fullName": "John Doe",
    "gender": null,
    "birthDate": null,
    "email": "john.doe@portos.sk",
    "phone": null,
    "isCompany": false,
    "company": null,
    "address": null,
    "deliveryAddress": null,
    "credit":
    {
        "amount": 0.0,
        "currencyLabel": null
    },
    "creditTransactions":
    [],
    "cards":
    [
        {
            "externalId": "external-card-id",
            "isActive": true,
            "isVirtual": true,
            "serialNumber": "card-serial-number",
            "processor": "P",
            "status": "Valid",
            "statusTime": null,
            "statusReason": null,
            "activationTime": "2022-11-01T00:00:00.00Z",
            "expirationTime": null,
            "note": null,
            "meta": null
        }
    ],
    "creditRate": 0.0,
    "discountRate": 0.0,
    "note": null,
    "meta":
    {},
    "_v": 1
}
{
    "title": "Zdroj nebol nΓ‘jdenΓ½",
    "status": 404
}

Create customer

POST http://{server-address}/customers

Required rights

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

Request Body

Name
Type
Description

(body)*

Customer

Customer model to create

{
    "id": "customer-id",
    "externalId": null,
    "isActive": true,
    "status": "Valid",
    "activationTime": null,
    "expirationTime": null,
    "firstName": "John",
    "lastName": "Doe",
    "fullName": "John Doe",
    "gender": null,
    "birthDate": null,
    "email": "john.doe@portos.sk",
    "phone": null,
    "isCompany": false,
    "company": null,
    "address": null,
    "deliveryAddress": null,
    "credit":
    {
        "amount": 0.0,
        "currencyLabel": null
    },
    "creditTransactions":
    [],
    "cards":
    [
        {
            "externalId": "external-card-id",
            "isActive": true,
            "isVirtual": true,
            "serialNumber": "card-serial-number",
            "processor": "P",
            "status": "Valid",
            "statusTime": null,
            "statusReason": null,
            "activationTime": "2022-11-01T00:00:00.00Z",
            "expirationTime": null,
            "note": null,
            "meta": null
        }
    ],
    "creditRate": 0.0,
    "discountRate": 0.0,
    "note": null,
    "meta":
    {},
    "_v": 1
}

Create or update customer

PUT http://{server-address}/customers/{id}

Required rights

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.

{
    "id": "customer-id",
    "externalId": null,
    "isActive": true,
    "status": "Valid",
    "activationTime": null,
    "expirationTime": null,
    "firstName": "John",
    "lastName": "Doe",
    "fullName": "John Doe",
    "gender": null,
    "birthDate": null,
    "email": "john.doe@portos.sk",
    "phone": null,
    "isCompany": false,
    "company": null,
    "address": null,
    "deliveryAddress": null,
    "credit":
    {
        "amount": 0.0,
        "currencyLabel": null
    },
    "creditTransactions":
    [],
    "cards":
    [
        {
            "externalId": "external-card-id",
            "isActive": true,
            "isVirtual": true,
            "serialNumber": "card-serial-number",
            "processor": "P",
            "status": "Valid",
            "statusTime": null,
            "statusReason": null,
            "activationTime": "2022-11-01T00:00:00.00Z",
            "expirationTime": null,
            "note": null,
            "meta": null
        }
    ],
    "creditRate": 0.0,
    "discountRate": 0.0,
    "note": null,
    "meta":
    {},
    "_v": 1
}

Delete customer by ID

DELETE http://{server-address}/customers/{id}

Required rights

Path Parameters

Name
Type
Description

id*

string

Unique customer identifier.

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

{
    "id": "customer-id",
    "externalId": null,
    "isActive": true,
    "status": "Valid",
    "activationTime": null,
    "expirationTime": null,
    "firstName": "John",
    "lastName": "Doe",
    "fullName": "John Doe",
    "gender": null,
    "birthDate": null,
    "email": "john.doe@portos.sk",
    "phone": null,
    "isCompany": false,
    "company": null,
    "address": null,
    "deliveryAddress": null,
    "credit":
    {
        "amount": 0.0,
        "currencyLabel": null
    },
    "creditTransactions":
    [],
    "cards":
    [
        {
            "externalId": "external-card-id",
            "isActive": true,
            "isVirtual": true,
            "serialNumber": "card-serial-number",
            "processor": "P",
            "status": "Valid",
            "statusTime": null,
            "statusReason": null,
            "activationTime": "2022-11-01T00:00:00.00Z",
            "expirationTime": null,
            "note": null,
            "meta": null
        }
    ],
    "creditRate": 0.0,
    "discountRate": 0.0,
    "note": null,
    "meta":
    {},
    "_v": 1
}
{
    "title": "Zdroj nebol nΓ‘jdenΓ½",
    "status": 404
}

Result is of type .

Creates new customer. Result is of type .

Authorized user must have CustomerCreate assigned.

Updates existing or creates new customer. Result is of type .

Authorized user must have assigned CustomerCreate or CustomerUpdate . 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.

Authorized user must have CustomerDelete assigned.

πŸ‘«
right
right
right
Customer
Customer
Customer
Customer
QueryResult<Customer>