CompanyCustomFields

Rename, archive or reactivate an option

Updates only the properties present in the body. Invoices already saved keep the text they were saved with: renaming or archiving an option never changes an invoice.

  • Rename: value replaces the text. If another option of the field in the same scope — the same customer, or the common options for a common one — is equivalent to the new text (ignoring case, accents and repeated spaces), the answer is 409 with CUSTOM_FIELD_OPTION_DUPLICATE and nothing changes.
  • Archive or reactivate: is_archived. Options are never deleted.
patch/v1/companies/{company_id}/custom-fields/{key}/options/{option_id}

Request

  • Base URL: https://app.beel.es/api
  • URL: https://app.beel.es/api/v1/companies/{company_id}/custom-fields/{key}/options/{option_id}
  • Auth: HTTP bearer

Headers

Idempotency-Keystring

Idempotency key to prevent duplicates in sensitive operations.

  • Any unique client-generated string (e.g. an order id). A UUID also works but is not required
  • Allowed characters: letters, digits, _ and - (max 255 chars)
  • Retrying with the same key replays the first response when it was a success (2xx) or a server error (5xx): same status and body, plus the header Idempotency-Replay: true. After a 5xx, check whether the operation took effect before retrying with a new key
  • A 4xx is not stored: the key is released, so the corrected request can reuse it
  • Stored responses expire 24 hours after processing

The key is scoped per user and environment, and bound to the request body, so retrying after a network timeout replays the stored response instead of repeating the operation.

StatusCodeWhen
400INVALID_IDEMPOTENCY_KEYThe key breaks the format rules above.
409IDEMPOTENCY_KEY_PROCESSINGThe first request is still in flight. Wait for the Retry-After seconds (2) and retry with the same key.
409IDEMPOTENCY_KEY_MISMATCHThe key was already used with a different body. Use a new key.

Request body

valuestring

New text of the option. Leading and trailing spaces are removed. Invoices already saved keep the text they were saved with.

is_archivedboolean

true archives the option, false reactivates it.

Example request

{
  "value": "Gran Vía 12, Madrid"
}

Response

The option, updated.

successboolean required

Example response

{
  "success": true,
  "data": {
    "id": "c3d4e5f6-a7b8-4c9d-8e0f-1a2b3c4d5e6f",
    "value": "Gran Vía 12",
    "customer_id": "4f244735-980b-4d9c-80e8-6331fa0b1958"
  },
  "meta": {
    "timestamp": "2025-01-15T10:30:00Z",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}

Changes

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