# Creation of customer

Endpoint: POST /api/customers
Version: 1.0.0
Security: shoptetAccessToken, shoptetPrivateApiToken

## Query parameters:

  - `suppressMandatoryFieldsCheck` (boolean)
    suppress checking if new customer has filled all mandatory fields
from eshop settings Settings -> Customers -> Mandatory fields.
Suppressing this check can cause worse customer experience in order
process for customers without all mandatory fields! However this can
be useful for migration customers from older system without all
necessary fields.

  - `sendRegistrationEmail` (boolean)
    If set to true, registration emails are sent to the customer. The
type of email depends on the customerGroup settings. If the group
requires verification, the customer receives an email indicating
that the registration is pending administrator approval (typically
for the wholesale group). Otherwise, the customer receives a
standard registration confirmation email.

If the customer group has email notifications enabled for the 
administrator, a copy of the email is also sent to them (again,
typically for the wholesale group).

  - `language` (string)
    Specifies the language in which the email should be sent to the
customer, provided that sendRegistrationEmail = true and the
"Foreign Languages" module is enabled on the current e-shop.
    Example: "cs"

## Header parameters:

  - `Content-Type` (string, required)

## Request fields (application/json):

  - `data` (object, required)

  - `data.remark` (string,null)
    remark for the customer (can be null)

  - `data.priceRatio` (string)
    additional discount - 4 decimal places accuracy, (from 0.0000 to 1.0000), 0.7800 = discount 22%; 1.0000 = no discount

  - `data.birthDate` (string,null)
    date of birth. In YYYY-MM-DD format.  (can be null)

  - `data.disabledOrders` (boolean)
    Ordering disabled? If so, newly created orders will be cancelled automatically.

  - `data.customerGroupCode` (string)
    customer group code, group must exists if set.

  - `data.pricelistId` (integer)
    Price list identifier

  - `data.billingAddress` (object)
    billing address

  - `data.billingAddress.company` (string,null)
    company (can be null)

  - `data.billingAddress.fullName` (string,null)
    full name (can be null)

  - `data.billingAddress.street` (string,null)
    street (can be null)

  - `data.billingAddress.houseNumber` (string,null)
    house number (can be null)

  - `data.billingAddress.city` (string,null)
    city/town (can be null)

  - `data.billingAddress.district` (string,null)
    region (can be null)

  - `data.billingAddress.additional` (string,null)
    additional address information (can be null)

  - `data.billingAddress.zip` (string,null)
    ZIP or postal code (can be null)

  - `data.billingAddress.countryCode` (string)
    country (can be null)

  - `data.billingAddress.regionName` (string,null)
    region name (can be null)

  - `data.billingAddress.companyId` (string,null)
    Company registration number of the customer, if purchasing as a company. Optional.

  - `data.billingAddress.vatId` (string,null)
    VAT identification number of the customer, if purchasing as a company. Optional.

  - `data.billingAddress.taxId` (string,null)
    TAX identification number of the customer, if purchasing on the company. For Czech address, taxId must be the same as vatId, or left empty. Optional.

  - `data.account` (object, required)

  - `data.account.fullName` (string,null)
    full name (can be null)

  - `data.account.email` (string, required)
    email address

  - `data.account.phone` (string,null)
    phone number (can be null)

  - `data.account.authorized` (boolean)
    Is the account authorized? Default: true

  - `data.account.emailVerified` (boolean)
    Is the email verified by eshop owner? Needed for pairing orders created in past. Default: false

