LogoLogo
CommunitySupport PortalYouTubeStart a free trial
  • Welcome
  • Commerce Engine
  • Orchestration Engine
  • API Documentation
  • Release Notes
  • Changelog
  • Emporix API
  • OpenAPI Generator
  • Standard Practices
    • General Info
    • Mixins
    • Query Parameter
    • Translations
    • Custom ID
    • Upsert
    • B2B Token
  • API Guides and References
    • Authorization
      • OAuth Service
        • API Reference
          • Customer Token
          • Anonymous Token
          • Service Access Token
          • Models
        • Download API Specification
    • Artificial Intelligence
      • AI Service
        • AI Tutorials
        • API Reference
          • Text Generation
          • AI Completions
          • Models
        • Download API Specification
    • Configuration
      • Configuration Service
        • Language Tutorials
        • API Reference
          • Tenant configurations
          • Client configurations
          • Global configurations
          • Models
        • Download API Specification
      • Country Service
        • Country Tutorial
        • API Reference
          • Countries
          • Regions
          • Models
        • Download API Specification
      • Currency Service
        • Currency Tutorial
        • API Reference
          • Currencies
          • Currency exchange
          • Models
        • Download API Specification
      • Unit Handling Service
        • Unit Handling Tutorial
        • API Reference
          • Unit management
          • Unit conversion
          • Type management
          • Models
        • Download API Specification
      • Site Settings Service
        • Site Settings Tutorial
        • API Reference
          • Mixins
          • Site settings
          • Models
        • Download API Specification
      • Indexing Service
        • Indexing Tutorial
        • API Reference
          • Configuration
          • Public Configuration
          • Reindex
          • Models
        • Download API Specification
    • Catalogs and Categories
      • Catalog Service
        • Catalog Tutorials
        • API Reference
          • List catalogs
          • Catalog management
          • Models
        • Download API Specification
      • Category Service
        • Category Tutorials
        • API Reference
          • Category Resources
          • Category Assignment Resources
          • Assignment Resources
          • Category Tree Resources
          • Models
        • Download API Specification
    • Products, Labels and Brands
      • Product Service
        • Product Tutorial
        • API Reference
          • Products
          • Product Templates
          • Models
        • Download API Specification
      • Label Service
        • Label Tutorial
        • API Reference
          • Label
          • Media
          • Models
        • Download API Specification
      • Brand Service
        • Brand Tutorial
        • API Reference
          • Brands
          • Media
          • Models
        • Download API Specification
    • Prices and Taxes
      • Price Service
        • Price Tutorials
        • API Reference
          • Price lists
          • Price matching
          • Price models
          • Prices
          • Prices assigned to price lists
          • Models
        • Download API Specification
      • Tax Service
        • Tax Tutorials
        • API Reference
          • Taxes
          • Tax calculation
          • Models
        • Download API Specification
    • Users and Permissions
      • IAM Service
        • IAM Tutorial
        • API Reference
          • Access Controls
          • Group Assignments
          • Groups
          • Permissions
          • Resources
          • Roles
          • Access Control Templates
          • Users
          • Management Dashboard Users
          • Models
        • Download API Specification
      • Session-context Service
        • Session-context Tutorial
        • API Reference
          • Session management
          • Session context modification
          • Own session management
          • Own session context modification
          • Models
        • Download API Specification
    • Companies and Customers
      • Customer Management
        • Customer Management Tutorial
        • API Reference
          • Locations
          • Contact Assignments
          • Legal Entities
          • Models
        • Download API Specification
      • Customer Service (Customer Managed)
        • API Reference
          • Addresses
          • Account and profile
          • Authentication and authorization
          • Double opt In
          • Credentials
          • Models
        • Download API Specification
      • Customer Service (Tenant Managed)
        • API Reference
          • Account and profile
          • Addresses
          • Models
        • Download API Specification
      • Customer Segments
        • Segments Tutorial
        • API Reference
          • Segments
          • Items Assignments
          • Customers Assignments
          • Models
        • Download API Specification
      • Approval Service
        • Approval Tutorials
        • API Reference
          • Approvals
          • Approval
          • Search
          • Models
        • Download API Specification
    • Delivery and Shipping
      • Shipping Service
        • Shipping Tutorial
        • API Reference
          • Customer Group Relations
          • Delivery Windows
          • Shipping Cost
          • Shipping Zones
          • Shipping Methods
          • Shipping Groups
          • Sites
          • Delivery Times Management
          • Delivery Times Slots Management
          • Delivery Cycles
          • Models
        • Download API Specification
      • Delivery Providers Service
        • API Reference
          • Delivery Orders
          • Delivery Plan
          • Models
        • Download API Specification
    • Rewards and Promotions
      • Coupon Service
        • Coupon Tutorial
        • API Reference
          • Coupon Management
          • Coupon Validation
          • Coupon Redemption
          • Referral Coupon Management
          • Models
        • Download API Specification
      • Reward-points Service
        • Reward-points Tutorial
        • API Reference
          • Redeem Options Management
          • Reward Points Management
          • Signed In Customer Reward Points
          • Models
        • Download API Specification
    • Quotes
      • Quote Service
        • Quote Tutorial
        • API Reference
          • Quote management
          • Quote history
          • Quote pdf
          • Quote reason
          • Models
        • Download API Specification
    • Checkout
      • Cart Service
        • Cart Tutorial
        • API Reference
          • Carts
          • Cart items
          • Discounts
          • Models
        • Download API Specification
      • Payment-gateway Service
        • Payment-gateway Tutorial
        • API Reference
          • Payment
          • Payment mode
          • Payment frontend
          • Payment mode frontend
          • Transaction
          • Models
        • Download API Specification
      • Checkout Service
        • Checkout Tutorial
        • API Reference
          • Checkouts
          • Models
        • Download API Specification
      • Fee Service
        • Fee Tutorial
        • API Reference
          • Fee management
          • Item Fee management
          • Product Fees management
          • Item Fee search
          • Models
        • Download API Specification
      • Shopping List
        • API Reference
          • Shopping Lists
          • Models
        • Download API Specification
    • Orders
      • Availability Service
        • Availability Tutorial
        • API Reference
          • Locations
          • Availabilities
          • Models
        • Download API Specification
      • Order Service
        • Order Tutorial
        • API Reference
          • Orders (tenant Managed)
          • Orders (customer Managed)
          • Models
        • Download API Specification
      • Pick-pack Service
        • API Reference
          • Orders
          • Order cycles
          • Assignees
          • Recalculations
          • Events
          • Models
        • Download API Specification
      • Invoice Service
        • Invoice Tutorial
        • API Reference
          • Invoice Jobs
          • Models
        • Download API Specification
      • Returns Service
        • Returns Tutorial
        • API Reference
          • Returns
          • Models
        • Download API Specification
      • SEPA Export Service
        • API Reference
          • Files
          • Jobs
          • Models
        • Download API Specification
    • Utilities
      • Schema Service
        • Schema Tutorial
        • API Reference
          • Schema
          • Type
          • Reference
          • Custom Schema Type
          • Custom Instance
          • Models
        • Download API Specification
      • Sequential-id Service
        • Sequential-id Tutorial
        • API Reference
          • Sequential IDs management
          • Models
        • Download API Specification
    • Media
      • Media Service
        • Media Tutorial
        • API Reference
          • Assets
          • Models
        • Download API Specification
    • Webhooks
      • Webhook Service
        • Webhooks Tutorial
        • API Reference
          • Config
          • Events
          • Svix Emporix Shared Account
          • Models
        • Download API Specification
      • Events-Availability
      • Events-Cart
      • Events-Catalog
      • Events-Category
      • Events-Client Management
      • Events-Customer
      • Events-Index
      • Events-Order
      • Events-Price
      • Events-Product
      • Events-Quote
      • Events-Product
    • Integrations
      • Emporix and Make
      • Identity Providers
      • Workflow Automation
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. API Guides and References
  2. Companies and Customers
  3. Customer Management
  4. API Reference

