# Account and profile

## Retrieving a list of customers

> Retrieves a list of customer profiles.

```json
{"openapi":"3.0.0","info":{"title":"Customer Service (tenant-managed)","version":"0.0.1"},"tags":[{"name":"Account and profile"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["customer.customer_read","customer.customer_read_own"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"refreshUrl":"","scopes":{"customer.customer_read":"Needed to retrieve customer profiles.","customer.customer_read_own":"Needed by customer to retrieve customer profiles from the same company.","customer.customer_manage":"Needed to manage customer profiles.","customer.customer_manage_own":"Needed by customer to manage customer profiles from the same company."},"tokenUrl":"https://api.emporix.io/oauth/token"}}}},"schemas":{"CustomerForSellerDto":{"title":"CustomerForSellerDto","allOf":[{"$ref":"#/components/schemas/CustomerCommonDto"},{"type":"object","properties":{"customerNumber":{"type":"string","description":"Customer unique number generated when the customer profile is created."},"id":{"type":"string","description":"Customer unique identifier generated when the customer profile is created."},"defaultAddress":{"$ref":"#/components/schemas/Address"},"accounts":{"type":"array","description":"List of accounts associated with the customer profile.","items":{"$ref":"#/components/schemas/AccountId"}},"addresses":{"type":"array","description":"List of customer addresses.","items":{"$ref":"#/components/schemas/Address"}},"contactEmail":{"type":"string"},"active":{"type":"boolean","description":"Flag indicating whether the customer profile is active."},"onHold":{"type":"boolean","description":"Flag indicating whether the customer profile is suspended."},"email":{"type":"string","description":"Customer email address."},"b2b":{"allOf":[{"$ref":"#/components/schemas/B2BGet"}]},"businessModel":{"type":"string","enum":["B2B","B2C"],"description":"Property indicating business model of customer. When customer is assigned to any company then it is `B2B`. Otherwise it is `B2C`."},"metadataCreatedAt":{"type":"string","description":"Customer creation date."}}}]},"CustomerCommonDto":{"type":"object","allOf":[{"$ref":"#/components/schemas/CustomerCreateDto"},{"type":"object","properties":{"metadata":{"$ref":"#/components/schemas/DefaultDtoMetadata"}}}]},"CustomerCreateDto":{"type":"object","properties":{"title":{"type":"string"},"firstName":{"type":"string"},"middleName":{"type":"string"},"lastName":{"type":"string"},"contactPhone":{"type":"string"},"company":{"type":"string"},"preferredLanguage":{"type":"string","default":"en_US","description":"Customer preferred language."},"preferredCurrency":{"type":"string","default":"USD","description":"Customer preferred currency, compliant with the ISO 4217 standard.","minLength":3,"maxLength":3},"preferredSite":{"type":"string","default":"main","description":"Customer preferred site."},"type":{"type":"string","description":"User type. Supported values are: `CUSTOMER` and `CONTACT`. If the field is empty then the user is considered as a customer."},"photoUrl":{"type":"string","description":"Url of a picture."},"b2b":{"allOf":[{"$ref":"#/components/schemas/B2BCreate"}]},"metadata":{"$ref":"#/components/schemas/BasicMetadataDto"},"mixins":{"type":"object","description":"Customer account's additional properties. The property is not returned by default. In order to return the mixins property use `expand=mixin:*` query param.","additionalProperties":true},"restriction":{"$ref":"#/components/schemas/Restriction"}}},"B2BCreate":{"type":"object","description":"Additional properties for B2B customer.","properties":{"companyRegistrationId":{"type":"string","description":"Registration number of the company."}}},"BasicMetadataDto":{"title":"DefaultDtoMetadata","type":"object","properties":{"mixins":{"type":"object","additionalProperties":true}},"description":"Links to mixin schemas."},"Restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the customer.\n\n**Purpose**: Restricts customer visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access customers with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view customers with the `restriction` value that matches one of their authorized restrictions.\n\n**Validation**: The value must exist in the tenant's configured list of valid restrictions.\n\n**Site Synchronization**: If the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with `preferredSite` property.\n"},"DefaultDtoMetadata":{"title":"DefaultDtoMetadata","type":"object","allOf":[{"$ref":"#/components/schemas/BasicMetadataDto"},{"type":"object","properties":{"version":{"type":"integer"}}}]},"Address":{"type":"object","description":"Customer address information.","properties":{"id":{"type":"string","description":"Customer address unique identifier generated when the address is added to the customer account."},"contactName":{"type":"string"},"companyName":{"type":"string"},"street":{"type":"string"},"streetNumber":{"type":"string"},"streetAppendix":{"type":"string"},"extraLine1":{"type":"string"},"extraLine2":{"type":"string"},"extraLine3":{"type":"string"},"extraLine4":{"type":"string"},"zipCode":{"type":"string"},"city":{"type":"string"},"country":{"type":"string","maxLength":2,"minLength":2},"state":{"type":"string"},"contactPhone":{"type":"string"},"isDefault":{"type":"boolean","default":false,"description":"Flag indicating whether the address is the customer default address."},"tags":{"type":"array","description":"","items":{"type":"string"}},"metadata":{"$ref":"#/components/schemas/DefaultDtoMetadata"},"mixins":{"type":"object","description":"Customer address additional properties.","additionalProperties":true}},"required":["contactName"]},"AccountId":{"type":"object","properties":{"id":{"type":"string","description":"Customer email address."},"providerId":{"type":"string","description":"Customer account unique identifier generated by an external identity provider.\n\n**Note**: This field is only applicable if the user has been registered through social login."}}},"B2BGet":{"allOf":[{"$ref":"#/components/schemas/B2BCreate"}],"properties":{"legalEntities":{"type":"array","items":{"properties":{"id":{"type":"string","description":"ID of legal entity."},"name":{"type":"string","description":"Name of legal entity."},"contactAssignmentId":{"type":"string","description":"ID of contact assignment."}}}}}},"ErrorMessage":{"title":"","description":"Schema for API-specific errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `validation_failure`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."},"details":{"description":"List of problems causing the error.","type":"array","items":{"title":"errorDetail","description":"Specific error cause.","type":"object","properties":{"field":{"description":"Element in request data which is causing the error, for example `category.name`.\nIf the violation was not field-specific, this field will be empty.","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the specific error cause. This value should always be interpreted within the context of the general error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `missing_value`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."}}}}}}},"responses":{"400_bad_request":{"description":"Request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401_unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"403_forbidden":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"parameters":{"query_q":{"name":"q","in":"query","description":"A standard query parameter used to search for specific values.\n","schema":{"type":"string"}},"sort":{"name":"sort","in":"query","description":"List of properties used to sort the results, separated by colons.\nPossible values:\n* `{fieldName}`\n* `{fieldName}:asc`\n* `{fieldName}:desc`\n\n**Note:** If you want to sort the results by localized properties, the possible values are:\n  * `{fieldName}.{language}`\n  * `{fieldName}.{language}:asc`\n  * `{fieldName}.{language}:desc`\n\nBy default, the fields are sorted in ascending order.\n","schema":{"type":"string"}},"pageNumber":{"name":"pageNumber","in":"query","description":"Page number to be retrieved. The number of the first page is 1.\n\n**Note:** If the `pageNumber` parameter is passed, size of the pages must be specified in the `pageSize` parameter.\n","schema":{"default":1,"minimum":1,"type":"integer"}},"pageSize":{"name":"pageSize","in":"query","description":"Number of customers to be retrieved per page.\n","schema":{"default":60,"minimum":1,"type":"integer"}},"expand":{"name":"expand","description":"List of additional attributes to be retrieved, separated by commas.\nPossible values to be passed in this parameter are:\n* `addresses`\n* `accounts`\n* `mixin``\n* The order of the attributes has no influence on the response.\n","in":"query","required":false,"schema":{"type":"string"}}}},"paths":{"/customer/{tenant}/customers":{"get":{"summary":"Retrieving a list of customers","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CustomerForSellerDto"}}}},"headers":{"Count":{"schema":{"type":"integer"},"description":"Number of retrieved customers."}}},"400":{"$ref":"#/components/responses/400_bad_request"},"401":{"$ref":"#/components/responses/401_unauthorized"},"403":{"$ref":"#/components/responses/403_forbidden"}},"description":"Retrieves a list of customer profiles.","operationId":"GET-customer-tenant-list-customers","parameters":[{"$ref":"#/components/parameters/query_q"},{"$ref":"#/components/parameters/sort"},{"$ref":"#/components/parameters/pageNumber"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/expand"}],"tags":["Account and profile"]}}}}
```

## Creating a customer

> Creates a new customer.

```json
{"openapi":"3.0.0","info":{"title":"Customer Service (tenant-managed)","version":"0.0.1"},"tags":[{"name":"Account and profile"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["customer.customer_manage","customer.customer_manage_own"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"refreshUrl":"","scopes":{"customer.customer_read":"Needed to retrieve customer profiles.","customer.customer_read_own":"Needed by customer to retrieve customer profiles from the same company.","customer.customer_manage":"Needed to manage customer profiles.","customer.customer_manage_own":"Needed by customer to manage customer profiles from the same company."},"tokenUrl":"https://api.emporix.io/oauth/token"}}}},"schemas":{"ResourceLocation":{"type":"object","title":"Resource Location","description":"Schema for showing location of the new resource.","properties":{"id":{"description":"Resource identifier.","type":"string"}}},"ErrorMessage":{"title":"","description":"Schema for API-specific errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `validation_failure`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."},"details":{"description":"List of problems causing the error.","type":"array","items":{"title":"errorDetail","description":"Specific error cause.","type":"object","properties":{"field":{"description":"Element in request data which is causing the error, for example `category.name`.\nIf the violation was not field-specific, this field will be empty.","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the specific error cause. This value should always be interpreted within the context of the general error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `missing_value`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."}}}}}},"CustomerSignupBySellerDto":{"allOf":[{"$ref":"#/components/schemas/CustomerCreateDto"},{"type":"object","properties":{"id":{"type":"string","description":"Custom customer identifier. If not provided, it is automatically generated.","minLength":1,"maxLength":66,"pattern":"^[a-zA-Z0-9_-]$"},"contactEmail":{"type":"string"},"password":{"type":"string","description":"Initial password for customer"}}}]},"CustomerCreateDto":{"type":"object","properties":{"title":{"type":"string"},"firstName":{"type":"string"},"middleName":{"type":"string"},"lastName":{"type":"string"},"contactPhone":{"type":"string"},"company":{"type":"string"},"preferredLanguage":{"type":"string","default":"en_US","description":"Customer preferred language."},"preferredCurrency":{"type":"string","default":"USD","description":"Customer preferred currency, compliant with the ISO 4217 standard.","minLength":3,"maxLength":3},"preferredSite":{"type":"string","default":"main","description":"Customer preferred site."},"type":{"type":"string","description":"User type. Supported values are: `CUSTOMER` and `CONTACT`. If the field is empty then the user is considered as a customer."},"photoUrl":{"type":"string","description":"Url of a picture."},"b2b":{"allOf":[{"$ref":"#/components/schemas/B2BCreate"}]},"metadata":{"$ref":"#/components/schemas/BasicMetadataDto"},"mixins":{"type":"object","description":"Customer account's additional properties. The property is not returned by default. In order to return the mixins property use `expand=mixin:*` query param.","additionalProperties":true},"restriction":{"$ref":"#/components/schemas/Restriction"}}},"B2BCreate":{"type":"object","description":"Additional properties for B2B customer.","properties":{"companyRegistrationId":{"type":"string","description":"Registration number of the company."}}},"BasicMetadataDto":{"title":"DefaultDtoMetadata","type":"object","properties":{"mixins":{"type":"object","additionalProperties":true}},"description":"Links to mixin schemas."},"Restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the customer.\n\n**Purpose**: Restricts customer visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access customers with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view customers with the `restriction` value that matches one of their authorized restrictions.\n\n**Validation**: The value must exist in the tenant's configured list of valid restrictions.\n\n**Site Synchronization**: If the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with `preferredSite` property.\n"}},"responses":{"400_bad_request":{"description":"Request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401_unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"403_forbidden":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"409_conflict":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"parameters":{"sendPasswordResetNotifications":{"name":"sendPasswordResetNotifications","in":"query","required":false,"schema":{"type":"boolean","default":true},"description":"Flag indicating whether the customer should receive an email with a password reset link once their account is created.\n"}}},"paths":{"/customer/{tenant}/customers":{"post":{"summary":"Creating a customer","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceLocation"}}}},"400":{"$ref":"#/components/responses/400_bad_request"},"401":{"$ref":"#/components/responses/401_unauthorized"},"403":{"$ref":"#/components/responses/403_forbidden"},"409":{"$ref":"#/components/responses/409_conflict"}},"description":"Creates a new customer.","operationId":"POST-customer-tenant-create-customer","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerSignupBySellerDto"}}},"required":false,"description":""},"parameters":[{"$ref":"#/components/parameters/sendPasswordResetNotifications"}],"tags":["Account and profile"]}}}}
```

## Searching for customers

> Searches for customer profiles.

```json
{"openapi":"3.0.0","info":{"title":"Customer Service (tenant-managed)","version":"0.0.1"},"tags":[{"name":"Account and profile"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["customer.customer_read","customer.customer_read_own"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"refreshUrl":"","scopes":{"customer.customer_read":"Needed to retrieve customer profiles.","customer.customer_read_own":"Needed by customer to retrieve customer profiles from the same company.","customer.customer_manage":"Needed to manage customer profiles.","customer.customer_manage_own":"Needed by customer to manage customer profiles from the same company."},"tokenUrl":"https://api.emporix.io/oauth/token"}}}},"schemas":{"CustomerForSellerDto":{"title":"CustomerForSellerDto","allOf":[{"$ref":"#/components/schemas/CustomerCommonDto"},{"type":"object","properties":{"customerNumber":{"type":"string","description":"Customer unique number generated when the customer profile is created."},"id":{"type":"string","description":"Customer unique identifier generated when the customer profile is created."},"defaultAddress":{"$ref":"#/components/schemas/Address"},"accounts":{"type":"array","description":"List of accounts associated with the customer profile.","items":{"$ref":"#/components/schemas/AccountId"}},"addresses":{"type":"array","description":"List of customer addresses.","items":{"$ref":"#/components/schemas/Address"}},"contactEmail":{"type":"string"},"active":{"type":"boolean","description":"Flag indicating whether the customer profile is active."},"onHold":{"type":"boolean","description":"Flag indicating whether the customer profile is suspended."},"email":{"type":"string","description":"Customer email address."},"b2b":{"allOf":[{"$ref":"#/components/schemas/B2BGet"}]},"businessModel":{"type":"string","enum":["B2B","B2C"],"description":"Property indicating business model of customer. When customer is assigned to any company then it is `B2B`. Otherwise it is `B2C`."},"metadataCreatedAt":{"type":"string","description":"Customer creation date."}}}]},"CustomerCommonDto":{"type":"object","allOf":[{"$ref":"#/components/schemas/CustomerCreateDto"},{"type":"object","properties":{"metadata":{"$ref":"#/components/schemas/DefaultDtoMetadata"}}}]},"CustomerCreateDto":{"type":"object","properties":{"title":{"type":"string"},"firstName":{"type":"string"},"middleName":{"type":"string"},"lastName":{"type":"string"},"contactPhone":{"type":"string"},"company":{"type":"string"},"preferredLanguage":{"type":"string","default":"en_US","description":"Customer preferred language."},"preferredCurrency":{"type":"string","default":"USD","description":"Customer preferred currency, compliant with the ISO 4217 standard.","minLength":3,"maxLength":3},"preferredSite":{"type":"string","default":"main","description":"Customer preferred site."},"type":{"type":"string","description":"User type. Supported values are: `CUSTOMER` and `CONTACT`. If the field is empty then the user is considered as a customer."},"photoUrl":{"type":"string","description":"Url of a picture."},"b2b":{"allOf":[{"$ref":"#/components/schemas/B2BCreate"}]},"metadata":{"$ref":"#/components/schemas/BasicMetadataDto"},"mixins":{"type":"object","description":"Customer account's additional properties. The property is not returned by default. In order to return the mixins property use `expand=mixin:*` query param.","additionalProperties":true},"restriction":{"$ref":"#/components/schemas/Restriction"}}},"B2BCreate":{"type":"object","description":"Additional properties for B2B customer.","properties":{"companyRegistrationId":{"type":"string","description":"Registration number of the company."}}},"BasicMetadataDto":{"title":"DefaultDtoMetadata","type":"object","properties":{"mixins":{"type":"object","additionalProperties":true}},"description":"Links to mixin schemas."},"Restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the customer.\n\n**Purpose**: Restricts customer visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access customers with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view customers with the `restriction` value that matches one of their authorized restrictions.\n\n**Validation**: The value must exist in the tenant's configured list of valid restrictions.\n\n**Site Synchronization**: If the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with `preferredSite` property.\n"},"DefaultDtoMetadata":{"title":"DefaultDtoMetadata","type":"object","allOf":[{"$ref":"#/components/schemas/BasicMetadataDto"},{"type":"object","properties":{"version":{"type":"integer"}}}]},"Address":{"type":"object","description":"Customer address information.","properties":{"id":{"type":"string","description":"Customer address unique identifier generated when the address is added to the customer account."},"contactName":{"type":"string"},"companyName":{"type":"string"},"street":{"type":"string"},"streetNumber":{"type":"string"},"streetAppendix":{"type":"string"},"extraLine1":{"type":"string"},"extraLine2":{"type":"string"},"extraLine3":{"type":"string"},"extraLine4":{"type":"string"},"zipCode":{"type":"string"},"city":{"type":"string"},"country":{"type":"string","maxLength":2,"minLength":2},"state":{"type":"string"},"contactPhone":{"type":"string"},"isDefault":{"type":"boolean","default":false,"description":"Flag indicating whether the address is the customer default address."},"tags":{"type":"array","description":"","items":{"type":"string"}},"metadata":{"$ref":"#/components/schemas/DefaultDtoMetadata"},"mixins":{"type":"object","description":"Customer address additional properties.","additionalProperties":true}},"required":["contactName"]},"AccountId":{"type":"object","properties":{"id":{"type":"string","description":"Customer email address."},"providerId":{"type":"string","description":"Customer account unique identifier generated by an external identity provider.\n\n**Note**: This field is only applicable if the user has been registered through social login."}}},"B2BGet":{"allOf":[{"$ref":"#/components/schemas/B2BCreate"}],"properties":{"legalEntities":{"type":"array","items":{"properties":{"id":{"type":"string","description":"ID of legal entity."},"name":{"type":"string","description":"Name of legal entity."},"contactAssignmentId":{"type":"string","description":"ID of contact assignment."}}}}}},"ErrorMessage":{"title":"","description":"Schema for API-specific errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `validation_failure`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."},"details":{"description":"List of problems causing the error.","type":"array","items":{"title":"errorDetail","description":"Specific error cause.","type":"object","properties":{"field":{"description":"Element in request data which is causing the error, for example `category.name`.\nIf the violation was not field-specific, this field will be empty.","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the specific error cause. This value should always be interpreted within the context of the general error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `missing_value`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."}}}}}}},"responses":{"400_bad_request":{"description":"Request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401_unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"403_forbidden":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"parameters":{"sort":{"name":"sort","in":"query","description":"List of properties used to sort the results, separated by colons.\nPossible values:\n* `{fieldName}`\n* `{fieldName}:asc`\n* `{fieldName}:desc`\n\n**Note:** If you want to sort the results by localized properties, the possible values are:\n  * `{fieldName}.{language}`\n  * `{fieldName}.{language}:asc`\n  * `{fieldName}.{language}:desc`\n\nBy default, the fields are sorted in ascending order.\n","schema":{"type":"string"}},"pageNumber":{"name":"pageNumber","in":"query","description":"Page number to be retrieved. The number of the first page is 1.\n\n**Note:** If the `pageNumber` parameter is passed, size of the pages must be specified in the `pageSize` parameter.\n","schema":{"default":1,"minimum":1,"type":"integer"}},"pageSize":{"name":"pageSize","in":"query","description":"Number of customers to be retrieved per page.\n","schema":{"default":60,"minimum":1,"type":"integer"}},"expand":{"name":"expand","description":"List of additional attributes to be retrieved, separated by commas.\nPossible values to be passed in this parameter are:\n* `addresses`\n* `accounts`\n* `mixin``\n* The order of the attributes has no influence on the response.\n","in":"query","required":false,"schema":{"type":"string"}},"tenant":{"description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","name":"tenant","in":"path","required":true,"schema":{"type":"string"}}}},"paths":{"/customer/{tenant}/customers/search":{"post":{"summary":"Searching for customers","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"q":{"type":"string","description":"A standard query parameter is used to search for specific values. \n\nSee: [Standard practises - Query parameter](https://developer.emporix.io/api-references/standard-practices/q-param)\n"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CustomerForSellerDto"}}}},"headers":{"Count":{"schema":{"type":"integer"},"description":"Number of retrieved customers."}}},"400":{"$ref":"#/components/responses/400_bad_request"},"401":{"$ref":"#/components/responses/401_unauthorized"},"403":{"$ref":"#/components/responses/403_forbidden"}},"description":"Searches for customer profiles.","operationId":"POST-customer-tenant-search","parameters":[{"$ref":"#/components/parameters/sort"},{"$ref":"#/components/parameters/pageNumber"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/expand"},{"$ref":"#/components/parameters/tenant"}],"tags":["Account and profile"]}}}}
```

## Retrieving a customer profile

> Retrieves a specified customer profile.

```json
{"openapi":"3.0.0","info":{"title":"Customer Service (tenant-managed)","version":"0.0.1"},"tags":[{"name":"Account and profile"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["customer.customer_read","customer.customer_read_own"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"refreshUrl":"","scopes":{"customer.customer_read":"Needed to retrieve customer profiles.","customer.customer_read_own":"Needed by customer to retrieve customer profiles from the same company.","customer.customer_manage":"Needed to manage customer profiles.","customer.customer_manage_own":"Needed by customer to manage customer profiles from the same company."},"tokenUrl":"https://api.emporix.io/oauth/token"}}}},"schemas":{"CustomerForSellerDto":{"title":"CustomerForSellerDto","allOf":[{"$ref":"#/components/schemas/CustomerCommonDto"},{"type":"object","properties":{"customerNumber":{"type":"string","description":"Customer unique number generated when the customer profile is created."},"id":{"type":"string","description":"Customer unique identifier generated when the customer profile is created."},"defaultAddress":{"$ref":"#/components/schemas/Address"},"accounts":{"type":"array","description":"List of accounts associated with the customer profile.","items":{"$ref":"#/components/schemas/AccountId"}},"addresses":{"type":"array","description":"List of customer addresses.","items":{"$ref":"#/components/schemas/Address"}},"contactEmail":{"type":"string"},"active":{"type":"boolean","description":"Flag indicating whether the customer profile is active."},"onHold":{"type":"boolean","description":"Flag indicating whether the customer profile is suspended."},"email":{"type":"string","description":"Customer email address."},"b2b":{"allOf":[{"$ref":"#/components/schemas/B2BGet"}]},"businessModel":{"type":"string","enum":["B2B","B2C"],"description":"Property indicating business model of customer. When customer is assigned to any company then it is `B2B`. Otherwise it is `B2C`."},"metadataCreatedAt":{"type":"string","description":"Customer creation date."}}}]},"CustomerCommonDto":{"type":"object","allOf":[{"$ref":"#/components/schemas/CustomerCreateDto"},{"type":"object","properties":{"metadata":{"$ref":"#/components/schemas/DefaultDtoMetadata"}}}]},"CustomerCreateDto":{"type":"object","properties":{"title":{"type":"string"},"firstName":{"type":"string"},"middleName":{"type":"string"},"lastName":{"type":"string"},"contactPhone":{"type":"string"},"company":{"type":"string"},"preferredLanguage":{"type":"string","default":"en_US","description":"Customer preferred language."},"preferredCurrency":{"type":"string","default":"USD","description":"Customer preferred currency, compliant with the ISO 4217 standard.","minLength":3,"maxLength":3},"preferredSite":{"type":"string","default":"main","description":"Customer preferred site."},"type":{"type":"string","description":"User type. Supported values are: `CUSTOMER` and `CONTACT`. If the field is empty then the user is considered as a customer."},"photoUrl":{"type":"string","description":"Url of a picture."},"b2b":{"allOf":[{"$ref":"#/components/schemas/B2BCreate"}]},"metadata":{"$ref":"#/components/schemas/BasicMetadataDto"},"mixins":{"type":"object","description":"Customer account's additional properties. The property is not returned by default. In order to return the mixins property use `expand=mixin:*` query param.","additionalProperties":true},"restriction":{"$ref":"#/components/schemas/Restriction"}}},"B2BCreate":{"type":"object","description":"Additional properties for B2B customer.","properties":{"companyRegistrationId":{"type":"string","description":"Registration number of the company."}}},"BasicMetadataDto":{"title":"DefaultDtoMetadata","type":"object","properties":{"mixins":{"type":"object","additionalProperties":true}},"description":"Links to mixin schemas."},"Restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the customer.\n\n**Purpose**: Restricts customer visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access customers with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view customers with the `restriction` value that matches one of their authorized restrictions.\n\n**Validation**: The value must exist in the tenant's configured list of valid restrictions.\n\n**Site Synchronization**: If the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with `preferredSite` property.\n"},"DefaultDtoMetadata":{"title":"DefaultDtoMetadata","type":"object","allOf":[{"$ref":"#/components/schemas/BasicMetadataDto"},{"type":"object","properties":{"version":{"type":"integer"}}}]},"Address":{"type":"object","description":"Customer address information.","properties":{"id":{"type":"string","description":"Customer address unique identifier generated when the address is added to the customer account."},"contactName":{"type":"string"},"companyName":{"type":"string"},"street":{"type":"string"},"streetNumber":{"type":"string"},"streetAppendix":{"type":"string"},"extraLine1":{"type":"string"},"extraLine2":{"type":"string"},"extraLine3":{"type":"string"},"extraLine4":{"type":"string"},"zipCode":{"type":"string"},"city":{"type":"string"},"country":{"type":"string","maxLength":2,"minLength":2},"state":{"type":"string"},"contactPhone":{"type":"string"},"isDefault":{"type":"boolean","default":false,"description":"Flag indicating whether the address is the customer default address."},"tags":{"type":"array","description":"","items":{"type":"string"}},"metadata":{"$ref":"#/components/schemas/DefaultDtoMetadata"},"mixins":{"type":"object","description":"Customer address additional properties.","additionalProperties":true}},"required":["contactName"]},"AccountId":{"type":"object","properties":{"id":{"type":"string","description":"Customer email address."},"providerId":{"type":"string","description":"Customer account unique identifier generated by an external identity provider.\n\n**Note**: This field is only applicable if the user has been registered through social login."}}},"B2BGet":{"allOf":[{"$ref":"#/components/schemas/B2BCreate"}],"properties":{"legalEntities":{"type":"array","items":{"properties":{"id":{"type":"string","description":"ID of legal entity."},"name":{"type":"string","description":"Name of legal entity."},"contactAssignmentId":{"type":"string","description":"ID of contact assignment."}}}}}},"ErrorMessage":{"title":"","description":"Schema for API-specific errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `validation_failure`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."},"details":{"description":"List of problems causing the error.","type":"array","items":{"title":"errorDetail","description":"Specific error cause.","type":"object","properties":{"field":{"description":"Element in request data which is causing the error, for example `category.name`.\nIf the violation was not field-specific, this field will be empty.","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the specific error cause. This value should always be interpreted within the context of the general error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `missing_value`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."}}}}}}},"responses":{"400_bad_request":{"description":"Request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401_unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"403_forbidden":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"404_customer":{"description":"Customer with the specified `customerNumber` doesn't exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"parameters":{"expand":{"name":"expand","description":"List of additional attributes to be retrieved, separated by commas.\nPossible values to be passed in this parameter are:\n* `addresses`\n* `accounts`\n* `mixin``\n* The order of the attributes has no influence on the response.\n","in":"query","required":false,"schema":{"type":"string"}}}},"paths":{"/customer/{tenant}/customers/{customerNumber}":{"get":{"summary":"Retrieving a customer profile","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerForSellerDto"}}}},"400":{"$ref":"#/components/responses/400_bad_request"},"401":{"$ref":"#/components/responses/401_unauthorized"},"403":{"$ref":"#/components/responses/403_forbidden"},"404":{"$ref":"#/components/responses/404_customer"}},"description":"Retrieves a specified customer profile.","operationId":"GET-customer-tenant-retrieve-customer","parameters":[{"$ref":"#/components/parameters/expand"}],"tags":["Account and profile"]}}}}
```

## Upserting a customer profile

> Updates a specified customer profile or creates a new one if it doesn't exist yet.<br>

```json
{"openapi":"3.0.0","info":{"title":"Customer Service (tenant-managed)","version":"0.0.1"},"tags":[{"name":"Account and profile"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["customer.customer_manage","customer.customer_manage_own"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"refreshUrl":"","scopes":{"customer.customer_read":"Needed to retrieve customer profiles.","customer.customer_read_own":"Needed by customer to retrieve customer profiles from the same company.","customer.customer_manage":"Needed to manage customer profiles.","customer.customer_manage_own":"Needed by customer to manage customer profiles from the same company."},"tokenUrl":"https://api.emporix.io/oauth/token"}}}},"schemas":{"ResourceLocation":{"type":"object","title":"Resource Location","description":"Schema for showing location of the new resource.","properties":{"id":{"description":"Resource identifier.","type":"string"}}},"ErrorMessage":{"title":"","description":"Schema for API-specific errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `validation_failure`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."},"details":{"description":"List of problems causing the error.","type":"array","items":{"title":"errorDetail","description":"Specific error cause.","type":"object","properties":{"field":{"description":"Element in request data which is causing the error, for example `category.name`.\nIf the violation was not field-specific, this field will be empty.","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the specific error cause. This value should always be interpreted within the context of the general error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `missing_value`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."}}}}}},"CustomerUpdateBySellerDto":{"allOf":[{"$ref":"#/components/schemas/CustomerCommonDto"},{"type":"object","properties":{"contactEmail":{"type":"string"},"active":{"type":"boolean"},"onHold":{"type":"boolean"}}}]},"CustomerCommonDto":{"type":"object","allOf":[{"$ref":"#/components/schemas/CustomerCreateDto"},{"type":"object","properties":{"metadata":{"$ref":"#/components/schemas/DefaultDtoMetadata"}}}]},"CustomerCreateDto":{"type":"object","properties":{"title":{"type":"string"},"firstName":{"type":"string"},"middleName":{"type":"string"},"lastName":{"type":"string"},"contactPhone":{"type":"string"},"company":{"type":"string"},"preferredLanguage":{"type":"string","default":"en_US","description":"Customer preferred language."},"preferredCurrency":{"type":"string","default":"USD","description":"Customer preferred currency, compliant with the ISO 4217 standard.","minLength":3,"maxLength":3},"preferredSite":{"type":"string","default":"main","description":"Customer preferred site."},"type":{"type":"string","description":"User type. Supported values are: `CUSTOMER` and `CONTACT`. If the field is empty then the user is considered as a customer."},"photoUrl":{"type":"string","description":"Url of a picture."},"b2b":{"allOf":[{"$ref":"#/components/schemas/B2BCreate"}]},"metadata":{"$ref":"#/components/schemas/BasicMetadataDto"},"mixins":{"type":"object","description":"Customer account's additional properties. The property is not returned by default. In order to return the mixins property use `expand=mixin:*` query param.","additionalProperties":true},"restriction":{"$ref":"#/components/schemas/Restriction"}}},"B2BCreate":{"type":"object","description":"Additional properties for B2B customer.","properties":{"companyRegistrationId":{"type":"string","description":"Registration number of the company."}}},"BasicMetadataDto":{"title":"DefaultDtoMetadata","type":"object","properties":{"mixins":{"type":"object","additionalProperties":true}},"description":"Links to mixin schemas."},"Restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the customer.\n\n**Purpose**: Restricts customer visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access customers with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view customers with the `restriction` value that matches one of their authorized restrictions.\n\n**Validation**: The value must exist in the tenant's configured list of valid restrictions.\n\n**Site Synchronization**: If the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with `preferredSite` property.\n"},"DefaultDtoMetadata":{"title":"DefaultDtoMetadata","type":"object","allOf":[{"$ref":"#/components/schemas/BasicMetadataDto"},{"type":"object","properties":{"version":{"type":"integer"}}}]},"CustomerUpdateDto":{"allOf":[{"$ref":"#/components/schemas/CustomerCommonDto"},{"type":"object","properties":{"contactEmail":{"type":"string"}}}]}},"responses":{"400_bad_request":{"description":"Request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401_unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"403_forbidden":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"409_conflict":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"parameters":{"sendPasswordResetNotifications":{"name":"sendPasswordResetNotifications","in":"query","required":false,"schema":{"type":"boolean","default":true},"description":"Flag indicating whether the customer should receive an email with a password reset link once their account is created.\n"}}},"paths":{"/customer/{tenant}/customers/{customerNumber}":{"put":{"summary":"Upserting a customer profile","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceLocation"}}}},"204":{"description":"No Content - update has been successful"},"400":{"$ref":"#/components/responses/400_bad_request"},"401":{"$ref":"#/components/responses/401_unauthorized"},"403":{"$ref":"#/components/responses/403_forbidden"},"409":{"$ref":"#/components/responses/409_conflict"}},"description":"Updates a specified customer profile or creates a new one if it doesn't exist yet.\n","operationId":"PUT-customer-tenant-update-customer","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerUpdateBySellerDto"}},"application/merge-patch+json":{"schema":{"$ref":"#/components/schemas/CustomerUpdateDto"}}},"required":false,"description":""},"parameters":[{"$ref":"#/components/parameters/sendPasswordResetNotifications"}],"tags":["Account and profile"]}}}}
```

## Deleting a customer profile

> Deletes a specified customer profile and accounts associated with it.     <br>

```json
{"openapi":"3.0.0","info":{"title":"Customer Service (tenant-managed)","version":"0.0.1"},"tags":[{"name":"Account and profile"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["customer.customer_manage","customer.customer_manage_own"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"refreshUrl":"","scopes":{"customer.customer_read":"Needed to retrieve customer profiles.","customer.customer_read_own":"Needed by customer to retrieve customer profiles from the same company.","customer.customer_manage":"Needed to manage customer profiles.","customer.customer_manage_own":"Needed by customer to manage customer profiles from the same company."},"tokenUrl":"https://api.emporix.io/oauth/token"}}}},"responses":{"400_bad_request":{"description":"Request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401_unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"403_forbidden":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"404_customer":{"description":"Customer with the specified `customerNumber` doesn't exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"schemas":{"ErrorMessage":{"title":"","description":"Schema for API-specific errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `validation_failure`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."},"details":{"description":"List of problems causing the error.","type":"array","items":{"title":"errorDetail","description":"Specific error cause.","type":"object","properties":{"field":{"description":"Element in request data which is causing the error, for example `category.name`.\nIf the violation was not field-specific, this field will be empty.","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the specific error cause. This value should always be interpreted within the context of the general error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `missing_value`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."}}}}}}}},"paths":{"/customer/{tenant}/customers/{customerNumber}":{"delete":{"summary":"Deleting a customer profile","requestBody":{"content":{"application/json":{"schema":{"type":"object"}}},"required":false},"responses":{"202":{"description":"Accepted"},"400":{"$ref":"#/components/responses/400_bad_request"},"401":{"$ref":"#/components/responses/401_unauthorized"},"403":{"$ref":"#/components/responses/403_forbidden"},"404":{"$ref":"#/components/responses/404_customer"}},"description":"Deletes a specified customer profile and accounts associated with it.     \n","operationId":"DELETE-customer-tenant-remove-customer","parameters":[],"tags":["Account and profile"]}}}}
```

## Updating a customer profile

> Updates a specified customer profile.<br>

```json
{"openapi":"3.0.0","info":{"title":"Customer Service (tenant-managed)","version":"0.0.1"},"tags":[{"name":"Account and profile"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["customer.customer_manage","customer.customer_manage_own"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"refreshUrl":"","scopes":{"customer.customer_read":"Needed to retrieve customer profiles.","customer.customer_read_own":"Needed by customer to retrieve customer profiles from the same company.","customer.customer_manage":"Needed to manage customer profiles.","customer.customer_manage_own":"Needed by customer to manage customer profiles from the same company."},"tokenUrl":"https://api.emporix.io/oauth/token"}}}},"responses":{"400_bad_request":{"description":"Request was syntactically incorrect. Details will be provided in the response payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401_unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"403_forbidden":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"404_customer":{"description":"Customer with the specified `customerNumber` doesn't exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"schemas":{"ErrorMessage":{"title":"","description":"Schema for API-specific errors.","type":"object","properties":{"status":{"minimum":100,"maximum":599,"description":"Original HTTP error code. It should be consistent with the HTTP response code.","type":"integer"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `validation_failure`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."},"details":{"description":"List of problems causing the error.","type":"array","items":{"title":"errorDetail","description":"Specific error cause.","type":"object","properties":{"field":{"description":"Element in request data which is causing the error, for example `category.name`.\nIf the violation was not field-specific, this field will be empty.","type":"string"},"type":{"pattern":"[a-z]+[a-z_]*[a-z]+","description":"Classification of the specific error cause. This value should always be interpreted within the context of the general error type.\n**Note:** The error type should be written in lowercase and include underscores, for example `missing_value`.","type":"string"},"message":{"description":"Descriptive error message for debugging purposes.","type":"string"},"moreInfo":{"type":"string","description":"More information (such as a link to the documentation) for investigating further and getting support."}}}}}},"CustomerUpdateBySellerDto":{"allOf":[{"$ref":"#/components/schemas/CustomerCommonDto"},{"type":"object","properties":{"contactEmail":{"type":"string"},"active":{"type":"boolean"},"onHold":{"type":"boolean"}}}]},"CustomerCommonDto":{"type":"object","allOf":[{"$ref":"#/components/schemas/CustomerCreateDto"},{"type":"object","properties":{"metadata":{"$ref":"#/components/schemas/DefaultDtoMetadata"}}}]},"CustomerCreateDto":{"type":"object","properties":{"title":{"type":"string"},"firstName":{"type":"string"},"middleName":{"type":"string"},"lastName":{"type":"string"},"contactPhone":{"type":"string"},"company":{"type":"string"},"preferredLanguage":{"type":"string","default":"en_US","description":"Customer preferred language."},"preferredCurrency":{"type":"string","default":"USD","description":"Customer preferred currency, compliant with the ISO 4217 standard.","minLength":3,"maxLength":3},"preferredSite":{"type":"string","default":"main","description":"Customer preferred site."},"type":{"type":"string","description":"User type. Supported values are: `CUSTOMER` and `CONTACT`. If the field is empty then the user is considered as a customer."},"photoUrl":{"type":"string","description":"Url of a picture."},"b2b":{"allOf":[{"$ref":"#/components/schemas/B2BCreate"}]},"metadata":{"$ref":"#/components/schemas/BasicMetadataDto"},"mixins":{"type":"object","description":"Customer account's additional properties. The property is not returned by default. In order to return the mixins property use `expand=mixin:*` query param.","additionalProperties":true},"restriction":{"$ref":"#/components/schemas/Restriction"}}},"B2BCreate":{"type":"object","description":"Additional properties for B2B customer.","properties":{"companyRegistrationId":{"type":"string","description":"Registration number of the company."}}},"BasicMetadataDto":{"title":"DefaultDtoMetadata","type":"object","properties":{"mixins":{"type":"object","additionalProperties":true}},"description":"Links to mixin schemas."},"Restriction":{"type":"string","nullable":true,"description":"Access control identifier that determines who can view or manage the customer.\n\n**Purpose**: Restricts customer visibility based on scope permissions. Only users/applications \nwith matching restriction scopes can access customers with a specific restriction value.\n\n**Access Control**:\n- *Reading*: Users can only query and view customers with the `restriction` value that matches one of their authorized restrictions.\n\n**Validation**: The value must exist in the tenant's configured list of valid restrictions.\n\n**Site Synchronization**: If the `restriction` property is not set with tenant configuration property `enableSyncBetweenRestrictionsAndSiteCodes` set to `true`, the `restriction` field automatically syncs with `preferredSite` property.\n"},"DefaultDtoMetadata":{"title":"DefaultDtoMetadata","type":"object","allOf":[{"$ref":"#/components/schemas/BasicMetadataDto"},{"type":"object","properties":{"version":{"type":"integer"}}}]},"CustomerUpdateDto":{"allOf":[{"$ref":"#/components/schemas/CustomerCommonDto"},{"type":"object","properties":{"contactEmail":{"type":"string"}}}]}}},"paths":{"/customer/{tenant}/customers/{customerNumber}":{"patch":{"summary":"Updating a customer profile","responses":{"200":{"description":"OK"},"400":{"$ref":"#/components/responses/400_bad_request"},"401":{"$ref":"#/components/responses/401_unauthorized"},"403":{"$ref":"#/components/responses/403_forbidden"},"404":{"$ref":"#/components/responses/404_customer"}},"description":"Updates a specified customer profile.\n","operationId":"PATCH-customer-tenant-update-customer","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerUpdateBySellerDto"}},"application/merge-patch+json":{"schema":{"$ref":"#/components/schemas/CustomerUpdateDto"}}},"required":false,"description":""},"parameters":[],"tags":["Account and profile"]}}}}
```
