# Account and profile

Manage customer account details.

## Retrieving a customer profile

> Retrieves a customer profile.\
> \
> \*\*Note\*\*: The request needs to be authorized with a customer access token or an anonymous access token.

```json
{"openapi":"3.0.0","info":{"title":"Customer Service (customer-managed)","version":"0.0.1"},"tags":[{"name":"Account and profile","description":"Manage customer account details."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"CustomerAccessToken":[]},{"AnonymousAccessToken":[]}],"components":{"securitySchemes":{"CustomerAccessToken":{"type":"http","scheme":"bearer","description":"To generate a customer access token, go to the 'Logging in a customer' endpoint."},"AnonymousAccessToken":{"type":"http","scheme":"bearer","description":"To generate an anonymous token, check out the 'Requesting an anonymous token' endpoint."}},"schemas":{"Customer":{"type":"object","description":"Customer profile.","properties":{"id":{"type":"string","description":"Customer unique identifier generated when the customer profile is created."},"customerNumber":{"type":"string","description":"Customer unique number generated when the customer profile is created."},"title":{"type":"string"},"firstName":{"type":"string"},"middleName":{"type":"string"},"lastName":{"type":"string"},"contactEmail":{"type":"string"},"contactPhone":{"type":"string"},"company":{"type":"string"},"preferredLanguage":{"type":"string","default":"en_US","description":"Customer preferred language."},"preferredCurrency":{"type":"string","default":"USD","minLength":3,"maxLength":3,"description":"Customer's preferred currency, compliant with the ISO 4217 standard."},"preferredSite":{"type":"string","default":"main","description":"Customer preferred site."},"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"}},"defaultAddress":{"$ref":"#/components/schemas/Address"},"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`."},"b2b":{"$ref":"#/components/schemas/B2BGet"},"mixins":{"type":"object","description":"Customer account additional properties.","additionalProperties":true},"metadata":{"$ref":"#/components/schemas/DefaultDtoMetadata"},"lastLogin":{"type":"string","description":"Customer last login date. ","format":"date-time"}}},"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."}}},"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"]},"DefaultDtoMetadata":{"title":"DefaultDtoMetadata","type":"object","allOf":[{"$ref":"#/components/schemas/BasicMetadataDto"},{"type":"object","properties":{"version":{"type":"integer"}}}]},"BasicMetadataDto":{"title":"DefaultDtoMetadata","type":"object","properties":{"mixins":{"type":"object","additionalProperties":true}},"description":"Links to mixin schemas."},"B2BGet":{"type":"object","description":"Additional properties for B2B customer. If the `companyRegistrationId` property is provided, an additional validation for customer details executes - `firstName`, `lastName` and `company` values have to be provided.","properties":{"companyRegistrationId":{"type":"string","description":"Registration number of the company."},"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":{"expand":{"name":"expand","description":"List of additional attributes to be retrieved, separated by commas.\nPossible value to be passed in this parameter is `addresses`.\nTo expand mixins, use the `*` character: `mixin:*`.\n","in":"query","required":false,"schema":{"type":"string"}}}},"paths":{"/customer/{tenant}/me":{"get":{"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"400":{"$ref":"#/components/responses/400_bad_request"},"401":{"$ref":"#/components/responses/401_unauthorized"},"403":{"$ref":"#/components/responses/403_forbidden"}},"description":"Retrieves a customer profile.\n\n**Note**: The request needs to be authorized with a customer access token or an anonymous access token.","operationId":"GET-customer-retrieve-customer-profile","summary":"Retrieving a customer profile","parameters":[{"$ref":"#/components/parameters/expand"}],"tags":["Account and profile"]}}}}
```

## Updating a customer profile

> Updates a customer profile.\
> \
> \*\*Note\*\*: The request needs to be authorized with a customer access token.<br>

```json
{"openapi":"3.0.0","info":{"title":"Customer Service (customer-managed)","version":"0.0.1"},"tags":[{"name":"Account and profile","description":"Manage customer account details."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"CustomerAccessToken":[]}],"components":{"securitySchemes":{"CustomerAccessToken":{"type":"http","scheme":"bearer","description":"To generate a customer access token, go to the 'Logging in a customer' endpoint."}},"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"}}}}},"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."}}}}}},"CustomerPatchDto":{"allOf":[{"$ref":"#/components/schemas/CustomerUpdateDto"},{"type":"object","properties":{"contactEmail":{"type":"string","description":"Contact email address. Cannot be unset once a value is present."}}}]},"CustomerUpdateDto":{"allOf":[{"$ref":"#/components/schemas/CustomerCommonDto"},{"type":"object","properties":{"contactEmail":{"type":"string"}}}]},"CustomerCommonDto":{"title":"CustomerCommonDto","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's preferred currency, compliant with the ISO 4217 standard.","minLength":3,"maxLength":3},"preferredSite":{"type":"string","default":"main","description":"Customer preferred site."},"b2b":{"$ref":"#/components/schemas/B2BCreate"},"metadata":{"$ref":"#/components/schemas/DefaultDtoMetadata"},"mixins":{"type":"object","description":"Customer account additional properties.","additionalProperties":true}}},"B2BCreate":{"type":"object","description":"Additional properties for B2B customer. If the `companyRegistrationId` property is provided, an additional validation for customer details executes - `firstName`, `lastName` and `company` values have to be provided.","properties":{"companyRegistrationId":{"type":"string","description":"Registration number of the company."}}},"DefaultDtoMetadata":{"title":"DefaultDtoMetadata","type":"object","allOf":[{"$ref":"#/components/schemas/BasicMetadataDto"},{"type":"object","properties":{"version":{"type":"integer"}}}]},"BasicMetadataDto":{"title":"DefaultDtoMetadata","type":"object","properties":{"mixins":{"type":"object","additionalProperties":true}},"description":"Links to mixin schemas."}}},"paths":{"/customer/{tenant}/me":{"patch":{"responses":{"200":{"description":"OK"},"400":{"$ref":"#/components/responses/400_bad_request"},"401":{"$ref":"#/components/responses/401_unauthorized"},"403":{"$ref":"#/components/responses/403_forbidden"}},"description":"Updates a customer profile.\n\n**Note**: The request needs to be authorized with a customer access token.\n","operationId":"PATCH-customer-update-customer","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPatchDto"}},"application/merge-patch+json":{"schema":{"$ref":"#/components/schemas/CustomerPatchDto"}}},"required":false},"summary":"Updating a customer profile","tags":["Account and profile"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.emporix.io/api-references-1/readme/api-reference-12/account-and-profile.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
