Ir al contenido

Search issued documents

GET
/companies/{companyId}/documents
curl --request GET \
--url 'https://acme.gravitastec.com/api/v1/companies/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/documents?dateField=issue&environment=testecf&ecfType=31&commercialStatus=pending&deliveryStatus=pending&limit=50' \
--header 'Authorization: Bearer <token>'

Issued documents of the company, newest first (by the date Gravitas received them), limited to the environments of the credential. All filters are optional and combine with AND. Page with cursor (the nextCursor of the previous page) and limit.

companyId
required
string format: uuid
from
string format: date

Start date, inclusive (see dateField)

to
string format: date

End date, inclusive (see dateField)

dateField
string
default: issue
Allowed values: issue received

Date compared with from/to: issue (FechaEmision, default) or received (when Gravitas received it, Santo Domingo time)

environment
string
Allowed values: testecf certecf ecf

One environment; must be among the credential environments, otherwise the page is empty

ecfType
integer
Allowed values: 31 32 33 34 41 43 44 45 46 47
encf
string
/^E\d{12}$/

Exact e-NCF

buyerRnc
string

Exact RNC or cédula of the buyer

q
string
>= 2 characters <= 100 characters

Free text: e-NCF prefix, buyer RNC/cédula or foreign id prefix, or part of the buyer name

status
string

Document status (see DocumentStatus.status); validated without e-NCF means waiting for numbering

commercialStatus
string
Allowed values: pending accepted rejected

Buyer commercial approval (ACECF)

deliveryStatus
string
Allowed values: pending delivered not_received failed not_applicable

Delivery to the electronic receiver

currency
string
>= 3 characters <= 3 characters

ISO 4217 code (DOP, USD, EUR…)

minTotal
number

MontoTotal at least

maxTotal
number

MontoTotal at most

cursor
string
limit
integer
default: 50 >= 1 <= 200

Page of documents

Media typeapplication/json
object
items
Array<object>
object
documentId
string format: uuid
companyId
string format: uuid
environment
string
Allowed values: testecf certecf ecf
ecfType
integer
status
string
encf
string | null
trackId
string | null
securityCode
string | null
dgiiMessages

DGII messages with explanation/field/correction added for known rejections

Array<object>
object
codigo
string | null
valor
string | null
explanation

What the rejection means (Spanish; only when the message is known)

string
field

Path of the document input to correct

string | null
correction

How to fix it (Spanish)

string
createdAt
string format: date-time
finalizedAt
string | null format: date-time
delivery

Delivery to the buyer (R8); absent until the document is accepted

object
channel
string
Allowed values: electronic email none
status
string
Allowed values: pending delivered not_received failed not_applicable
reason
string | null
deliveredAt
string | null format: date-time
links
object
xml
string
printed
string
exchanges
string
nextCursor
string | null

Example

{
"items": [
{
"environment": "testecf",
"delivery": {
"channel": "electronic",
"status": "pending"
}
}
]
}

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"
}
]
}

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"
}
]
}