[All schemas](/reference/schemas/) · [API reference](/reference/) · [Data mapping guide](/guides/data-model/)

## Fields

| Field | Required | Type / allowed values |
| --- | --- | --- |
| `invoice` | Yes | object or null |
| `patients` | Yes | array |
| `availableResolutions` | Yes | array |
| `canCreateCreditNote` | Yes | boolean |
| `validationMessage` | Yes | string or null |

## JSON definition

The JSON retains the source contract descriptions. Do not translate property names or enum values.

```json
{
  "type": "object",
  "properties": {
    "invoice": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "invoiceNumber": {
          "type": [
            "string",
            "null"
          ]
        },
        "cufe": {
          "type": [
            "string",
            "null"
          ]
        },
        "issueDate": {
          "type": "string",
          "description": "Fecha y hora ISO 8601 (UTC).",
          "example": "2026-10-15T12:00:00.000Z"
        },
        "totalAmount": {
          "type": "number"
        },
        "creditedAmount": {
          "type": "number"
        },
        "availableAmount": {
          "type": "number"
        },
        "clientName": {
          "type": "string"
        },
        "clientId": {
          "type": "string"
        },
        "locationId": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "invoiceNumber",
        "cufe",
        "issueDate",
        "totalAmount",
        "creditedAmount",
        "availableAmount",
        "clientName",
        "clientId",
        "locationId"
      ]
    },
    "patients": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "consecutivo": {
            "type": "number"
          },
          "tipoDocumentoIdentificacion": {
            "type": "string"
          },
          "numDocumentoIdentificacion": {
            "type": "string"
          },
          "patientName": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalAmount": {
            "type": "number"
          },
          "services": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "category": {
                  "type": "string"
                },
                "consecutivo": {
                  "type": "number"
                },
                "description": {
                  "type": "string"
                },
                "amount": {
                  "type": "number"
                },
                "serviceDate": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "category",
                "consecutivo",
                "description",
                "amount",
                "serviceDate"
              ]
            }
          }
        },
        "required": [
          "consecutivo",
          "tipoDocumentoIdentificacion",
          "numDocumentoIdentificacion",
          "patientName",
          "totalAmount",
          "services"
        ]
      }
    },
    "availableResolutions": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Resolution"
      }
    },
    "canCreateCreditNote": {
      "type": "boolean"
    },
    "validationMessage": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "invoice",
    "patients",
    "availableResolutions",
    "canCreateCreditNote",
    "validationMessage"
  ]
}
```
