Sequential IDs management

Deprecated

Retrieving all schemas

get

Gets all sequence schemas.

This endpoint is deprecated. Please use the /sequential-id/{tenant}/schemas instead.


Required scopes

  • sequentialid.schema_view

Authorizations
Responses
200Success
application/json
Responseall of[]
and
get
GET /sequential-id/sequenceSchemas HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
  {
    "id": "sequentialId",
    "name": "order_number",
    "schemaType": "orderNoSequence",
    "active": true,
    "preText": "C-",
    "postText": "-A",
    "startValue": 100,
    "maxValue": 999999999,
    "numberOfDigits": 9,
    "counter": 109,
    "placeholders": {
      "__year__": {
        "required": true
      }
    }
  }
]
Deprecated

Creating a schema

post

Creates a new sequence schema.

This endpoint is deprecated. Please use the /sequential-id/{tenant}/schemas instead.


Required scopes

  • sequentialid.schema_manage

Authorizations
Body
namestringRequired

The name of the sequence schema.

schemaTypestringOptional

The schema type corresponding to the entity it is used for. Possible values are:

  • orderNoSequence
  • invoiceNoSequence
  • quoteNoSequence
  • pickPackNoSequence
  • orderHoldingAreaNoSequence
Pattern: ^[a-zA-Z0-9]*$
preTextstringOptional

The prefix of the ID. It can contain placeholders, which are replaced with their values. Placeholders are defined in the placeholders property.

postTextstringOptional

The suffix of the ID. It can contain placeholders, which are replaced with their values. Placeholders are defined in the placeholders property.

startValuenumberRequired

The starting value of the sequence. It is used to generate the first ID. The starting value is incremented for each subsequent ID.

maxValuenumberRequired

The maximum value of the sequence. It is used to limit the range of generated IDs. If the maximum value is reached, the sequence will not generate any more IDs.

numberOfDigitsnumberRequired

The number of digits in the generated ID. It is used to format the ID. If the number of digits is less than the maximum value, leading zeros are added.

Responses
201Success
application/json
Responsestring
post
POST /sequential-id/sequenceSchemas HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 187

{
  "name": "invoiceNoSequence",
  "schemaType": "invoiceNoSequence",
  "preText": "INV__num__",
  "maxValue": 999999999,
  "numberOfDigits": 4,
  "startValue": 1000,
  "placeholders": {
    "__num__": {
      "required": true
    }
  }
}
text
Deprecated

Creating a nextId

post

Creates and returns the nextId in the sequence. If you specify the sequenceKey parameter in request body, the nextId number is generated for this sequence, otherwise default pool is used.

This endpoint is deprecated. Please use the /sequential-id/{tenant}/schemas/types/{schemaType}/nextId instead.

Authorizations
Path parameters
sequenceSchemastringRequired

The sequence schema to generate the nextId for.

Query parameters
siteCodestringOptional

Value used to resolve certain placeholders.

Placeholders such as __year__, __month__, __day__, __hour__, __minute__, __second__, and __country__, which are defined in the schema, can have default values computed when their counterparts are missing in the request body.

The default values are derived from the site. Specifically:

  • All date-related placeholders are computed based on the site.homeBase.timezone field.
  • The country placeholder is replaced with the value of site.homeBase.address.country.

If these values are missing in site, the following defaults are used:

  • UTC for timezone
  • DE for country
Body
numberOfIdsnumber · min: 1Optional

The number of IDs to create sequentially in one request.

sequenceKeystringOptional

The pattern to follow for the nextID.

placeholdersanyOptional

The filler text for values based on certain properties or settings in the system.

Responses
201Success
application/json
post
POST /sequential-id/sequenceSchemas/{sequenceSchema}/nextIds HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 93

{
  "numberOfIds": 3,
  "sequenceKey": "2016-05",
  "placeholders": {
    "__year__": "2016",
    "__month__": "05"
  }
}
{
  "ids": [
    "C-2016-06-0000000045-D",
    "asfasf2323"
  ]
}

Retrieving all schemas

get

Gets all sequence schemas.


Required scopes

  • sequentialid.schema_view

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

