Estado y códigos de error
Nuestra API se diferencia de RESTFUL ya que no se realiza de implementacion de todas las restricciones que componen la arquitectura REST.
Tambien cuenta con un manejo avanzado e inteligente de errores en donde de manera detallada informa los errores en una petición. Se recomienda el uso de las advertencias (warnings) y notificaciones (notifications) en el retorno de la respuesta.
Ejemplo de un llamado con retorno de errors, warnings y notifications:
query {
testQuery(
# Datos de la consulta
document: {
id: {
...
...
}
...
}
) {
# Retorno de la respuesta
document {
id
...
}
errors {
helpText
id
language
message
subType
title
type
}
warnings {
helpText
id
language
message
subType
title
type
}
notifications {
helpText
id
language
message
subType
title
type
}
}
}
Informa de manera clara y descriptiva la diferencia numérica de la suma de los impuestos de cada línea en caso de ser diferente con la del total de factura, entre otros.
Ejemplo de un error:
{
"data": {
"createInvoice": {
"warnings": null,
"notifications": null,
"errors": [
{
"type": "Line validation",
"title": "Line error",
"subType": "Line extension Amount",
"message": "When operating (5500 - 0) + 0 = 5500, it is not consistent with the entered value 55000.",
"language": "EN_US",
"id": "001-LA2",
"helpText": "createInvoice/document/documentLines/LineId(1): Error presented in lineExtensionAmount"
},
{
"type": "Totals validation",
"title": "Total error",
"subType": "lineExtensionAmount",
"message": "When we compare documentTotals/lineExtensionAmount(55000) with the sum of line extension amounts(5500) on the lines it does not match.",
"language": "EN_US",
"id": "001-DT3",
"helpText": "Totals: Error presented when comparing the total results and the sum of the lines."
},
{
"type": "Totals validation",
"title": "Total error",
"subType": "taxInclusiveAmount",
"message": "When we compare documentTotals/taxInclusiveAmount(55000) with the sum of tax amount(5500.000) on the lines it does not match.",
"language": "EN_US",
"id": "001-DT5",
"helpText": "Totals: Error presented when comparing the total results and the sum of the lines."
}
],
"document": null
}
}
}
Created:
(Updated:
)