Legal Entities

PreviousContact AssignmentsNextModels

Was this helpful?

LogoLogo

Resources

  • Emporix.com
  • Developer Policy
  • Terms of Use

Find us

  • LinkedIn

© 2025 Emporix. All Rights Reserved.

Retrieving a legal entity

get

Retrieves a legal entity by the specified unique identifier.


Required scopes

  • customermanagement.legalentity_read

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

The tenant that the caller is acting upon.

Please note that this value is always lowercase.

Pattern: ^[a-z][a-z0-9]+$
legalEntityIdstringRequired

The legal entity unique identifier.

Query parameters
fieldsstringOptional

Comma-separated list of fields to return in the response. If not specified, all fields are returned.

Example: name,type
Responses
200
The request was successful. The requested legal entity is returned.
application/json
400
Request was syntactically incorrect. Details will be provided in the response payload.
application/json
401
Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.
application/json
403
Given authorization scopes are not sufficient and do not match scopes required by the endpoint.
application/json
404
The requested resource does not exist.
application/json
500
Internal Service Error occurred.
application/json
get
GET /customer-management/{tenant}/legal-entities/{legalEntityId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "id": "123e06ecf0452c2d6c0b81390",
  "name": "Company name",
  "type": "COMPANY",
  "legalInfo": {
    "legalName": "Some company name",
    "registrationDate": "2022-03-31T13:18:02.379Z",
    "registrationAgency": "Comp reg agency",
    "registrationId": "627e06ecf0452c2d6c0b81391",
    "countryOfRegistration": "DE",
    "taxRegistrationNumber": "1234"
  },
  "accountLimit": {
    "currency": "EUR",
    "value": 1000.99
  },
  "customerGroups": [
    {
      "id": "123e06ecf0452c2d6c0b81390",
      "name": {
        "en": "Customer group 1",
        "fr": "Groupe de clients 1"
      }
    },
    {
      "id": "123e06ecf0452c2d6c0b12345",
      "name": {
        "en": "Customer group 2",
        "fr": "Groupe de clients 2"
      }
    }
  ],
  "entitiesAddresses": [
    {
      "id": "627e06ecf0452c2d6c0b81391",
      "name": "Main HQ",
      "type": "HEADQUARTER",
      "contactDetails": {
        "emails": [
          "jon.doe@example.com",
          "adam.smith@sample.org"
        ],
        "phones": [
          "1234567890",
          "123456789"
        ],
        "addressLine1": "W Sample St",
        "addressLine2": "3601-3799",
        "city": "South Bend",
        "state": "Indiana",
        "postcode": "46619",
        "countryCode": "US",
        "tags": [
          "shipping"
        ]
      },
      "metadata": {
        "createdAt": "2022-03-31T13:18:02.379Z",
        "modifiedAt": "2022-03-31T13:18:02.379Z",
        "version": 1
      }
    },
    {
      "id": "123e06ecf0acd223140b12345",
      "name": "Main Warehouse",
      "type": "WAREHOUSE",
      "metadata": {
        "createdAt": "2022-03-31T13:22:31.112Z",
        "modifiedAt": "2022-03-31T13:22:31.112Z",
        "version": 1
      }
    }
  ],
  "approvalGroup": [
    {
      "id": "627e06ecf0452c2d6c0b81391",
      "type": "BILLING",
      "primary": true,
      "legalEntity": {
        "id": "123e06ecf0452c2d6c0b81390"
      },
      "customer": {
        "id": "627e06ecf0452c2d6c0b80000",
        "name": "John",
        "surname": "Doe"
      },
      "metadata": {
        "createdAt": "2022-03-11T13:18:03.379Z",
        "modifiedAt": "2022-03-11T13:18:04.379Z",
        "version": 2
      }
    },
    {
      "id": "123e06ecf0452c2d6c0b81390",
      "type": "LOGISTICS",
      "primary": false,
      "legalEntity": {
        "id": "123e06ecf0452c2d6c0b81390"
      },
      "customer": {
        "id": "123e06ecf0452c2d6c0b80000",
        "name": "Adam",
        "surname": "Smith"
      },
      "metadata": {
        "createdAt": "2022-04-11T13:18:52.379Z",
        "modifiedAt": "2022-05-12T15:13:12.379Z",
        "version": 3
      }
    }
  ],
  "metadata": {
    "createdAt": "2022-03-31T13:18:02.379Z",
    "modifiedAt": "2022-03-31T13:18:02.379Z",
    "version": 1
  }
}