The name of your tenant.

Note: The tenant name should always be provided in lowercase.

Pattern: [a-zA-Z0-9_-]+
Responses
200Success
application/json
Responseall of[]
and
get
GET /sequential-id/{tenant}/schemas HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
  {
    "name": "testSchema",
    "schemaType": "orderNoSequence",
    "active": true,
    "preText": "C-__year__-__month__-",
    "postText": "-D",
    "startValue": 1,
    "maxValue": 999999999,
    "numberOfDigits": 9,
    "counter": 45684,
    "placeholders": {
      "__year__": {
        "required": true
      },
      "__month__": {
        "required": true
      }
    }
  },
  {
    "name": "customer_number",
    "startValue": 1,
    "schemaType": "orderNoSequence",
    "preText": "C-",
    "minValue": 100,
    "maxValue": 999999999,
    "numberOfDigits": 9,
    "counter": 109
  }
]

Creating a schema

post

Creates a new sequence schema.


Required scopes

  • sequentialid.schema_manage

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

The name of your tenant.

Note: The tenant name should always be provided in lowercase.

Pattern: [a-zA-Z0-9_-]+
Body
namestringRequired

The name of the sequence schema.

schemaTypestringOptional

The schema type corresponding to the entity it is used for. Possible values are:

  • orderNoSequence
  • invoiceNoSequence
  • quoteNoSequence
  • pickPackNoSequence
  • orderHoldingAreaNoSequence
Pattern: ^[a-zA-Z0-9]*$
preTextstringOptional

The prefix of the ID. It can contain placeholders, which are replaced with their values. Placeholders are defined in the placeholders property.

postTextstringOptional

The suffix of the ID. It can contain placeholders, which are replaced with their values. Placeholders are defined in the placeholders property.

startValuenumberRequired

The starting value of the sequence. It is used to generate the first ID. The starting value is incremented for each subsequent ID.

maxValuenumberRequired

The maximum value of the sequence. It is used to limit the range of generated IDs. If the maximum value is reached, the sequence will not generate any more IDs.

numberOfDigitsnumberRequired

The number of digits in the generated ID. It is used to format the ID. If the number of digits is less than the maximum value, leading zeros are added.

Responses
201Success
application/json
Responsestring
post
POST /sequential-id/{tenant}/schemas HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 233

{
  "name": "testSchema",
  "schemaType": "orderNoSequence",
  "preText": "C-__year__-__month__-",
  "postText": "-D",
  "maxValue": 999999999,
  "numberOfDigits": 9,
  "startValue": 3,
  "placeholders": {
    "__year__": {
      "required": true
    },
    "__month__": {
      "required": true
    }
  }
}
text

Retrieving a schema

get

Gets a sequence schema by its id.


Required scopes

  • sequentialid.schema_view

Authorizations
Path parameters
schemaIdstringRequired

The ID of the schema to retrieve.

tenantstring · min: 3 · max: 16Required

The name of your tenant.

Note: The tenant name should always be provided in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Responses
200Success
application/json
Responseall of
and
get
GET /sequential-id/{tenant}/schemas/{schemaId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "name": "testSchema",
  "schemaType": "orderNoSequence",
  "active": true,
  "preText": "C-__year__-__month__-",
  "postText": "-D",
  "startValue": 1,
  "maxValue": 999999999,
  "numberOfDigits": 9,
  "counter": 45684,
  "placeholders": {
    "__year__": {
      "required": true
    },
    "__month__": {
      "required": true
    }
  }
}

Activating a schema

post

Sets the schema as active in the system.


Required scopes

  • sequentialid.schema_manage

Authorizations
Path parameters
schemaIdstringRequired

The ID of the schema to activate.

tenantstring · min: 3 · max: 16Required

The name of your tenant.

Note: The tenant name should always be provided in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Responses
200
Schema set to active
post
POST /sequential-id/{tenant}/schemas/{schemaId}/setActive HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*

No content

Retrieving all schema types

get

Gets all sequence schemas.


Required scopes

  • sequentialid.schema_view

Authorizations
Path parameters
schemaTypestringRequired

