Ir al contenido

Register an e-NCF range authorized in the OFV

POST
/companies/{companyId}/ncf-ranges
curl --request POST \
--url https://acme.gravitastec.com/api/v1/companies/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/ncf-ranges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: example' \
--data '{ "environment": "testecf", "ecfType": 31, "from": 1, "to": 1, "expiresOn": "2026-04-15", "lowThreshold": 100 }'

Registers a range in an environment of the credential’s class: ecf for a production credential, testecf or certecf for a test credential. Without environment, a production credential uses ecf and a test credential the environment its documents are issued in (testecf while the company is in the test stage, certecf afterwards). Registering the same range again returns it unchanged. Documents waiting for a number are not numbered automatically.

companyId
required
string format: uuid
Idempotency-Key
required
string
<= 64 characters
Media typeapplication/json
object
environment

Optional; must belong to the credential class

string
Allowed values: testecf certecf ecf
ecfType
required
integer
Allowed values: 31 32 33 34 41 43 44 45 46 47
from
required
integer
>= 1 <= 9999999999
to
required
integer
>= 1 <= 9999999999
expiresOn

Required except for types 32 and 34, where it must be omitted

string | null format: date
lowThreshold
integer
default: 100

Registered

Media typeapplication/json
object
id
required
string format: uuid
environment
required
string
Allowed values: testecf certecf ecf
ecfType
required
integer
from
required
integer
to
required
integer
expiresOn
string | null format: date
lowThreshold
required
integer
nextNumber
required
integer
remaining
required
integer
status
required
string
Allowed values: active exhausted expired annulled inactive

Example

{
"environment": "testecf",
"status": "active"
}

Not found or outside the credential scope

Media typeapplication/problem+json
object
type
string
title
string
status
integer
code
string
errors
Array<object>
object
path
string
message
string
code

Stable snake_case rule code when the rule has one (e.g. modified_same_type, foreign_id_in_rnc, emitter_rnc_mismatch, encf_invalid, encf_type_mismatch, encf_not_in_range, encf_already_used, sequence_expiry_mismatch).

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"code": "example",
"errors": [
{
"path": "example",
"message": "example",
"code": "example"
}
]
}

Overlaps an existing range (code range_overlap)

All validation errors with field paths; the document is not numbered

Media typeapplication/problem+json
object
type
string
title
string
status
integer
code
string
errors
Array<object>
object
path
string
message
string
code

Stable snake_case rule code when the rule has one (e.g. modified_same_type, foreign_id_in_rnc, emitter_rnc_mismatch, encf_invalid, encf_type_mismatch, encf_not_in_range, encf_already_used, sequence_expiry_mismatch).

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"code": "example",
"errors": [
{
"path": "example",
"message": "example",
"code": "example"
}
]
}