Delete a legal entity

delete

Deletes a legal entity.

Important: This operation causes removal of all other entities exclusively subordinated to the requested legal entity in an async way


Required scopes

  • customermanagement.legalentity_manage

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

The tenant that the caller is acting upon.

Please note that this value is always lowercase.

Pattern: ^[a-z][a-z0-9]+$
legalEntityIdstringRequired

The legal entity unique identifier.

Responses
204
The legal entity has been deleted successfully.
400
Request was syntactically incorrect. Details will be provided in the response payload.
application/json
401
Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.
application/json
403
Given authorization scopes are not sufficient and do not match scopes required by the endpoint.
application/json
404
The requested resource does not exist.
application/json
500
Internal Service Error occurred.
application/json
delete
DELETE /customer-management/{tenant}/legal-entities/{legalEntityId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*

No content

  • GETRetrieving all legal entities
  • POSTCreating legal entity
  • POSTSearching with parameters for legal entities
  • GETRetrieving a legal entity
  • PUTUpserting a legal entity
  • DELETEDelete a legal entity

Retrieving all legal entities

get

Retrieves all legal entities. You can filter, sort and paginate the results with query parameters.

If the customermanagement.legalentity_read scope is used, then all legal entities assigned to the tenant are returned. If the customermanagement.legalentity_read_own scope is used, then all legal entities assigned to the customer are returned.


Required scopes

  • customermanagement.legalentity_read

  • customermanagement.legalentity_read_own

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

The tenant that the caller is acting upon.

Please note that this value is always lowercase.

Pattern: ^[a-z][a-z0-9]+$
Query parameters
pageNumberinteger · min: 1Optional

The page number to be retrieved where the size of the pages must be specified by the pageSize parameter. The number of the first page is 1.

Default: 1
pageSizeinteger · min: 1Optional

The number of documents being retrieved on the page.

Default: 16
sortstringOptional

Fields to sort the response data by following order of the parameters from left to right. Can contain multiple fields in format: field name:sort direction separated by a comma. The colon with sort direction parameter is redundant and descending order is taken only if it is equal to desc or DESC. Ascending order is considered in any other case.

Example: name,metadata.createdAt:desc
qstringOptional

Query param for filtering entities by specified type. Examples of query params which are supported:

Q Param Description
name:"Exact match" find an entity with name field with Exact match value
name:~John find an entity with name field containing John value
locDescription.fr:"Description traduction française 02" find an entity with localized locDescription field with Description traduction française 02 value in french language
primary:true find an entity with primary field with true value
metadata.createdAt:(>"2019-01-06T10:29:30.602Z" AND <"2020-01-07T10:29:30.602Z") find an entity with metadata.createdAt field with value between 2019-01-06T10:29:30.602Z and 2020-01-07T10:29:30.602Z
name:exists find an entity with existing name field
name:null find an entity with non-existing name field
name:missing find an entity with non-existing name field
name:"John" surname:~Smith find an entity with name exactly equals to John and surname containing Smith value
name:("John","Jack","James") find an entity with name field with one of the following value: John or Jack or James
Example: name:~john
fieldsstringOptional

Comma-separated list of fields to return in the response. If not specified, all fields are returned.

Example: name,type
idstringOptional

Legal entity id. When specified, only legal entity with the specified id will be returned.

Note: When filtering the results with this field, the equals operator is used. The operator is case-insensitive.

namestringOptional

Legal entity name. When specified, only legal entities containing the specified name will be returned.

Note: When filtering the results with this field, the contains operator is used. The operator is case-insensitive.

typestring · enumOptional

Legal entity type. When specified, only legal entities with the specified type will be returned.

Note: When filtering the results with this field, the equals operator is used.

Possible values:
parentIdstringOptional

The id of the parent legal entity. When specified, only legal entities with the specified parent will be returned.

Note: When filtering the results with this field, the equals operator is used.

legalInfo.legalNamestringOptional

The legal name of the entity. When specified, only legal entities containing the specified name will be returned.

Note: When filtering the results with this field, the contains operator is used. The operator is case-insensitive.

legalInfo.registrationDatestringOptional

Legal entity registration date. When specified, only legal entities registered in the specified date will be returned.

Note: When filtering the results with this field, the equals operator is used.

legalInfo.taxRegistrationNumberstringOptional

Legal entity tax registration number. When specified, only legal entities with the specified tax registration number will be returned.

Note: When filtering the results with this field, the equals operator is used.

legalInfo.registrationAgencystringOptional

Legal entity registration agency. When specified, only legal entities containing the specified registration agency will be returned.

Note: When filtering the results with this field, the contains operator is used. The operator is case-insensitive.

legalInfo.countryOfRegistrationstringOptional

Legal entity registration country. When specified, only legal entities containing the specified registration country will be returned.

Note: When filtering the results with this field, the contains operator is used. The operator is case-insensitive.

legalInfo.registrationIdstringOptional

The id of the legal entity registration. When specified, only legal entities with the specified registration ID will be returned.

Note: When filtering the results with this field, the equals operator is used.

Header parameters
X-Total-CountbooleanOptional

In order to get information how many entities meet a filter requirements, X-Total-Count header has been introduced. The header is optional and its default value is false. It the header is provided and it is true then total count is returned in the X-Total-Count response header. In both cases (X-Total-Count true, false or not provided), the response body has the same format (array of entities). In other words, the information about total count is returned on demand, depending of an existence of X-Total-Count header in a request. Therefore, the X-Total-Count header is not returned if an API consumer didn't ask for it.

Default: false
Responses
200
The request was successful. A list of legal entities is returned.
application/json
400
Request was syntactically incorrect. Details will be provided in the response payload.
application/json
401
Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.
application/json
403
Given authorization scopes are not sufficient and do not match scopes required by the endpoint.
application/json
500
Internal Service Error occurred.
application/json
get
GET /customer-management/{tenant}/legal-entities HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
  {
    "id": "123e06ecf0452c2d6c0b81390",
    "name": "Company name",
    "type": "COMPANY",
    "legalInfo": {
      "legalName": "Some company name",
      "registrationDate": "2022-03-31T13:18:02.379Z",
      "registrationAgency": "Comp reg agency",
      "registrationId": "627e06ecf0452c2d6c0b81391",
      "countryOfRegistration": "DE",
      "taxRegistrationNumber": "1234"
    },
    "metadata": {
      "createdAt": "2022-03-31T13:18:02.379Z",
      "modifiedAt": "2022-03-31T13:18:02.379Z",
      "version": 1
    }
  },
  {
    "id": "123e06ecf0452c2d6c0b12391",
    "name": "Subsidiary name",
    "type": "SUBSIDIARY",
    "parentId": "627e06ecf0452c2d6c0b81391",
    "accountLimit": {
      "currency": "EUR",
      "value": 1000.99
    },
    "legalInfo": {
      "legalName": "Some subsidiary name",
      "registrationDate": "2022-03-31T13:18:02.379Z",
      "taxRegistrationNumber": "4311",
      "registrationAgency": "Sub reg agency",
      "countryOfRegistration": "DE",
      "registrationId": "627e06ecf0452c2d6c0b81399"
    },
    "customerGroups": [
      {
        "id": "123e06ecf0452c2d6c0b81390",
        "name": {
          "en": "Customer group 1",
          "fr": "Groupe de clients 1"
        }
      }
    ],
    "approvalGroup": [
      {
        "id": "321e06ecf0452c2d6c0b81390",
        "type": "BILLING",
        "primary": true,
        "legalEntity": {
          "id": "627e06ecf0452c2d6c0b81391"
        },
        "customer": {
          "id": "123e06ecf0452c2d6c0b81390",
          "name": "Adam",
          "surname": "Smith"
        },
        "metadata": {
          "createdAt": "2022-02-31T13:18:01.379Z",
          "modifiedAt": "2022-02-31T13:18:01.379Z",
          "version": 1
        }
      }
    ],
    "entitiesAddresses": [
      {
        "id": "627e06ecf0452c2d6c0b81391",
        "name": "Main HQ",
        "type": "HEADQUARTER",
        "contactDetails": {
          "emails": [
            "jon.doe@example.com",
            "adam.smith@sample.org"
          ],
          "phones": [
            "1234567890",
            "123456789"
          ],
          "addressLine1": "W Sample St",
          "addressLine2": "3601-3799",
          "city": "South Bend",
          "state": "Indiana",
          "postcode": "46619",
          "countryCode": "US",
          "tags": [
            "shipping"
          ]
        },
        "metadata": {
          "createdAt": "2022-03-31T13:18:02.379Z",
          "modifiedAt": "2022-03-31T13:18:02.379Z",
          "version": 1
        }
      },
      {
        "id": "123e06ecf0acd223140b12345",
        "name": "Main Warehouse",
        "type": "WAREHOUSE",
        "metadata": {
          "createdAt": "2022-03-31T13:22:31.112Z",
          "modifiedAt": "2022-03-31T13:22:31.112Z",
          "version": 1
        }
      }
    ],
    "metadata": {
      "createdAt": "2022-03-31T13:18:02.379Z",
      "modifiedAt": "2022-04-31T13:18:02.379Z",
      "version": 2
    }
  }
]