The schema type corresponding to the entity it is used for. Possible values are:

  • orderNoSequence
  • invoiceNoSequence
  • quoteNoSequence
  • pickPackNoSequence
  • orderHoldingAreaNoSequence
tenantstring · min: 3 · max: 16Required

The name of your tenant.

Note: The tenant name should always be provided in lowercase.

Pattern: [a-zA-Z0-9_-]+
Responses
200Success
application/json
Responseall of[]
and
get
GET /sequential-id/{tenant}/schemas/types/{schemaType} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
  {
    "name": "testSchema",
    "schemaType": "orderNoSequence",
    "active": true,
    "preText": "C-__year__-__month__-",
    "postText": "-D",
    "startValue": 1,
    "maxValue": 999999999,
    "numberOfDigits": 9,
    "counter": 45684,
    "placeholders": {
      "__year__": {
        "required": true
      },
      "__month__": {
        "required": true
      }
    }
  },
  {
    "name": "customer_number",
    "startValue": 1,
    "schemaType": "orderNoSequence",
    "preText": "C-",
    "minValue": 100,
    "maxValue": 999999999,
    "numberOfDigits": 9,
    "counter": 109
  }
]

Creating a nextId for schema type

post

Creates and returns the nextId according to the specified sequence. If you specify the sequenceKey in request body, the nextId number is generated for this sequence, otherwise default pool is used.


Required scopes

  • sequentialid.schema_view

Authorizations
Path parameters
schemaTypestringRequired

The schema type corresponding to the entity it is used for. Possible values are:

  • orderNoSequence
  • invoiceNoSequence
  • quoteNoSequence
  • pickPackNoSequence
  • orderHoldingAreaNoSequence
tenantstring · min: 3 · max: 16Required

The name of your tenant.

Note: The tenant name should always be provided in lowercase.

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

Value used to resolve certain placeholders.

Placeholders such as __year__, __month__, __day__, __hour__, __minute__, __second__, and __country__, which are defined in the schema, can have default values computed when their counterparts are missing in the request body.

The default values are derived from the site. Specifically:

  • All date-related placeholders are computed based on the site.homeBase.timezone field.
  • The country placeholder is replaced with the value of site.homeBase.address.country.

If these values are missing in site, the following defaults are used:

  • UTC for timezone
  • DE for country
Body
sequenceKeystringOptional

The pattern to follow for the nextID.

placeholdersanyOptional

The filler text for values based on certain properties or settings in the system.

Responses
201Success
application/json
post
POST /sequential-id/{tenant}/schemas/types/{schemaType}/nextId HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 77

{
  "sequenceKey": "2016-05",
  "placeholders": {
    "__year__": "2016",
    "__month__": "05"
  }
}
{
  "id": "B7012562"
}

Creating nextIds for schema types

post

Creates and returns the nextId for the specified sequence schemas. If you specify the sequenceKey in request body, the nextId number is generated for this sequence, otherwise default pool is used.


Required scopes

  • sequentialid.schema_view

Authorizations
Query parameters
siteCodestringOptional

Value used to resolve certain placeholders.

Placeholders such as __year__, __month__, __day__, __hour__, __minute__, __second__, and __country__, which are defined in the schema, can have default values computed when their counterparts are missing in the request body.

The default values are derived from the site. Specifically:

  • All date-related placeholders are computed based on the site.homeBase.timezone field.
  • The country placeholder is replaced with the value of site.homeBase.address.country.

If these values are missing in site, the following defaults are used:

  • UTC for timezone
  • DE for country
Body
Responses
201Success
application/json
post
POST /sequential-id/sequenceSchemaBatch/nextIds HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 159

{
  "testSchema": {
    "sequenceKey": "2016-05",
    "placeholders": {
      "__year__": "2016",
      "__month__": "05"
    }
  },
  "testSchema2": {
    "numberOfIds": 2,
    "placeholders": {
      "--prefix--": "C-"
    }
  }
}
{
  "testSchema": {
    "ids": [
      "C-2016-05-0000000045-D",
      "C-2016-05-0000000045-D"
    ]
  }
}

Was this helpful?