Account and profile

Retrieving a list of customers

get

Retrieves a list of customer profiles.

customer.customer_read_own scope allows customers to read profiles from another customers within the same company.


Required scopes

  • customer.customer_read

  • customer.customer_read_own

Authorizations
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Query parameters
qstringOptional

A standard query parameter used to search for specific values.

Example: contactEmail:{email}
sortstringOptional

List of properties used to sort the results, separated by colons. Possible values:

  • {fieldName}
  • {fieldName}:asc
  • {fieldName}:desc

Note: If you want to sort the results by localized properties, the possible values are:

  • {fieldName}.{language}
  • {fieldName}.{language}:asc
  • {fieldName}.{language}:desc

By default, the fields are sorted in ascending order.

pageNumberinteger · min: 1Optional

Page number to be retrieved. The number of the first page is 1.

Note: If the pageNumber parameter is passed, size of the pages must be specified in the pageSize parameter.

Default: 1
pageSizeinteger · min: 1Optional

Number of customers to be retrieved per page.

Default: 60
expandstringOptional

List of additional attributes to be retrieved, separated by commas. Possible values to be passed in this parameter are:

  • addresses
  • accounts *mixin:* Order of the attributes has no influence on the response.
Responses
200
OK
application/json
get
GET /customer/{tenant}/customers HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
  {
    "title": "MR",
    "firstName": "John",
    "lastName": "Doe",
    "contactPhone": "123456789",
    "company": "Emporix",
    "preferredLanguage": "en_US",
    "preferredCurrency": "EUR",
    "preferredSite": "main",
    "mixins": {},
    "metadata": {
      "mixins": {},
      "version": 6
    },
    "customerNumber": "13869000",
    "id": "13869000",
    "contactEmail": "example@customer.com",
    "active": true,
    "onHold": false,
    "businessModel": "B2B",
    "b2b": {
      "companyRegistrationId": "123-456-789",
      "legalEntities": [
        {
          "id": "D165356",
          "name": "BMW",
          "contactAssignmentId": "D436432"
        }
      ]
    }
  }
]

Creating a customer

post

Creates a new customer.

customer.customer_manage_own scope allow customers to create a new customer. Such customer will be automatically assigned to the customer's company.


Required scopes

  • customer.customer_manage

  • customer.customer_manage_own

Authorizations
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Query parameters
sendPasswordResetNotificationsbooleanOptional

Flag indicating whether the customer should receive an email with a password reset link once their account is created.

Default: true
Body
all ofOptional
Responses
201
Created
application/json
post
POST /customer/{tenant}/customers HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 258

{
  "contactEmail": "john.doe@emporix.com",
  "title": "MR",
  "firstName": "John",
  "lastName": "Doe",
  "contactPhone": "123456789",
  "company": "Emporix",
  "preferredLanguage": "en_US",
  "preferredCurrency": "EUR",
  "preferredSite": "main",
  "b2b": {
    "companyRegistrationId": "123-456-789"
  }
}
{
  "id": "34751075"
}

Retrieving a customer profile

get

Retrieves a specified customer's profile.


customer.customer_read_own scope allows customers to read the specified profiles from another customers within the same company.


Required scopes

  • customer.customer_read

  • customer.customer_read_own

Authorizations
Path parameters
customerNumberstringRequired

Customer's unique identifier generated when the customer's profile is created.

tenantstringRequired

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Query parameters
expandstringOptional

List of additional attributes to be retrieved, separated by commas. Possible values to be passed in this parameter are:

  • addresses
  • accounts *mixin:* Order of the attributes has no influence on the response.
Responses
200
OK
application/json
Responseall of
get
GET /customer/{tenant}/customers/{customerNumber} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "title": "MR",
  "firstName": "John",
  "lastName": "Doe",
  "contactPhone": "123456789",
  "company": "Emporix",
  "preferredLanguage": "en_US",
  "preferredCurrency": "EUR",
  "preferredSite": "main",
  "metadata": {
    "version": 6
  },
  "customerNumber": "13869000",
  "id": "13869000",
  "contactEmail": "example@customer.com",
  "active": true,
  "onHold": false,
  "businessModel": "B2B",
  "b2b": {
    "companyRegistrationId": "123-456-789",
    "legalEntities": [
      {
        "id": "D165356",
        "name": "BMW",
        "contactAssignmentId": "D436432"
      }
    ]
  }
}

Upserting a customer profile

put

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

customer.customer_manage_own scope allows to update customer's profiles from the same company.


Required scopes

  • customer.customer_manage or customer.customer_manage_own

Authorizations
Path parameters
customerNumberstringRequired

Customer's unique identifier generated when the customer's profile is created.

tenantstringRequired

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Query parameters
sendPasswordResetNotificationsbooleanOptional

Flag indicating whether the customer should receive an email with a password reset link once their account is created.

Default: true
Body
all ofOptional
Responses
201
Created
application/json
put
PUT /customer/{tenant}/customers/{customerNumber} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 39

{
  "contactEmail": "example@customer.com"
}
{
  "id": "34751075"
}

Deleting a customer profile

delete

Deletes a specified customer's profile and accounts associated with it.


customer.customer_manage_own scope allows customers to delete a customer only if the customer has been assigned to the same company.

Required scopes

  • customer.customer_manage

  • customer.customer_manage_own

Authorizations
Path parameters
customerNumberstringRequired

Customer's unique identifier generated when the customer's profile is created.

tenantstringRequired

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Responses
202
Accepted
delete
DELETE /customer/{tenant}/customers/{customerNumber} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*

No content

Updating a customer profile

patch

Updates a specified customer's profile.

customer.customer_manage_own scope allows to update customer's profiles from the same company.


Required scopes

  • customer.customer_manage

  • customer.customer_manage_own

Authorizations
Path parameters
customerNumberstringRequired

Customer's unique identifier generated when the customer's profile is created.

tenantstringRequired

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Body
all ofOptional
Responses
200
OK
patch
PATCH /customer/{tenant}/customers/{customerNumber} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 53

{
  "contactEmail": "example@customer.com",
  "active": true
}

No content

Assigning an account to an existing customer profile

post

Assigns a customer account to an existing customer profile.


Required scopes

  • customer.customer_manage

Authorizations
Path parameters
customerNumberstringRequired

Customer's unique identifier generated when the customer's profile is created.

tenantstringRequired

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Query parameters
sendPasswordResetNotificationsbooleanOptional

Flag indicating whether the customer should receive an email with a password reset link once their account is created.

Default: true
Body
emailstringRequired

Customer's email address.

Responses
201
Created
application/json
post
POST /customer/{tenant}/customers/{customerNumber}/accounts/internal HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 32

{
  "email": "john.doe@example.com"
}
{
  "id": "13869000"
}

Was this helpful?