Creating legal entity

post

Creates a new legal entity for the tenant. A legal entity represents a company or it's subsidiary in the system.


Required scopes

  • customermanagement.legalentity_manage

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

The tenant that the caller is acting upon.

Please note that this value is always lowercase.

Pattern: ^[a-z][a-z0-9]+$
Body
idstring · min: 1 · max: 66Optional

Custom legal entity identifier. If not provided, it is automatically generated.

Pattern: ^[a-zA-Z0-9_-]$
namestringRequired

The name of the legal entity.

typestring · enumOptional

The type of the legal entity. Default value if not provided is: COMPANY

Possible values:
parentIdstringOptional

The id of the parent legal entity.

Responses
201
The request was successful. The legal entity has been created.
application/json
400
Request was syntactically incorrect. Details will be provided in the response payload.
application/json
401
Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.
application/json
403
Given authorization scopes are not sufficient and do not match scopes required by the endpoint.
application/json
409
Given resource already exists
application/json
500
Internal Service Error occurred.
application/json
post
POST /customer-management/{tenant}/legal-entities HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 629

{
  "name": "Company name",
  "type": "COMPANY",
  "legalInfo": {
    "legalName": "Some company name",
    "registrationDate": "2022-03-31T13:18:02.379Z",
    "registrationAgency": "Comp reg agency",
    "registrationId": "627e06ecf0452c2d6c0b81391",
    "countryOfRegistration": "DE",
    "taxRegistrationNumber": "1234"
  },
  "accountLimit": {
    "currency": "EUR",
    "value": 1000.99
  },
  "customerGroups": [
    {
      "id": "123e06ecf0452c2d6c0b81390",
      "name": {
        "en": "En customer group name",
        "de": "De customer group name"
      }
    }
  ],
  "entitiesAddresses": [
    {
      "id": "123e123455452c2d6c0b81390"
    },
    {
      "id": "123e06ecf0acd223140b12345"
    }
  ],
  "approvalGroup": [
    {
      "id": "123e121111452c12330b81390"
    },
    {
      "id": "123e061110acd223133333345"
    }
  ]
}
{
  "id": "53ac81fd0cce8b26b36f3492"
}

