Errors & Validation

Understand error responses and validation rules.


What the response means

An upload goes through two stages, and only the first one answers in the same call:

  1. File validation (immediate). Fibek checks the file row by row. If anything fails, it responds success: false with the per-row detail and nothing is processed.
  2. Processing (asynchronous). If the file passes validation it is queued and processed later. Whatever happens there — rows dropped because the customer or the invoice does not exist, deduplications, or a failure of the whole file — does not appear in the response.

In other words: success: true means “the file was accepted and queued”, not “all the data was loaded”. Each entity page states what gets dropped in the second stage.

Response Format

All endpoints return the same response structure.

Success Response

HTTP code 201.

{
  "success": true,
  "warnings": {
    "customers": ["File does not have .csv extension"]
  }
}

warnings is optional and does not block the upload: it flags things like an extension other than .csv, a content type other than text/csv, a file with a header and no rows, an unknown document_type, or an open CASH invoice with an outstanding balance.

Validation Error Response

This also arrives with code 201: the result is read from success.

{
  "success": false,
  "errors": {
    "customers": [
      {
        "rowIndex": 2,
        "messages": [
          "Field \"nit\" is required.",
          "Field \"email\" must have a valid email format."
        ]
      }
    ]
  }
}

rowIndex counts the file’s lines including the header, so the first data row is 2. A rowIndex of 0 means an error for the whole file rather than for a row.

HTTP Status Codes

CodeNameDescriptionAction
201CreatedRequest processed — the result is in the success fieldCheck success and, if present, errors
400Bad RequestThe file is missing from the formSend the file in the correct field (for example customersFile)
401UnauthorizedAPI Key invalid, revoked or absentCheck the API Key or create a new one
403ForbiddenThe API Key is not allowed to upload integrationsUse an API Key created in API Integration
404Not FoundThe endpoint URL does not existCheck the path and the base URL
500Internal Server ErrorUnexpected errorRetry later

Common Validation Rules

RuleDescription
Required fieldsThe field must be present and cannot be empty
Column namesExact and lowercase; spaces around the name are ignored, but no other variants are accepted
Email formatValid email structure
Date formatYYYY-MM-DD; other formats are rejected. An empty cell is accepted except where stated otherwise
NumbersDot as the decimal separator and no thousands separator (1000000.00, not 1.000.000,00)
Boolean valuesOnly 1 or 0
EncodingUTF-8

IDs without leading zeros. When the file is processed, an id made up of digits only is read as a number: 00123 becomes 123. If the same customer or invoice is written differently in two files, the rows will not match each other and are dropped with no notice. Use ids without leading zeros, or with some non-numeric character.