Customer Import

Preview an import of customers from CSV

Parses a CSV of customers and returns every row with its validation outcome, the rejected ones included.

  • Deprecated: use POST /v1/companies/{company_id}/customers/imports/preview, which parses and validates the file without writing anything — what this route does by default. To actually import, use POST /v1/companies/{company_id}/customers/imports, where the origin of the file travels in the body as source and a boolean no longer decides between looking and writing.
  • File: must use the headers of the template served by GET /v1/templates/customer-import, and is limited to 5 MB and 1,000 rows. A file over either limit is rejected as a whole with 400 (CSV_FILE_TOO_LARGE or TOO_MANY_RECORDS) and nothing is imported.
  • Validation: each row is checked against the same rules as single-customer creation, plus duplicate detection within the file and against existing customers, and a NIF lookup in the AEAT register.
  • dry_run: at its default true nothing is persisted; false also persists the valid customers.

Retires on 9 December 2026. See the migration guide for what moved where and what changes when you switch.

post/v1/customers/import-csv-preview

Request

  • Base URL: https://app.beel.es/api
  • URL: https://app.beel.es/api/v1/customers/import-csv-preview
  • Auth: HTTP bearer

Response

CSV processing completed with structured preview using unified format

successboolean required

Example response

{
  "success": true,
  "data": {
    "metadata": {
      "total_customers": 10,
      "is_dry_run": true,
      "processing_time_ms": 450,
      "source_type": "CSV_IMPORT",
      "filename": "clientes_enero.csv",
      "file_size_bytes": 1048576,
      "total_rows": 250
    },
    "customers_validation": [
      {
        "customer": {
          "legal_name": "Empresa Cliente SL",
          "trade_name": "EmpresaCliente",
          "nif": "12345678A",
          "address": {
            "street": "Calle Mayor, 123",
            "number": "123",
            "floor": "2º A",
            "door": "A",
            "postal_code": "28001",
            "city": "Madrid",
            "province": "Madrid",
            "country": "España",
            "country_code": "ES"
          },
          "phone": "+34 612 345 678",
          "billing_emails": [
            "user@example.com"
          ],
          "contact_person": "María García",
          "preferred_payment_method": {
            "method": "BANK_TRANSFER",
            "iban": "ES1234567890123456789012",
            "swift": "ABCDESMMXXX",
            "payment_term_days": 30
          }
        },
        "customer_id": "550e8400-e29b-41d4-a716-446655440000",
        "status": "VALID",
        "errors": [
          {
            "field": "nif",
            "value": "12345678X",
            "message": "NIF not found in AEAT census",
            "code": "CUSTOMER_IDENTIFIER_REQUIRED"
          }
        ],
        "warnings": [
          {
            "field": "email",
            "message": "Email not provided, NIF will be used for invoicing"
          }
        ],
        "row_number": 15
      }
    ],
    "statistics": {
      "total_processed": 10,
      "valid": 6,
      "with_warnings": 2,
      "with_errors": 2,
      "duplicates": 1,
      "invalid_nifs": 1,
      "imported": 8,
      "success_rate": 0.8,
      "importable": 8,
      "not_importable": 2
    }
  },
  "meta": {
    "timestamp": "2025-01-15T10:30:00Z",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.