Searching with parameters for legal entities

post

Retrieves all legal entities that match provided criteria.

If the customermanagement.legalentity_read scope is used, then all legal entities assigned to the tenant are returned. If the customermanagement.legalentity_read_own scope is used, then all legal entities assigned to the customer are returned.


Required scopes

  • customermanagement.legalentity_read

  • customermanagement.legalentity_read_own

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

The tenant that the caller is acting upon.

Please note that this value is always lowercase.

Pattern: ^[a-z][a-z0-9]+$
Query parameters
pageNumberinteger · min: 1Optional

The page number to be retrieved where the size of the pages must be specified by the pageSize parameter. The number of the first page is 1.

Default: 1
pageSizeinteger · min: 1Optional

The number of documents being retrieved on the page.

Default: 16
sortstringOptional

Fields to sort the response data by following order of the parameters from left to right. Can contain multiple fields in format: field name:sort direction separated by a comma. The colon with sort direction parameter is redundant and descending order is taken only if it is equal to desc or DESC. Ascending order is considered in any other case.

Example: name,metadata.createdAt:desc
fieldsstringOptional

Comma-separated list of fields to return in the response. If not specified, all fields are returned.

Example: name,type
idstringOptional

Legal entity id. When specified, only legal entity with the specified id will be returned.