## Response 201 fields (application/json):

  - `data` (object, required)

  - `data.customer` (object, required)

  - `data.customer.guid` (string, required)
    Customer GUID

  - `data.customer.billingAddress` (object, required)
    invoicing address

  - `data.customer.billingAddress.company` (string,null, required)
    name of purchaser''s company (or null)

  - `data.customer.billingAddress.fullName` (string,null, required)
    name of purchaser (or null)

  - `data.customer.billingAddress.street` (string,null, required)
    street of purchaser (or null)

  - `data.customer.billingAddress.houseNumber` (string,null, required)
    street number (or null)

  - `data.customer.billingAddress.city` (string,null, required)
    city/town (village) (or null)

  - `data.customer.billingAddress.district` (string,null, required)
    county (or null)

  - `data.customer.billingAddress.additional` (string,null, required)
    additional address information (or null)

  - `data.customer.billingAddress.zip` (string,null, required)
    ZIP or postal code (or null)

  - `data.customer.billingAddress.countryCode` (string,null, required)
    tree-character ISO country code (ISO 4217)

  - `data.customer.billingAddress.regionName` (string,null, required)
    region name (or null)

  - `data.customer.billingAddress.regionShortcut` (string,null, required)
    region abbreviation (or null)

  - `data.customer.billingAddress.companyId` (string,null, required)
    Company registration number. (can be null)

  - `data.customer.billingAddress.vatId` (string,null, required)
    VAT identification number. (can be null)

  - `data.customer.billingAddress.vatIdValidationStatus` (any)
    Info, whether VAT ID has been verified, enum [unverified, verified, waiting]
    Enum: "unverified", "verified", "waiting", null

  - `data.customer.billingAddress.taxId` (string,null, required)
    TAX identification number. For Czech address, taxId is same as vatId. (can be null)

  - `data.customer.deliveryAddress` (array, required)
    delivery addresses

  - `data.customer.deliveryAddress.guid` (string, required)
    customer delivery address identification

  - `data.customer.deliveryAddress.company` (string,null, required)
    company (can be null)

  - `data.customer.deliveryAddress.fullName` (string,null, required)
    full name (can be null)

  - `data.customer.deliveryAddress.street` (string,null, required)
    street (can be null)

  - `data.customer.deliveryAddress.houseNumber` (string,null, required)
    house number (can be null)

  - `data.customer.deliveryAddress.city` (string,null, required)
    city/town (can be null)

  - `data.customer.deliveryAddress.district` (string,null, required)
    region (can be null)

  - `data.customer.deliveryAddress.additional` (string,null, required)
    additional info (can be null)

  - `data.customer.deliveryAddress.zip` (string,null, required)
    ZIP/postal code (can be null)

  - `data.customer.deliveryAddress.countryCode` (string,null, required)
    country (can be null)

  - `data.customer.deliveryAddress.regionName` (string,null, required)
    region name (can be null)

  - `data.customer.deliveryAddress.regionShortcut` (string,null, required)
    region abbreviation (can be null)

  - `data.customer.deliveryAddress.isDefault` (boolean)

  - `data.customer.creationTime` (string,null, required)
    registration date

  - `data.customer.changeTime` (string,null, required)
    date and time of last change

  - `data.customer.customerGroup` (object,null, required)
    group of customers

  - `data.customer.customerGroup.id` (integer, required)
    customer group ID

  - `data.customer.customerGroup.name` (string, required)
    customer group name

  - `data.customer.priceList` (any, required)
    inclusion into the price list

  - `data.customer.remark` (string,null, required)
    remark for the customer (can be null)

  - `data.customer.priceRatio` (string, required)
    additional discount - 0.7800 = discount 22%; 1.0000 = no discount

  - `data.customer.birthDate` (string,null, required)
    date of birth. In YYYY-MM-DD format.  (can be null)

  - `data.customer.accounts` (array, required)
    customer login accounts

  - `data.customer.accounts.guid` (string, required)
    customer account identifier

  - `data.customer.accounts.fullName` (string,null, required)
    full name (can be null)

  - `data.customer.accounts.email` (string, required)
    email address

  - `data.customer.accounts.phone` (string,null, required)
    phone (can be null)

  - `data.customer.accounts.mainAccount` (boolean, required)
    Is this the main account?

  - `data.customer.accounts.authorized` (boolean, required)
    Is the account authorized? Default: true

  - `data.customer.accounts.emailVerified` (boolean, required)
    Is the email verified by eshop owner? Needed for pairing orders created in past. Default: false

  - `data.customer.disabledOrders` (boolean, required)
    Ordering disabled? If so, newly created orders will be cancelled automatically. Dependent on the addition of  customerReviews. If e-shop does not have an option active, the answer will be false.

  - `data.customer.remarks` (array, required)
    customer notes and ratings, dependent on addon customerReviews. If e-shop does not have an option active, the answer will be blank.

  - `data.customer.remarks.id` (integer, required)
    uniq identification number

  - `data.customer.remarks.remark` (string, required)
    note

  - `data.customer.remarks.rating` (string, required)
    type of rating

  - `data.customer.adminUrl` (string, required)
    link to the customer details in administration

  - `errors` (array,null, required)

  - `errors.errorCode` (string, required)
    Short text error identification

  - `errors.message` (string, required)
    Descriptive error message

  - `errors.instance` (string, required)
    Identification of the entity referenced

  - `metadata` (object, required)

  - `metadata.requestId` (string, required)
    Request identifier. Useful for logging/reporting purposes.


