Skip to content

List received (supplier) documents — the compras inbox

GET
/v1/documents/received
curl --request GET \
--url 'https://api.emite.cr/v1/documents/received?urgency=ok&from=2026-01-01&to=2026-12-31&sort=fechaEmision&order=asc&page=1&pageSize=25&q=ferreteria%20roble' \
--header 'Authorization: Bearer <token>'

Paginated (items, total, page, pageSize, like GET /v1/invoices). Each row carries the derived acceptance deadline (dueAt, MH-DGT-RES-0027-2024, art. 10) and its urgency while pending. Filters are additive: q, acceptanceStatus (repeatable; pendingOnly is an alias of none), urgency (implies pending), docType (repeatable), from/to on fechaEmision (a bare date is a Costa Rica calendar day). Sort by fechaEmision (default), total or supplier; without order, the pending view (pendingOnly, urgency or acceptanceStatus=none alone) lists the nearest deadline first and every other view the newest first.

urgency
string
Allowed values: ok due_soon due_today overdue

Filter by how close the acceptance deadline is (MH-DGT-RES-0027-2024, art. 10: by default the 8th business day of the month after emission): overdue — past it; due_today — today is the last day; due_soon — it ends within the next 3 days; ok — later. Only a pending document has an urgency, so this filter implies acceptanceStatus=none. Resolved in SQL as a range of emission months (the deadline depends only on the month), so it paginates like any other filter.

pendingOnly
boolean

Send true to list only the documents the company has not answered (acceptanceStatus = none); omit it otherwise. An alias of acceptanceStatus=none, kept for compatibility.

answerable
boolean

Send true to list only the documents the company can still answer: not answered yet (acceptanceStatus = none) and within their deadline, or without a fechaEmision. Past the deadline a document is presumed fully accepted (MH-DGT-RES-0027-2024, art. 10) and no answer is admitted; those are urgency=overdue. Implies acceptanceStatus=none, and lists the nearest deadline first like the rest of the pending view.

acceptanceStatus
Array<string>
Allowed values: none accepted partial rejected

Filter by the company's response: none — not answered yet; accepted; partial — partially accepted; rejected. It is set when the company sends its message (or one is imported) and goes back to none if Hacienda rejects that message. Repeat the parameter for several values (?acceptanceStatus=accepted&acceptanceStatus=partial).

docType
Array<string>
Allowed values: 01 02 03 04 05 06 07 08 09 10

Filter by the Hacienda document type (TipoDocumento) of the received document; repeat the parameter for several: 01 factura electrónica (invoice), 02 nota de débito (debit note), 03 nota de crédito (credit note), 04 tiquete electrónico (ticket), 08 factura electrónica de compra (purchase invoice), 09 factura electrónica de exportación (export invoice), 10 recibo electrónico de pago (payment receipt); 05 to 07 are acceptance messages.

from
string
Example
2026-01-01

Lower bound of fechaEmision, inclusive. A bare YYYY-MM-DD is a Costa Rica calendar day (from CR midnight); a full ISO 8601 instant is used as given.

to
string
Example
2026-12-31

Upper bound of fechaEmision. A bare YYYY-MM-DD covers that whole Costa Rica calendar day; a full ISO 8601 instant is an inclusive cut at that instant.

sort
string
default: fechaEmision
Allowed values: fechaEmision total supplier

Sort key: fechaEmision (the default; since the deadline depends only on the emission month, it also orders by deadline), total (the document total, compared as a number whatever its currency) or supplier (the supplier's name, case-insensitive).

order
string
Allowed values: asc desc

Sort direction. Without it, the pending view (pendingOnly, urgency, or acceptanceStatus=none alone) is ascending — nearest deadline first — and every other view descending — newest first. Documents without a value go last either way.

page
number
Example
1

1-based page number. Default 1.

pageSize
number
Example
25

Rows per page. Default 25; a value over 100 is capped to it.

q
string
<= 120 characters
Example
ferreteria roble

Free-text search over the supplier name, the clave and the consecutivo. Interpreted by SHAPE, exactly like GET /v1/search: a 50-digit string is an exact clave, other digit runs match a fragment of clave/consecutivo, and text matches the supplier accent-insensitively and per word, in any order. Terms under 3 characters match nothing (below the trigram index floor).

Media typeapplication/json
object
items
required

The documents of this page.

Array<object>
object
id
required

Id of the received document.

string format: uuid
clave
required

The 50-digit Hacienda clave of the document.

string
docType
required

Hacienda document type (TipoDocumento): 01 factura electrónica (invoice), 02 nota de débito (debit note), 03 nota de crédito (credit note), 04 tiquete electrónico (ticket), 08 factura electrónica de compra (purchase invoice), 09 factura electrónica de exportación (export invoice), 10 recibo electrónico de pago (payment receipt).

string
supplierName
required

The supplier's name, as in the XML; null when it has none.

string
nullable
currency
required

ISO 4217 currency of the document.

string
fechaEmision
required

The document's FechaEmision; null when the XML has none.

string format: date-time
nullable
haciendaStatus
required

Hacienda's verdict on the supplier's document, read from its MensajeHacienda when that XML was imported too: accepted, partial, rejected, or unknown for an unrecognized code. Null when it was not imported.

string
nullable
Allowed values: accepted partial rejected unknown
acceptanceStatus
required

The company's response to the document: none — not answered yet; accepted; partial — partially accepted; rejected. It is set when the company sends its message (or one is imported) and goes back to none if Hacienda rejects that message.

string
Allowed values: none accepted partial rejected
totalComprobante
required

Document total (TotalComprobante), in the document currency; null when missing.

number
nullable
dueAt
required

End of the window to accept or reject the document (MH-DGT-RES-0027-2024, art. 10: by default the 8th business day of the month after emission), derived from fechaEmision and present whatever the acceptanceStatus; null without a fechaEmision.

string format: date-time
nullable
urgency
required

How close dueAt is, only while the document is pending (acceptanceStatus: none): overdue — past it; due_today — today is the last day; due_soon — it ends within the next 3 days; ok — later. Null once answered, or without a dueAt.

string
nullable
Allowed values: ok due_soon due_today overdue
total
required

Documents that match the filters, across all pages.

number
page
required

The page returned, from 1.

number
pageSize
required

Rows per page applied (the request value, capped at 100).

number
Example
{
"items": [
{
"docType": "01",
"currency": "CRC",
"haciendaStatus": "accepted",
"acceptanceStatus": "none",
"urgency": "ok"
}
]
}