Note: When filtering the results with this field, the equals operator is used. The operator is case-insensitive.

namestringOptional

Legal entity name. When specified, only legal entities containing the specified name will be returned.

Note: When filtering the results with this field, the contains operator is used. The operator is case-insensitive.

typestring · enumOptional

Legal entity type. When specified, only legal entities with the specified type will be returned.

Note: When filtering the results with this field, the equals operator is used.

Possible values:
parentIdstringOptional

The id of the parent legal entity. When specified, only legal entities with the specified parent will be returned.

Note: When filtering the results with this field, the equals operator is used.

legalInfo.legalNamestringOptional

The legal name of the entity. When specified, only legal entities containing the specified name will be returned.

Note: When filtering the results with this field, the contains operator is used. The operator is case-insensitive.

legalInfo.registrationDatestringOptional

Legal entity registration date. When specified, only legal entities registered in the specified date will be returned.

Note: When filtering the results with this field, the equals operator is used.

legalInfo.taxRegistrationNumberstringOptional

Legal entity tax registration number. When specified, only legal entities with the specified tax registration number will be returned.

Note: When filtering the results with this field, the equals operator is used.

legalInfo.registrationAgencystringOptional

Legal entity registration agency. When specified, only legal entities containing the specified registration agency will be returned.

Note: When filtering the results with this field, the contains operator is used. The operator is case-insensitive.

