Skip to content

Accept, partially accept or reject a received document

POST
/v1/documents/received/{id}/acceptance
curl --request POST \
--url https://api.emite.cr/v1/documents/received/example/acceptance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "mensaje": 1, "detalleMensaje": "example", "condicionImpuesto": "01", "montoTotalImpuestoAcreditar": 1, "montoTotalDeGastoAplicable": 1, "codigoActividad": "6201.0" }'

The company's answer to a supplier's document: mensaje 1 accepts it (message type 05), 2 accepts it partially (06) and 3 rejects it (07, with a detalleMensaje). The message gets its own receptor consecutive number, is signed with the company's certificate and sent to Hacienda; the document's acceptanceStatus changes at once, and goes back to none if Hacienda rejects the message. Hacienda's verdict arrives later, in the status of the message on the document. 400 ACCEPTANCE_NOT_ALLOWED_FOR_DOCTYPE for a ticket (04); 409 ACCEPTANCE_IN_PROGRESS or RECEIVED_DOCUMENT_ALREADY_RESPONDED while a message is in progress or once one was accepted. In production, the company needs a plan in good standing (402 SUBSCRIPTION_INACTIVE). When Hacienda does not answer, the message is kept signed with its number and sent automatically later: 502 ACCEPTANCE_PENDING_DELIVERY — do not send another. Not available in a demo (400 ACCEPTANCE_NOT_AVAILABLE_IN_DEMO).

id
required
string
Media typeapplication/json
object
mensaje
required

The company's response, the <Mensaje> code of the MensajeReceptor: 1 — accept (message type 05); 2 — accept partially (06); 3 — reject (07).

number
Allowed values: 1 2 3
detalleMensaje

The reason (DetalleMensaje), up to 160 characters. The API requires it to reject; Hacienda's Anexo asks for it, 5 to 160 characters, for a rejection and for a partial acceptance too.

string
<= 160 characters
condicionImpuesto

How the company will use the IVA of the document (CondicionImpuesto, Anexo note 18):

  • 01 — it generates IVA credit.
  • 02 — it generates partial IVA credit.
  • 03 — capital goods.
  • 04 — current expense, no credit.
  • 05 — proportionality.

Omitted, the message carries none.

string
Allowed values: 01 02 03 04 05
montoTotalImpuestoAcreditar

The IVA the company will take as credit (MontoTotalImpuestoAcreditar), up to 5 decimals. Per the Anexo, for when not all the tax paid is creditable; not needed with condicionImpuesto 05 nor in a rejection.

number
montoTotalDeGastoAplicable

The amount the company will apply as an expense (MontoTotalDeGastoAplicable), up to 5 decimals. Per the Anexo, for when the total is not entirely an expense, or part of the IVA paid becomes one; not needed with condicionImpuesto 05 nor in a rejection.

number
codigoActividad

The company's activity to which it applies the IVA credit (CodigoActividad), one of its activities in EmiteCR, in dotted form. Omitted: the one the supplier declared for the company in the document, when the company has it; otherwise the company's default (defaultAcceptanceActivityCode of the document). Never sent with condicionImpuesto 05, where the Anexo says the field must not be used; a value is ignored then.

string
Example
6201.0
Media typeapplication/json
object
acceptanceId
required

Id of the message, as it appears in acceptances of the document.

string format: uuid
acceptanceStatus
required

The document's acceptanceStatus now, set from the message sent. It goes back to none if Hacienda rejects the message.

string
Allowed values: accepted partial rejected
indEstado
required

Hacienda's answer to the submission, normally recibido; the verdict on the message arrives later, in its status on the document.

string
Allowed values: recibido procesando aceptado rechazado error
Example
{
"acceptanceStatus": "accepted",
"indEstado": "recibido"
}