Customers

Replace a customer

Replaces an existing customer with the body you send.

  • Not a partial update: trade_name, email, website, billing_emails, contact_person, notes and general_discount are cleared when they are absent from the body, so send the customer complete. To change only some fields, use PATCH /v1/companies/{company_id}/customers/{customer_id}.
  • AEAT census: the customer's Spanish tax identifier is only checked against the AEAT census when the body changes the nif or the legal_name of the stored customer. Resending the same pair never asks the census, so a customer stored long ago stays editable even if its NIF is no longer listed. For a legal entity the census checks the CIF only and its legal_name is not verified, so the name never causes the rejection; only a natural person's NIF is crossed with the name. Duplicate and format checks run on every update.
  • Deprecated: this route will be retired on the date announced in its Sunset response header. The canonical form has a single update verb, PATCH /v1/companies/{company_id}/customers/{customer_id}, which is not a drop-in replacement for this one: it changes only the fields present in the body. To reproduce a total replacement, send every field and pass null in the ones you want cleared.

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

put/v1/customers/{customer_id}

Request

  • Base URL: https://app.beel.es/api
  • URL: https://app.beel.es/api/v1/customers/{customer_id}
  • Auth: HTTP bearer

Path parameters

customer_idstring uuid required

Universally Unique Identifier (UUID v4)

Example:550e8400-e29b-41d4-a716-446655440000

Customer ID

Request body

nifstring

Spanish Tax ID (9 characters, uppercase only). Structural validation:

  • DNI: 8 digits + 1 letter (e.g., 12345678A)
  • NIE: X/Y/Z + 7 digits + 1 letter (e.g., X1234567A)
  • CIF: Organization letter + 7 digits + 1 control digit/letter (e.g., B12345674)
legal_namestring

Customer legal name. Matched against the AEAT census only for individuals; for a company the name is not verified.

trade_namestring nullable

Customer trade name. Omitting it clears the field: this is a full replacement, and the creation default (falling back to legal_name) does not apply here.

phonestring

A phone number as this API accepts it: 9 to 20 characters, and only digits, spaces, dashes, parentheses and an optional leading +. Every request that takes a phone number uses this schema.

It is Phone plus the rules enforced on input. A value this schema accepts always satisfies Phone, so anything you send here is something a response can return.

emailstring email nullable

Main contact address (minimum valid email is 5 chars, e.g. a@b.co). Invoice emails go here only when the customer has no billing_emails.

websitestring nullable

Website URL

billing_emailsEmail[] nullable

Addresses that receive the customer's invoice emails. When the send request names no recipients and the invoice has no email_config recipients, invoices go to these addresses, and not to email; email is used only when billing_emails is empty.

contact_personstring nullable

Contact person name (optional)

notesstring nullable

Additional notes about the customer (optional)

general_discountnumber nullable

General discount percentage (optional)

activeboolean

Whether the customer is active or inactive

Example request

{
  "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"
  ],
  "preferred_payment_method": {
    "method": "BANK_TRANSFER",
    "iban": "ES1234567890123456789012",
    "swift": "ABCDESMMXXX",
    "payment_term_days": 30
  }
}

Response

Customer updated successfully

successboolean required

Example response

{
  "success": true,
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "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
    }
  },
  "meta": {
    "timestamp": "2025-01-15T10:30:00Z",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

Changes

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