legalInfo.countryOfRegistrationstringOptional

Legal entity registration country. When specified, only legal entities containing the specified registration country will be returned.

Note: When filtering the results with this field, the contains operator is used. The operator is case-insensitive.

legalInfo.registrationIdstringOptional

The id of the legal entity registration. When specified, only legal entities with the specified registration ID will be returned.

Note: When filtering the results with this field, the equals operator is used.

Header parameters
X-Total-CountbooleanOptional

In order to get information how many entities meet a filter requirements, X-Total-Count header has been introduced. The header is optional and its default value is false. It the header is provided and it is true then total count is returned in the X-Total-Count response header. In both cases (X-Total-Count true, false or not provided), the response body has the same format (array of entities). In other words, the information about total count is returned on demand, depending of an existence of X-Total-Count header in a request. Therefore, the X-Total-Count header is not returned if an API consumer didn't ask for it.

Default: false
Body
qstringOptional

Query param for filtering entities by specified type.

Responses
200
The request was successful. A list of legal entities is returned.
application/json
400
Request was syntactically incorrect. Details will be provided in the response payload.
application/json
401
Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.
application/json
403
Given authorization scopes are not sufficient and do not match scopes required by the endpoint.
application/json
500
Internal Service Error occurred.
application/json
post
POST /customer-management/{tenant}/legal-entities/search HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 20

{
  "q": "type:COMPANY"
}
[
  {
    "id": "123e06ecf0452c2d6c0b81390",
    "name": "Company name",
    "type": "COMPANY",
    "legalInfo": {
      "legalName": "Some company name",
      "registrationDate": "2022-03-31T13:18:02.379Z",
      "registrationAgency": "Comp reg agency",
      "registrationId": "627e06ecf0452c2d6c0b81391",
      "countryOfRegistration": "DE",
      "taxRegistrationNumber": "1234"
    },
    "metadata": {
      "createdAt": "2022-03-31T13:18:02.379Z",
      "modifiedAt": "2022-03-31T13:18:02.379Z",
      "version": 1
    }
  },
  {
    "id": "123e06ecf0452c2d6c0b12391",
    "name": "Subsidiary name",
    "type": "SUBSIDIARY",
    "parentId": "627e06ecf0452c2d6c0b81391",
    "accountLimit": {
      "currency": "EUR",
      "value": 1000.99
    },
    "legalInfo": {
      "legalName": "Some subsidiary name",
      "registrationDate": "2022-03-31T13:18:02.379Z",
      "taxRegistrationNumber": "4311",
      "registrationAgency": "Sub reg agency",
      "countryOfRegistration": "DE",
      "registrationId": "627e06ecf0452c2d6c0b81399"
    },
    "customerGroups": [
      {
        "id": "123e06ecf0452c2d6c0b81390",
        "name": {
          "en": "Customer group 1",
          "fr": "Groupe de clients 1"
        }
      }
    ],
    "approvalGroup": [
      {
        "id": "321e06ecf0452c2d6c0b81390",
        "type": "BILLING",
        "primary": true,
        "legalEntity": {
          "id": "627e06ecf0452c2d6c0b81391"
        },
        "customer": {
          "id": "123e06ecf0452c2d6c0b81390",
          "name": "Adam",
          "surname": "Smith"
        },
        "metadata": {
          "createdAt": "2022-02-31T13:18:01.379Z",
          "modifiedAt": "2022-02-31T13:18:01.379Z",
          "version": 1
        }
      }
    ],
    "entitiesAddresses": [
      {
        "id": "627e06ecf0452c2d6c0b81391",
        "name": "Main HQ",
        "type": "HEADQUARTER",
        "contactDetails": {
          "emails": [
            "jon.doe@example.com",
            "adam.smith@sample.org"
          ],
          "phones": [
            "1234567890",
            "123456789"
          ],
          "addressLine1": "W Sample St",
          "addressLine2": "3601-3799",
          "city": "South Bend",
          "state": "Indiana",
          "postcode": "46619",
          "countryCode": "US",
          "tags": [
            "shipping"
          ]
        },
        "metadata": {
          "createdAt": "2022-03-31T13:18:02.379Z",
          "modifiedAt": "2022-03-31T13:18:02.379Z",
          "version": 1
        }
      },
      {
        "id": "123e06ecf0acd223140b12345",
        "name": "Main Warehouse",
        "type": "WAREHOUSE",
        "metadata": {
          "createdAt": "2022-03-31T13:22:31.112Z",
          "modifiedAt": "2022-03-31T13:22:31.112Z",
          "version": 1
        }
      }
    ],
    "metadata": {
      "createdAt": "2022-03-31T13:18:02.379Z",
      "modifiedAt": "2022-04-31T13:18:02.379Z",
      "version": 2
    }
  }
]

Upserting a legal entity

put

Updates or creates a legal entity with given legal entity id. You can omit the metadata.version, but then optimistic locking is not enabled.

Important: If automatically generated customer group is not present in customerGroups list, this group will be removed from iam.


Required scopes

  • customermanagement.legalentity_manage

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

The tenant that the caller is acting upon.

Please note that this value is always lowercase.

Pattern: ^[a-z][a-z0-9]+$
legalEntityIdstringRequired

The legal entity unique identifier.

Body
namestringRequired

The name of the legal entity.

typestring · enumRequired

The type of the legal entity.

Possible values:
parentIdstringOptional

The id of the parent legal entity.

Responses
201
The request was successful. The legal entity has been created.
application/json
204
The legal entity has been updated successfully.
400
Request was syntactically incorrect. Details will be provided in the response payload.
application/json
401
Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.
application/json
403
Given authorization scopes are not sufficient and do not match scopes required by the endpoint.
application/json
404
The requested resource does not exist.
application/json
409
Given resource already exists
application/json
500
Internal Service Error occurred.
application/json
put
PUT /customer-management/{tenant}/legal-entities/{legalEntityId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 667

{
  "name": "Subsidiary name",
  "type": "SUBSIDIARY",
  "parentId": "627e06ecf0452c2d6c0b81391",
  "accountLimit": {
    "currency": "EUR",
    "value": 1000.99
  },
  "legalInfo": {
    "legalName": "Some subsidiary name",
    "registrationDate": "2022-03-31T13:18:02.379Z",
    "registrationAgency": "Sub reg agency",
    "registrationId": "627e06ecf0452c2d6c0b81391",
    "countryOfRegistration": "DE",
    "taxRegistrationNumber": "4311"
  },
  "customerGroups": [
    {
      "id": "123e06ecf0452c2d6c0b81390"
    },
    {
      "id": "123e06ecf0452c2d6c0b12345"
    }
  ],
  "entitiesAddresses": [
    {
      "id": "123e123455452c2d6c0b81390"
    },
    {
      "id": "123e06ecf0acd223140b12345"
    }
  ],
  "approvalGroup": [
    {
      "id": "123e121111452c12330b81390"
    },
    {
      "id": "123e061110acd223133333345"
    }
  ],
  "metadata": {
    "version": 1
  }
}
{
  "id": "53ac81fd0cce8b26b36f3492"
}