@beel_es/sdk 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -782,6 +782,8 @@ interface paths {
782
782
  * - **`mode`:** the only value is `DUPLICATE`, which copies the source into a fresh draft. Recipient, lines,
783
783
  * payment method, series and observations are copied; number, status, dates, VeriFactu
784
784
  * data and PDF are reset.
785
+ * - **Custom fields:** copied from the source, each with the label the field has now. A
786
+ * field the company has archived since is left out instead of failing the call.
785
787
  * - **Series:** the one sent in `series_id`, or the source's when omitted. It is validated
786
788
  * against the type of the copy, which is not always the source's: the copy of a
787
789
  * `CORRECTIVE` is born `STANDARD`. An incompatible series fails with
@@ -920,6 +922,15 @@ interface paths {
920
922
  * - **Values:** the status, payment method, tax type and line type columns carry the same
921
923
  * values the API returns (`ISSUED`, `BANK_TRANSFER`, `IVA`, `SUPLIDO`…). A proforma past
922
924
  * its validity is exported as `ACTIVE`, not `EXPIRED`.
925
+ * - **Custom fields:** the `SUMMARY` and `ITEMS` sheets get one extra column per custom
926
+ * field `key` carried by at least one exported invoice, after the fixed columns and
927
+ * ordered by `key`, so the position of the fixed columns never changes. The header is
928
+ * the label saved on the invoices; when the same `key` was saved under different labels
929
+ * (the field was renamed between invoices), the label of the most recently created of
930
+ * them is used. A cell is empty when its invoice does not carry that field, and every
931
+ * line of an invoice repeats the invoice's values in `ITEMS`. The `Suplidos` sheet has
932
+ * no custom field columns. With no custom fields on any exported invoice the workbook is
933
+ * the same as without them.
923
934
  * - **Limit:** up to 50000 invoices per export. Going over it is rejected with
924
935
  * `422 EXPORT_LIMIT_EXCEEDED` — narrow the date range or split the selection. The
925
936
  * export is never silently truncated.
@@ -1340,6 +1351,9 @@ interface paths {
1340
1351
  * - **Original rejected by the AEAT:** when VeriFactu rejected the original's record and it
1341
1352
  * has not been resubmitted, the original is not in the AEAT's books: fix and resubmit it
1342
1353
  * first. Until then the request fails with `422 CORRECTIVE_ORIGINAL_RECORD_REJECTED`.
1354
+ * - **Custom fields:** the corrective carries those of the original, each with the label the
1355
+ * field has now; a field the company has archived since is left out. Like on any invoice,
1356
+ * they are not part of its VeriFactu record.
1343
1357
  * - **Exchange invoice recorded as F3:** correcting a full invoice issued in exchange for
1344
1358
  * simplified invoices is not available yet: `422 EXCHANGE_INVOICE_NOT_CORRECTABLE`.
1345
1359
  * Contact support.
@@ -1414,6 +1428,8 @@ interface paths {
1414
1428
  * includes `400 SERIES_NUMBER_COLLISION`: the number the series would assign is already
1415
1429
  * used by another invoice of the same company, and the series needs review, so contact
1416
1430
  * support.
1431
+ * - **Custom fields:** the new invoice copies those of the proforma, each with the label
1432
+ * the field has now; a field the company has archived since is left out.
1417
1433
  * - **Errors:** `422 CONVERSION_REQUIRES_PROFORMA` when the document is not a proforma,
1418
1434
  * `422 PROFORMA_NOT_CONVERTIBLE` when it is not `ACTIVE`, and
1419
1435
  * `409 PROFORMA_ALREADY_CONVERTED` when it has already been converted — a second call
@@ -1915,6 +1931,9 @@ interface paths {
1915
1931
  * - **VeriFactu:** the template does not carry it. Whether each generated invoice is
1916
1932
  * registered with AEAT is decided when that invoice is issued, against the company's
1917
1933
  * regime at that moment.
1934
+ * - **`custom_fields`:** copied to every invoice the template generates. A field archived
1935
+ * later is left out of the invoices generated from then on, and the template keeps
1936
+ * generating.
1918
1937
  */
1919
1938
  post: operations["createCompanyRecurringInvoice"];
1920
1939
  delete?: never;
@@ -2007,6 +2026,8 @@ interface paths {
2007
2026
  * the ones already in effect changes nothing. Changing `frequency` recalculates it on
2008
2027
  * the new grid and discards a pending skip. `start_date` is only editable while the
2009
2028
  * template has not generated any invoice yet.
2029
+ * - **`custom_fields`:** replaced as a whole; omit it to keep the current ones, send `null`
2030
+ * or `[]` to remove them all. Invoices already generated keep theirs.
2010
2031
  */
2011
2032
  patch: operations["patchCompanyRecurringInvoice"];
2012
2033
  trace?: never;
@@ -2092,7 +2113,8 @@ interface paths {
2092
2113
  * Get the next occurrence of a recurring invoice
2093
2114
  * @description Returns the invoice that would be produced by the next generation of this recurring
2094
2115
  * template, computed from the current issuer, recipient and series data. Nothing is
2095
- * persisted and no numbering is consumed.
2116
+ * persisted and no numbering is consumed. Its `custom_fields` are the ones the generated
2117
+ * invoice would carry, so a field archived since the template was saved is already left out.
2096
2118
  */
2097
2119
  get: operations["getCompanyRecurringInvoiceNextOccurrence"];
2098
2120
  put?: never;
@@ -2156,8 +2178,9 @@ interface paths {
2156
2178
  put?: never;
2157
2179
  /**
2158
2180
  * Derive a recurring invoice from an existing invoice
2159
- * @description Creates a recurring invoice template of this company taking its lines, recipient, series
2160
- * and payment data from an existing invoice, so only the recurrence has to be described.
2181
+ * @description Creates a recurring invoice template of this company taking its lines, recipient, series,
2182
+ * payment data and custom fields from an existing invoice, so only the recurrence has to be
2183
+ * described.
2161
2184
  *
2162
2185
  * - **`from_invoice_id`:** the source invoice. It must belong to the company in the path,
2163
2186
  * and one you cannot reach is reported the same way as one that does not exist. It is
@@ -2169,6 +2192,9 @@ interface paths {
2169
2192
  * It governs the step from the first invoice onwards, not where that first one lands.
2170
2193
  * - **VeriFactu:** not inherited from the source invoice. Each generated invoice is
2171
2194
  * registered with AEAT, or not, according to the company's regime when it is issued.
2195
+ * - **`custom_fields`:** the template takes those of the source invoice, each with the label
2196
+ * the field has now; a field the company has archived since is left out instead of
2197
+ * failing the call.
2172
2198
  */
2173
2199
  post: operations["createCompanyRecurringInvoiceDerivation"];
2174
2200
  delete?: never;
@@ -2213,6 +2239,9 @@ interface paths {
2213
2239
  * invoice, or derive a draft from one the template already generated with
2214
2240
  * `POST /v1/companies/{company_id}/invoices/derivations`. Either way the schedule stays
2215
2241
  * where it was.
2242
+ * - **Custom fields:** the invoice copies those of the template, each with the label the
2243
+ * field has now. A field archived since the template was saved is left out; it does not
2244
+ * make the generation fail.
2216
2245
  */
2217
2246
  post: operations["generateCompanyRecurringInvoiceNow"];
2218
2247
  delete?: never;
@@ -3099,6 +3128,169 @@ interface paths {
3099
3128
  patch: operations["patchCompanyProduct"];
3100
3129
  trace?: never;
3101
3130
  };
3131
+ "/v1/companies/{company_id}/custom-fields": {
3132
+ parameters: {
3133
+ query?: never;
3134
+ header?: never;
3135
+ path: {
3136
+ /** @description Unique identifier (UUID) of the company the operation acts on — its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
3137
+ company_id: string;
3138
+ };
3139
+ cookie?: never;
3140
+ };
3141
+ /**
3142
+ * List the custom fields of a company
3143
+ * @description Returns the invoice custom fields of this company, each one with the options that apply
3144
+ * to the query, ordered by `key`. A field with `suggest_values: false` carries no options.
3145
+ *
3146
+ * - **Options per customer:** with `customer_id`, each field carries the common options and
3147
+ * those of that customer, which is what an invoice for that customer can offer. Without
3148
+ * it, only the common options. To page through every option of a field, use
3149
+ * `GET /v1/companies/{company_id}/custom-fields/{key}/options`.
3150
+ * - **Archived:** archived fields and options are left out unless `include_archived=true`.
3151
+ *
3152
+ * **Closed catalogue.** A company defines a small set of fields: this collection carries no
3153
+ * `pagination`, takes no `page`/`limit`, and every response holds the whole set.
3154
+ */
3155
+ get: operations["listCompanyCustomFields"];
3156
+ put?: never;
3157
+ post?: never;
3158
+ delete?: never;
3159
+ options?: never;
3160
+ head?: never;
3161
+ patch?: never;
3162
+ trace?: never;
3163
+ };
3164
+ "/v1/companies/{company_id}/custom-fields/{key}": {
3165
+ parameters: {
3166
+ query?: never;
3167
+ header?: never;
3168
+ path: {
3169
+ /** @description Unique identifier (UUID) of the company the operation acts on — its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
3170
+ company_id: string;
3171
+ /** @description Key of the custom field: lowercase letters, digits and `_`, up to 64 characters. A key outside that format answers `422`. */
3172
+ key: components["schemas"]["CustomFieldKey"];
3173
+ };
3174
+ cookie?: never;
3175
+ };
3176
+ /**
3177
+ * Get a custom field of a company
3178
+ * @description Returns one custom field of this company, archived or not, with the options that apply to the query: the common ones plus, with `customer_id`, those of that customer. Archived options are left out unless `include_archived=true`. A field with `suggest_values: false` carries no options; list them with `GET /v1/companies/{company_id}/custom-fields/{key}/options`.
3179
+ */
3180
+ get: operations["getCompanyCustomField"];
3181
+ /**
3182
+ * Create or update a custom field of a company
3183
+ * @description Creates the custom field with this `key`, or updates it if the company already has one.
3184
+ * Repeating the request leaves the same state, so it is safe to run on every deployment to
3185
+ * seed a catalogue.
3186
+ *
3187
+ * - **Status:** `201` when the field is created, `200` when it already existed.
3188
+ * - **Key:** it is the path, never the body, and it never changes. To stop using a field,
3189
+ * archive it (`is_archived: true`); fields are never deleted.
3190
+ * - **Archive state:** omitting `is_archived` keeps the current one, so repeating the
3191
+ * request never reactivates a field someone archived.
3192
+ * - **Suggestions:** omitting `suggest_values` keeps the current setting; a new field starts
3193
+ * with `true`. Use `false` for a value that changes on every invoice, such as an order
3194
+ * number: invoices store the text as sent and no options are created. Turning it off
3195
+ * deletes no option, and turning it back on offers them again.
3196
+ * - **Options:** the response carries the common options of the field, or none when
3197
+ * `suggest_values` is `false`.
3198
+ */
3199
+ put: operations["upsertCompanyCustomField"];
3200
+ post?: never;
3201
+ delete?: never;
3202
+ options?: never;
3203
+ head?: never;
3204
+ patch?: never;
3205
+ trace?: never;
3206
+ };
3207
+ "/v1/companies/{company_id}/custom-fields/{key}/options": {
3208
+ parameters: {
3209
+ query?: never;
3210
+ header?: never;
3211
+ path: {
3212
+ /** @description Unique identifier (UUID) of the company the operation acts on — its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
3213
+ company_id: string;
3214
+ /** @description Key of the custom field: lowercase letters, digits and `_`, up to 64 characters. A key outside that format answers `422`. */
3215
+ key: components["schemas"]["CustomFieldKey"];
3216
+ };
3217
+ cookie?: never;
3218
+ };
3219
+ /**
3220
+ * List the options of a custom field
3221
+ * @description Returns a paginated list of the options of this custom field, ordered by `value`.
3222
+ *
3223
+ * - **Customer:** without `customer_id`, every option of the field, common and of every
3224
+ * customer. With it, the common options and those of that customer.
3225
+ * - **Archived:** archived options are left out unless `include_archived=true`.
3226
+ * - **Suggestions off:** the options of a field with `suggest_values: false` are listed
3227
+ * too. They are not offered on invoices while the setting is off.
3228
+ */
3229
+ get: operations["listCompanyCustomFieldOptions"];
3230
+ put?: never;
3231
+ /**
3232
+ * Add an option to a custom field
3233
+ * @description Adds a value to the options of this custom field, for one customer or, without
3234
+ * `customer_id`, common to every customer. Use it to seed a catalogue before the first
3235
+ * invoice; values used on invoices are added on their own.
3236
+ *
3237
+ * - **Equivalent values:** two values are equivalent when they match ignoring case, accents
3238
+ * and repeated spaces. If the field already has an equivalent option — of that customer
3239
+ * or a common one — no option is created: the response is `200` with the existing option,
3240
+ * and its text is kept. Only when nothing equivalent exists is the option created, with
3241
+ * `201`.
3242
+ * - **Archived options:** an equivalent archived option counts as existing. It comes back
3243
+ * with `200` and stays archived; reactivate it with
3244
+ * `PATCH /v1/companies/{company_id}/custom-fields/{key}/options/{option_id}`.
3245
+ * - **Suggestions off:** a field with `suggest_values: false` accepts options in the same
3246
+ * way, so a catalogue can be prepared before turning suggestions on. They are not
3247
+ * offered on invoices while the setting is off.
3248
+ */
3249
+ post: operations["createCompanyCustomFieldOption"];
3250
+ delete?: never;
3251
+ options?: never;
3252
+ head?: never;
3253
+ patch?: never;
3254
+ trace?: never;
3255
+ };
3256
+ "/v1/companies/{company_id}/custom-fields/{key}/options/{option_id}": {
3257
+ parameters: {
3258
+ query?: never;
3259
+ header?: never;
3260
+ path: {
3261
+ /** @description Unique identifier (UUID) of the company the operation acts on — its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
3262
+ company_id: string;
3263
+ /** @description Key of the custom field: lowercase letters, digits and `_`, up to 64 characters. A key outside that format answers `422`. */
3264
+ key: components["schemas"]["CustomFieldKey"];
3265
+ /** @description Unique identifier of the option. */
3266
+ option_id: string;
3267
+ };
3268
+ cookie?: never;
3269
+ };
3270
+ /**
3271
+ * Get an option of a custom field
3272
+ * @description Returns one option of this custom field, archived or not.
3273
+ */
3274
+ get: operations["getCompanyCustomFieldOption"];
3275
+ put?: never;
3276
+ post?: never;
3277
+ delete?: never;
3278
+ options?: never;
3279
+ head?: never;
3280
+ /**
3281
+ * Rename, archive or reactivate an option
3282
+ * @description Updates only the properties present in the body. Invoices already saved keep the text
3283
+ * they were saved with: renaming or archiving an option never changes an invoice.
3284
+ *
3285
+ * - **Rename:** `value` replaces the text. If another option of the field in the same scope
3286
+ * — the same customer, or the common options for a common one — is equivalent to the new
3287
+ * text (ignoring case, accents and repeated spaces), the answer is `409` with
3288
+ * `CUSTOM_FIELD_OPTION_DUPLICATE` and nothing changes.
3289
+ * - **Archive or reactivate:** `is_archived`. Options are never deleted.
3290
+ */
3291
+ patch: operations["patchCompanyCustomFieldOption"];
3292
+ trace?: never;
3293
+ };
3102
3294
  "/v1/accounts/{account_id}/members": {
3103
3295
  parameters: {
3104
3296
  query?: never;
@@ -6782,6 +6974,21 @@ interface components {
6782
6974
  created_at: string;
6783
6975
  /** Format: date-time */
6784
6976
  updated_at: string;
6977
+ /**
6978
+ * @description The company's custom fields saved on this invoice, each with the label and value it
6979
+ * was saved with; an empty array when it carries none. They are informational: they
6980
+ * are not part of the VeriFactu record sent to the AEAT and do not enter its hash.
6981
+ * Unlike `metadata`, which holds identifiers for your integration, they are what a
6982
+ * person reads, filters and exports.
6983
+ * @example [
6984
+ * {
6985
+ * "key": "store",
6986
+ * "label": "Store",
6987
+ * "value": "Gran Vía 12"
6988
+ * }
6989
+ * ]
6990
+ */
6991
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
6785
6992
  };
6786
6993
  SeriesInfo: {
6787
6994
  /**
@@ -7581,6 +7788,23 @@ interface components {
7581
7788
  */
7582
7789
  external_ref?: components["schemas"]["ExternalRef"];
7583
7790
  metadata?: components["schemas"]["InvoiceMetadata"];
7791
+ /**
7792
+ * @description Values for the company's custom fields, at most one per `key`; a repeated `key` answers
7793
+ * `422 VALIDATION_ERROR`. A `key` the company does not have answers
7794
+ * `422 CUSTOM_FIELD_UNKNOWN`, and an archived field answers `409 CUSTOM_FIELD_ARCHIVED`;
7795
+ * in both cases nothing is created. Omit it for an invoice without custom fields.
7796
+ *
7797
+ * They are informational: they are not part of the VeriFactu record sent to the AEAT,
7798
+ * do not enter its hash and cannot express any mention the invoicing regulations require.
7799
+ * Use `metadata` for identifiers your integration needs and people do not see.
7800
+ * @example [
7801
+ * {
7802
+ * "key": "store",
7803
+ * "value": "Gran Vía 12"
7804
+ * }
7805
+ * ]
7806
+ */
7807
+ custom_fields?: components["schemas"]["InvoiceCustomFieldInput"][];
7584
7808
  options?: components["schemas"]["InvoiceProcessingOptions"];
7585
7809
  };
7586
7810
  /**
@@ -7792,6 +8016,23 @@ interface components {
7792
8016
  */
7793
8017
  payment_info?: components["schemas"]["PaymentInfo"];
7794
8018
  notes?: string;
8019
+ /**
8020
+ * @description Replaces the custom fields of the invoice as a whole: the list sent becomes the new
8021
+ * list. Omit it to keep the current ones; send `null` or `[]` to remove them all. The
8022
+ * same rules as on creation apply: at most one value per `key`, a `key` the company does
8023
+ * not have answers `422 CUSTOM_FIELD_UNKNOWN` and an archived field answers
8024
+ * `409 CUSTOM_FIELD_ARCHIVED`, even when the draft already carries it. Every field in
8025
+ * the list is saved again with the label it has now. Only a draft, a scheduled invoice
8026
+ * or an active proforma can change them; any other status answers
8027
+ * `422 STATUS_NOT_MODIFIABLE`.
8028
+ *
8029
+ * When the request changes the recipient and omits `custom_fields`, the saved fields are
8030
+ * carried over to the new customer; one archived since is left out, with no error.
8031
+ *
8032
+ * They are informational: they are not part of the VeriFactu record sent to the AEAT and
8033
+ * do not enter its hash.
8034
+ */
8035
+ custom_fields?: components["schemas"]["InvoiceCustomFieldInput"][] | null;
7795
8036
  /**
7796
8037
  * @description Processing options for the draft. Fields are optional and follow partial update
7797
8038
  * semantics: omitted fields preserve the existing value.
@@ -10008,6 +10249,24 @@ interface components {
10008
10249
  */
10009
10250
  payment_term_days?: number | null;
10010
10251
  notes?: string | null;
10252
+ /**
10253
+ * @description The company's custom fields saved on this template, each with the label and value it was
10254
+ * saved with; an empty array when it carries none.
10255
+ *
10256
+ * Every invoice the template generates copies them. The generated invoice saves each field
10257
+ * with the label it has at that moment; a field archived after the template was saved stays
10258
+ * listed here, but the invoices generated from then on are created without it and the
10259
+ * template keeps generating: it is not paused for that reason. They are informational: they
10260
+ * are not part of the VeriFactu record sent to the AEAT and do not enter its hash.
10261
+ * @example [
10262
+ * {
10263
+ * "key": "project",
10264
+ * "label": "Project",
10265
+ * "value": "Corporate website"
10266
+ * }
10267
+ * ]
10268
+ */
10269
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
10011
10270
  send_automatically?: boolean;
10012
10271
  email_configuration?: components["schemas"]["RecurringEmailConfigResponse"];
10013
10272
  generated_invoices?: number;
@@ -10106,6 +10365,10 @@ interface components {
10106
10365
  * `payment_swift` and `payment_term_days`), `notes` and `email_configuration` are
10107
10366
  * cleared when you leave them out. To change a few fields and keep the rest
10108
10367
  * untouched, use `PATCH /v1/recurring-invoices/{recurring_invoice_id}`.
10368
+ *
10369
+ * `custom_fields` is not part of this request: a replacement keeps the template's custom
10370
+ * fields as they are. Change them with
10371
+ * `PATCH /v1/companies/{company_id}/recurring-invoices/{recurring_invoice_id}`.
10109
10372
  */
10110
10373
  UpdateRecurringInvoiceRequest: {
10111
10374
  name?: string;
@@ -10324,6 +10587,24 @@ interface components {
10324
10587
  payment_swift?: string | null;
10325
10588
  payment_term_days?: number | null;
10326
10589
  notes?: string | null;
10590
+ /**
10591
+ * @description Values for the company's custom fields that every generated invoice copies, at most one
10592
+ * per `key`; a repeated `key` answers `422 VALIDATION_ERROR`. A `key` the company does not
10593
+ * have answers `422 CUSTOM_FIELD_UNKNOWN`, and an archived field answers
10594
+ * `409 CUSTOM_FIELD_ARCHIVED`; in both cases no template is created. Each value follows the
10595
+ * same rules as on an invoice, with the template's `customer_id` as the customer. Omit it
10596
+ * for a template without custom fields.
10597
+ *
10598
+ * They are informational: they are not part of the VeriFactu record sent to the AEAT, do
10599
+ * not enter its hash and cannot express any mention the invoicing regulations require.
10600
+ * @example [
10601
+ * {
10602
+ * "key": "project",
10603
+ * "value": "Corporate website"
10604
+ * }
10605
+ * ]
10606
+ */
10607
+ custom_fields?: components["schemas"]["InvoiceCustomFieldInput"][];
10327
10608
  /** @default false */
10328
10609
  send_automatically?: boolean;
10329
10610
  email_configuration?: components["schemas"]["RecurringEmailConfigRequest"];
@@ -12356,6 +12637,32 @@ interface components {
12356
12637
  /** Format: date-time */
12357
12638
  deleted_at?: string | null;
12358
12639
  };
12640
+ /**
12641
+ * @description Identifier of the custom field within the company, chosen when the field is created: lowercase letters, digits and `_`, up to 64 characters. It never changes. BeeL. gives it no meaning of its own.
12642
+ * @example store
12643
+ */
12644
+ CustomFieldKey: string;
12645
+ /**
12646
+ * @description A custom field as it was saved on an invoice or on a recurring invoice template: a copy of the field label and of the value at that moment. Renaming or archiving the field or its options later does not change it.
12647
+ * @example {
12648
+ * "key": "store",
12649
+ * "label": "Store",
12650
+ * "value": "Gran Vía 12"
12651
+ * }
12652
+ */
12653
+ InvoiceCustomField: {
12654
+ key: components["schemas"]["CustomFieldKey"];
12655
+ /**
12656
+ * @description Label of the field when the invoice was saved.
12657
+ * @example Store
12658
+ */
12659
+ label: string;
12660
+ /**
12661
+ * @description Text stored on the invoice. It is the text the `custom_fields` filter of the invoice list compares.
12662
+ * @example Gran Vía 12
12663
+ */
12664
+ value: string;
12665
+ };
12359
12666
  /**
12360
12667
  * @description A phone number as this API accepts it: 9 to 20 characters, and only digits, spaces,
12361
12668
  * dashes, parentheses and an optional leading `+`. Every request that takes a phone number
@@ -12382,6 +12689,8 @@ interface components {
12382
12689
  * @description Your own key/value pairs to cross-reference this invoice with records in
12383
12690
  * your system (order ids, tenants, internal codes). Namespace them to avoid
12384
12691
  * clashing with the system keys BeeL adds on payment-generated invoices.
12692
+ * Metadata is not printed on the PDF; for values people read, filter or export,
12693
+ * such as a store or a cost centre, use `custom_fields`.
12385
12694
  * @example {
12386
12695
  * "external_order_id": "ORD-2025-0042",
12387
12696
  * "tenant": "acme",
@@ -12391,6 +12700,21 @@ interface components {
12391
12700
  InvoiceMetadata: {
12392
12701
  [key: string]: unknown;
12393
12702
  };
12703
+ /**
12704
+ * @description The value of one custom field of the company on an invoice. The field must exist in the company and be active; the label is taken from it when the invoice is saved.
12705
+ * @example {
12706
+ * "key": "store",
12707
+ * "value": "Gran Vía 12"
12708
+ * }
12709
+ */
12710
+ InvoiceCustomFieldInput: {
12711
+ key: components["schemas"]["CustomFieldKey"];
12712
+ /**
12713
+ * @description Text of the value. Leading and trailing spaces are removed; a value that is empty after that answers `422`. When an option of the field is equivalent (it matches ignoring case, accents and repeated spaces), the invoice stores the text of that option, archived options included. Otherwise the text is stored as sent and, when the invoice has a registered customer (`recipient.customer_id`), it is added as an option of that customer; with recipient data sent inline, no option is created. On a field with `suggest_values: false` the value is never compared with the options and never creates one: the invoice stores the text as sent, without the leading and trailing spaces.
12714
+ * @example Gran Vía 12
12715
+ */
12716
+ value: string;
12717
+ };
12394
12718
  /** @description Outcome of a bulk operation processed invoice by invoice. */
12395
12719
  BulkOperationResult: {
12396
12720
  /**
@@ -12586,6 +12910,7 @@ interface components {
12586
12910
  * @description Issue date to (inclusive).
12587
12911
  */
12588
12912
  date_to?: string;
12913
+ /** @description Only the invoices of this customer. Combines with the other filters, including `custom_fields`. */
12589
12914
  customer_id?: components["schemas"]["UUID"];
12590
12915
  /** @description Partial match on the recipient name. */
12591
12916
  recipient_name?: string;
@@ -12593,6 +12918,21 @@ interface components {
12593
12918
  recipient_nif?: string;
12594
12919
  /** @description Exact series code. */
12595
12920
  series_code?: string;
12921
+ /**
12922
+ * @description Filter by the custom fields saved on the invoice, as an object from field `key` to
12923
+ * value. It behaves like the `custom_fields` filter of the invoice list: the value is
12924
+ * compared with the text stored on the invoice, exactly (case and accents included), and
12925
+ * several keys are combined with AND, and with the other filters. Max 20 keys; more
12926
+ * answers `422 CUSTOM_FIELD_FILTER_TOO_MANY_KEYS`. A key the company does not have
12927
+ * matches no invoice. An empty object filters nothing and does not count as a selection
12928
+ * criterion.
12929
+ * @example {
12930
+ * "store": "Gran Vía 12"
12931
+ * }
12932
+ */
12933
+ custom_fields?: {
12934
+ [key: string]: string;
12935
+ };
12596
12936
  };
12597
12937
  /**
12598
12938
  * @description An export of the invoices of this company. The format travels in the body, not in the URL,
@@ -13035,6 +13375,24 @@ interface components {
13035
13375
  payment_term_days?: number | null;
13036
13376
  /** @description Notes printed on the generated invoices. Send `null` to clear them. */
13037
13377
  notes?: string | null;
13378
+ /**
13379
+ * @description Replaces the custom fields of the template as a whole: the list sent becomes the new
13380
+ * list. Omit it to keep the current ones; send `null` or `[]` to remove them all. The same
13381
+ * rules as on an invoice apply: at most one value per `key` (a repeated `key` answers
13382
+ * `422 VALIDATION_ERROR`), a `key` the company does not have answers
13383
+ * `422 CUSTOM_FIELD_UNKNOWN` and an archived field answers `409 CUSTOM_FIELD_ARCHIVED`,
13384
+ * even when the template already carries it; in every case nothing is written. Every field
13385
+ * in the list is saved again with the label it has now, and each value follows the same
13386
+ * rules as on an invoice, with the template's `customer_id` as the customer.
13387
+ *
13388
+ * When the request changes `customer_id` and omits `custom_fields`, the saved fields are
13389
+ * carried over to the new customer; one archived since is left out, with no error.
13390
+ *
13391
+ * Invoices already generated keep the fields they were created with; the change applies
13392
+ * from the next generation. They are informational: they are not part of the VeriFactu
13393
+ * record sent to the AEAT and do not enter its hash.
13394
+ */
13395
+ custom_fields?: components["schemas"]["InvoiceCustomFieldInput"][] | null;
13038
13396
  send_automatically?: boolean;
13039
13397
  /**
13040
13398
  * @description Email delivery settings, replaced as a whole. Send `null` to stop sending the
@@ -13058,6 +13416,13 @@ interface components {
13058
13416
  invoice_number?: string | null;
13059
13417
  /** @description Always `null` here, for the same reason as `invoice_number`. */
13060
13418
  number?: number | null;
13419
+ /**
13420
+ * @description The custom fields the generated invoice would carry: those of the template, each
13421
+ * with the label the field has now. A field archived after the template was saved is
13422
+ * left out, as it will be on the generated invoice. An empty array when there are
13423
+ * none.
13424
+ */
13425
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
13061
13426
  };
13062
13427
  /**
13063
13428
  * @description What happened in one scheduled slot of the schedule.
@@ -13129,9 +13494,9 @@ interface components {
13129
13494
  stopped: components["schemas"]["RecurringInvoiceStatsBlock"];
13130
13495
  };
13131
13496
  /**
13132
- * @description Derives a recurring invoice template from an existing invoice: lines, recipient, series and
13133
- * payment data are taken from it, so only the recurrence is described here. The source invoice
13134
- * is not modified.
13497
+ * @description Derives a recurring invoice template from an existing invoice: lines, recipient, series,
13498
+ * payment data and custom fields are taken from it, so only the recurrence is described here.
13499
+ * The source invoice is not modified.
13135
13500
  *
13136
13501
  * Deliberately not a variant of `CreateRecurringInvoiceRequest`: that one requires `series_id`,
13137
13502
  * `invoice_type` and `lines`, which this call does not carry. Relaxing them there would let a
@@ -13800,6 +14165,171 @@ interface components {
13800
14165
  */
13801
14166
  summary?: components["schemas"]["ProductBulkCreateLegacySummary"];
13802
14167
  };
14168
+ /** @description A value of a custom field, offered when filling it in. An option belongs to one customer or, without `customer_id`, is common to every customer of the company. */
14169
+ CustomFieldOption: {
14170
+ /**
14171
+ * Format: uuid
14172
+ * @description Unique identifier of the option.
14173
+ * @example c3d4e5f6-a7b8-4c9d-8e0f-1a2b3c4d5e6f
14174
+ */
14175
+ id: string;
14176
+ /**
14177
+ * @description Text of the option, exactly as it is shown and copied onto an invoice.
14178
+ * @example Gran Vía 12
14179
+ */
14180
+ value: string;
14181
+ /**
14182
+ * Format: uuid
14183
+ * @description Customer the option belongs to, or `null` for an option common to every customer. It is set when the option is created and never changes.
14184
+ * @example 4f244735-980b-4d9c-80e8-6331fa0b1958
14185
+ */
14186
+ customer_id: string | null;
14187
+ /**
14188
+ * @description An archived option is no longer offered and is left out of listings unless `include_archived=true`. Invoices that already carry its text keep it.
14189
+ * @example false
14190
+ */
14191
+ is_archived: boolean;
14192
+ };
14193
+ /**
14194
+ * @description A custom field of the company's invoices, with the options that apply to the query that returned it.
14195
+ * @example {
14196
+ * "id": "7d2f8a40-3c1e-4b6a-9f0d-2e5b8c1a4d77",
14197
+ * "key": "store",
14198
+ * "label": "Store",
14199
+ * "show_on_pdf": true,
14200
+ * "suggest_values": true,
14201
+ * "is_archived": false,
14202
+ * "options": [
14203
+ * {
14204
+ * "id": "0b6c1e2f-5a4d-4c3b-8e7f-1a2b3c4d5e6f",
14205
+ * "value": "Online store",
14206
+ * "customer_id": null,
14207
+ * "is_archived": false
14208
+ * },
14209
+ * {
14210
+ * "id": "c3d4e5f6-a7b8-4c9d-8e0f-1a2b3c4d5e6f",
14211
+ * "value": "Gran Vía 12",
14212
+ * "customer_id": "4f244735-980b-4d9c-80e8-6331fa0b1958",
14213
+ * "is_archived": false
14214
+ * }
14215
+ * ]
14216
+ * }
14217
+ */
14218
+ CustomField: {
14219
+ /**
14220
+ * Format: uuid
14221
+ * @description Unique identifier of the custom field.
14222
+ * @example 7d2f8a40-3c1e-4b6a-9f0d-2e5b8c1a4d77
14223
+ */
14224
+ id: string;
14225
+ key: components["schemas"]["CustomFieldKey"];
14226
+ /**
14227
+ * @description Name people see next to the value, on screen and, if `show_on_pdf`, on the PDF.
14228
+ * @example Store
14229
+ */
14230
+ label: string;
14231
+ /**
14232
+ * @description Whether the PDF of the invoice prints this field, in a block of its own under the notes. It applies to invoices saved from then on: an invoice keeps the setting it was saved with.
14233
+ * @example true
14234
+ */
14235
+ show_on_pdf: boolean;
14236
+ /**
14237
+ * @description Whether the field offers the values already used as options. With `true`, saving an invoice reuses an equivalent option or adds the value as a new one. With `false`, for a value that changes on every invoice such as an order number, the invoice stores the text as sent (without leading and trailing spaces), no option is created, and `options` comes back empty. Turning it off deletes no option: the existing ones are kept, can still be listed and managed under `GET /v1/companies/{company_id}/custom-fields/{key}/options`, and are offered again when it is turned back on.
14238
+ * @example true
14239
+ */
14240
+ suggest_values: boolean;
14241
+ /**
14242
+ * @description An archived field cannot be added to new invoices and is left out of listings unless `include_archived=true`. Invoices that already carry it keep it.
14243
+ * @example false
14244
+ */
14245
+ is_archived: boolean;
14246
+ /** @description The options of this field that apply to the query: the common ones plus, when the query names a `customer_id`, the ones of that customer. Archived options appear only with `include_archived=true`. Always empty when `suggest_values` is `false`. To page through every option of the field, of every customer, use `GET /v1/companies/{company_id}/custom-fields/{key}/options`. */
14247
+ options: components["schemas"]["CustomFieldOption"][];
14248
+ };
14249
+ CustomFieldListResponse: components["schemas"]["SuccessResponse"] & {
14250
+ data?: {
14251
+ custom_fields: components["schemas"]["CustomField"][];
14252
+ };
14253
+ };
14254
+ CustomFieldResponse: components["schemas"]["SuccessResponse"] & {
14255
+ data?: components["schemas"]["CustomField"];
14256
+ };
14257
+ /**
14258
+ * @description The state of the custom field. `label` and `show_on_pdf` are always replaced. `suggest_values` and `is_archived`, when omitted, keep their current value (a new field is created with `suggest_values: true` and active), so repeating a request never undoes a change someone made to them.
14259
+ * @example {
14260
+ * "label": "Store",
14261
+ * "show_on_pdf": true
14262
+ * }
14263
+ */
14264
+ UpsertCustomFieldRequest: {
14265
+ /**
14266
+ * @description Name people see next to the value. Leading and trailing spaces are removed; a label that is empty after that answers `422`.
14267
+ * @example Store
14268
+ */
14269
+ label: string;
14270
+ /**
14271
+ * @description Whether the PDF of invoices saved from now on prints this field.
14272
+ * @example true
14273
+ */
14274
+ show_on_pdf: boolean;
14275
+ /**
14276
+ * @description `true` offers the values already used as options and adds new ones as invoices are saved; `false` stores each value as sent and creates no options. Omit it to keep the current setting; a new field starts with `true`. Turning it off deletes no option.
14277
+ * @example true
14278
+ */
14279
+ suggest_values?: boolean;
14280
+ /**
14281
+ * @description `true` archives the field, `false` reactivates it. Omit it to keep the current state.
14282
+ * @example false
14283
+ */
14284
+ is_archived?: boolean;
14285
+ };
14286
+ CustomFieldOptionListResponse: components["schemas"]["SuccessResponse"] & {
14287
+ data?: {
14288
+ options: components["schemas"]["CustomFieldOption"][];
14289
+ pagination: components["schemas"]["Pagination"];
14290
+ };
14291
+ };
14292
+ /**
14293
+ * @description A value to add to the options of the field, for one customer or, without `customer_id`, common to every customer.
14294
+ * @example {
14295
+ * "value": "Gran Vía 12",
14296
+ * "customer_id": "4f244735-980b-4d9c-80e8-6331fa0b1958"
14297
+ * }
14298
+ */
14299
+ CreateCustomFieldOptionRequest: {
14300
+ /**
14301
+ * @description Text of the option. Leading and trailing spaces are removed; a value that is empty after that answers `422`. Two values are equivalent when they match ignoring case, accents and repeated spaces (`Gran Via 12` and `gran vía 12`).
14302
+ * @example Gran Vía 12
14303
+ */
14304
+ value: string;
14305
+ /**
14306
+ * Format: uuid
14307
+ * @description Customer of the company the option belongs to. Omit it for an option common to every customer.
14308
+ * @example 4f244735-980b-4d9c-80e8-6331fa0b1958
14309
+ */
14310
+ customer_id?: string;
14311
+ };
14312
+ CustomFieldOptionResponse: components["schemas"]["SuccessResponse"] & {
14313
+ data?: components["schemas"]["CustomFieldOption"];
14314
+ };
14315
+ /**
14316
+ * @description JSON Merge Patch of an option: an omitted property is left as it is. Neither property can be cleared. The customer an option belongs to cannot be changed.
14317
+ * @example {
14318
+ * "value": "Gran Vía 12, Madrid"
14319
+ * }
14320
+ */
14321
+ PatchCustomFieldOptionRequest: {
14322
+ /**
14323
+ * @description New text of the option. Leading and trailing spaces are removed. Invoices already saved keep the text they were saved with.
14324
+ * @example Gran Vía 12, Madrid
14325
+ */
14326
+ value?: string;
14327
+ /**
14328
+ * @description `true` archives the option, `false` reactivates it.
14329
+ * @example true
14330
+ */
14331
+ is_archived?: boolean;
14332
+ };
13803
14333
  /**
13804
14334
  * @description Who administers the account. Independent of `access_level`, which says how much access someone has to a given company.
13805
14335
  *
@@ -16235,7 +16765,8 @@ interface components {
16235
16765
  * `MEMBER_ALREADY_IN_ACCOUNT`, `INVOICE_DUPLICATE_EXTERNAL_REFERENCE`).
16236
16766
  * - **Lifecycle** — the transition does not apply from where the resource is
16237
16767
  * (`INVOICE_ALREADY_VOIDED`, `PROFORMA_ALREADY_CONVERTED`, `CLIENT_HAS_INVOICES`,
16238
- * `RECURRING_ALREADY_ENDED`, `RECURRING_OCCURRENCE_ALREADY_CONSUMED` — the occurrence the
16768
+ * `RECURRING_ALREADY_ENDED`, `CUSTOM_FIELD_ARCHIVED` — the custom field is archived and
16769
+ * cannot be assigned, `RECURRING_OCCURRENCE_ALREADY_CONSUMED` — the occurrence the
16239
16770
  * recurring template points at has already been billed; read its history instead of
16240
16771
  * retrying).
16241
16772
  * Read the resource before retrying: the state you assumed is not its state.
@@ -17360,6 +17891,11 @@ interface operations {
17360
17891
  * - `INVOICE_DUPLICATE_EXTERNAL_REFERENCE`: a live invoice with the same
17361
17892
  * `external_ref` already exists. Fetch it via
17362
17893
  * `GET /v1/invoices?external_ref=...`. Deleting it lets you recreate.
17894
+ * - `CUSTOM_FIELD_ARCHIVED`: a `key` in `custom_fields` names a field the company has
17895
+ * archived. Nothing is created.
17896
+ * - `CONCURRENT_MODIFICATION`: another invoice of the same customer saved the same custom
17897
+ * field value written differently a moment earlier; nothing is created, send the request
17898
+ * again.
17363
17899
  */
17364
17900
  409: {
17365
17901
  headers: {
@@ -17413,6 +17949,7 @@ interface operations {
17413
17949
  * Other `error.code` values with this status:
17414
17950
  *
17415
17951
  * - `CORRECTIVE_INVOICE_INCOMPLETE` — `type: CORRECTIVE` is not accepted when creating an invoice; create correctives from the original with `POST …/invoices/{invoice_id}/corrective`.
17952
+ * - `CUSTOM_FIELD_UNKNOWN` — a `key` in `custom_fields` is not a custom field of this company in this environment; create it with `PUT …/custom-fields/{key}` or fix the key.
17416
17953
  * - `DUE_DATE_BEFORE_ISSUE_DATE` — `due_date` is earlier than the issue date (today on create, the stored one on edit); send a due date on or after it.
17417
17954
  * - `EXEMPTION_NOT_FOR_ISSUED_INVOICE` — `EXENTA_ART_26` exempts the buyer's intra-community acquisition, not a sale you invoice; use `EXENTA_ART_25` for the intra-community supply.
17418
17955
  * - `EXEMPT_ZERO_RATE_REQUIRES_REASON` — a 0 % IVA or IPSI line is the exemption sentinel and needs an `exemption_reason`; add one or use a real rate.
@@ -17682,6 +18219,19 @@ interface operations {
17682
18219
  "application/json": components["schemas"]["ErrorResponse"];
17683
18220
  };
17684
18221
  };
18222
+ /**
18223
+ * @description `CUSTOM_FIELD_ARCHIVED` — a `key` in `custom_fields` names a field the company has
18224
+ * archived, even one the draft already carries. Nothing changes. Also
18225
+ * `CONCURRENT_MODIFICATION`, `IDEMPOTENCY_KEY_PROCESSING` and `IDEMPOTENCY_KEY_MISMATCH`.
18226
+ */
18227
+ 409: {
18228
+ headers: {
18229
+ [name: string]: unknown;
18230
+ };
18231
+ content: {
18232
+ "application/json": components["schemas"]["ErrorResponse"];
18233
+ };
18234
+ };
17685
18235
  /**
17686
18236
  * @description Validation error.
17687
18237
  * Separately: on a line priced by declared total (`total_excluding_tax` or
@@ -17699,6 +18249,7 @@ interface operations {
17699
18249
  *
17700
18250
  * Other `error.code` values with this status:
17701
18251
  *
18252
+ * - `CUSTOM_FIELD_UNKNOWN` — a `key` in `custom_fields` is not a custom field of this company in this environment; create it with `PUT …/custom-fields/{key}` or fix the key.
17702
18253
  * - `DUE_DATE_BEFORE_ISSUE_DATE` — `due_date` is earlier than the issue date (today on create, the stored one on edit); send a due date on or after it.
17703
18254
  * - `EXEMPTION_NOT_FOR_ISSUED_INVOICE` — `EXENTA_ART_26` exempts the buyer's intra-community acquisition, not a sale you invoice; use `EXENTA_ART_25` for the intra-community supply.
17704
18255
  * - `EXEMPT_ZERO_RATE_REQUIRES_REASON` — a 0 % IVA or IPSI line is the exemption sentinel and needs an `exemption_reason`; add one or use a real rate.
@@ -19797,10 +20348,21 @@ interface operations {
19797
20348
  * Repeat the bracket-style param to filter on multiple keys.
19798
20349
  * Max 50 pairs per request. Keys must match `^[A-Za-z0-9_\-.]{1,64}$`.
19799
20350
  * Example: `?metadata[external_order_id]=ORD-42&metadata[tenant]=acme`
20351
+ * To filter by a custom field, use `custom_fields[<key>]`.
19800
20352
  */
19801
20353
  metadata?: {
19802
20354
  [key: string]: string;
19803
20355
  };
20356
+ /**
20357
+ * @description Filter by the custom fields saved on the invoice, written as `custom_fields[<key>]=<value>`.
20358
+ * The value is compared with the text stored on the invoice, exactly (case and accents
20359
+ * included); several keys are combined with AND, and with the other filters. Max 20 keys
20360
+ * per request. A key the company does not have matches no invoice.
20361
+ * Example: `?custom_fields[project]=North&custom_fields[cost_centre]=CC-12`
20362
+ */
20363
+ custom_fields?: {
20364
+ [key: string]: string;
20365
+ };
19804
20366
  /**
19805
20367
  * @description Field to sort by: `issue_date` (default), `operation_date`, `due_date`,
19806
20368
  * `invoice_number`, `series_code`, `status`, `invoice_total`, `taxable_base`,
@@ -19864,6 +20426,7 @@ interface operations {
19864
20426
  *
19865
20427
  * Other `error.code` values with this status:
19866
20428
  *
20429
+ * - `CUSTOM_FIELD_FILTER_TOO_MANY_KEYS` — the query sends more than 20 distinct `custom_fields[key]` filters; narrow the filter to 20 keys or fewer.
19867
20430
  * - `METADATA_FILTER_TOO_MANY_KEYS` — the query sends more than 50 distinct `metadata[key]` filters; narrow the filter to 50 keys or fewer.
19868
20431
  */
19869
20432
  422: {
@@ -20020,6 +20583,12 @@ interface operations {
20020
20583
  * - Idempotency key already processed, or duplicate invoice number.
20021
20584
  * - `INVOICE_DUPLICATE_EXTERNAL_REFERENCE`: a live invoice with the same
20022
20585
  * `external_ref` already exists.
20586
+ * - `CUSTOM_FIELD_ARCHIVED`: a `key` in `custom_fields` names a field the company has
20587
+ * archived. Archived fields cannot be added to invoices; reactivate the field or drop
20588
+ * it from the request. Nothing is created.
20589
+ * - `CONCURRENT_MODIFICATION`: another invoice of the same customer saved the same custom
20590
+ * field value written differently a moment earlier; nothing is created, send the request
20591
+ * again and the stored text will be the existing one.
20023
20592
  */
20024
20593
  409: {
20025
20594
  headers: {
@@ -20087,6 +20656,7 @@ interface operations {
20087
20656
  * Other `error.code` values with this status:
20088
20657
  *
20089
20658
  * - `CORRECTIVE_INVOICE_INCOMPLETE` — `type: CORRECTIVE` is not accepted when creating an invoice; create correctives from the original with `POST …/invoices/{invoice_id}/corrective`.
20659
+ * - `CUSTOM_FIELD_UNKNOWN` — a `key` in `custom_fields` is not a custom field of this company in this environment; create it with `PUT …/custom-fields/{key}` or fix the key.
20090
20660
  * - `DUE_DATE_BEFORE_ISSUE_DATE` — `due_date` is earlier than the issue date (today on create, the stored one on edit); send a due date on or after it.
20091
20661
  * - `EXEMPT_ZERO_RATE_REQUIRES_REASON` — a 0 % IVA or IPSI line is the exemption sentinel and needs an `exemption_reason`; add one or use a real rate.
20092
20662
  * - `INVALID_IVA_SURCHARGE_PAIR` — the equivalence surcharge does not match the line's VAT rate (21↔5.2, 10↔1.4, 5↔0.62, 4↔0.5); fix either rate.
@@ -20664,7 +21234,37 @@ interface operations {
20664
21234
  "application/json": components["schemas"]["ErrorResponse"];
20665
21235
  };
20666
21236
  };
20667
- 422: components["responses"]["ValidationError"];
21237
+ /**
21238
+ * @description The body parses but the export cannot be produced as asked. Nothing is exported.
21239
+ *
21240
+ * - `VALIDATION_ERROR` — a field fails validation; `error.details` maps each offending
21241
+ * property to what is wrong with it.
21242
+ * - `EXPORT_LIMIT_EXCEEDED` — the selection matches more than 50000 invoices; narrow the
21243
+ * date range or split the selection.
21244
+ * - `CUSTOM_FIELD_FILTER_TOO_MANY_KEYS` — `filters.custom_fields` has more than 20 keys;
21245
+ * narrow the filter to 20 keys or fewer.
21246
+ */
21247
+ 422: {
21248
+ headers: {
21249
+ [name: string]: unknown;
21250
+ };
21251
+ content: {
21252
+ /**
21253
+ * @example {
21254
+ * "success": false,
21255
+ * "error": {
21256
+ * "code": "CUSTOM_FIELD_FILTER_TOO_MANY_KEYS",
21257
+ * "message": "The custom fields filter accepts at most 20 keys per request"
21258
+ * },
21259
+ * "meta": {
21260
+ * "timestamp": "2026-10-18T10:30:00Z",
21261
+ * "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
21262
+ * }
21263
+ * }
21264
+ */
21265
+ "application/json": components["schemas"]["ErrorResponse"];
21266
+ };
21267
+ };
20668
21268
  429: components["responses"]["TooManyRequests"];
20669
21269
  500: components["responses"]["InternalServerError"];
20670
21270
  default: components["responses"]["UnexpectedError"];
@@ -20921,7 +21521,40 @@ interface operations {
20921
21521
  "application/json": components["schemas"]["ErrorResponse"];
20922
21522
  };
20923
21523
  };
20924
- 409: components["responses"]["StateConflict"];
21524
+ /**
21525
+ * @description The request is well formed but collides with the state that is already there, told
21526
+ * apart by `error.code`:
21527
+ *
21528
+ * - `CUSTOM_FIELD_ARCHIVED` — a `key` in `custom_fields` names a field the company has
21529
+ * archived, even one the draft already carries. Reactivate the field, or send
21530
+ * `custom_fields` without it. Nothing changes.
21531
+ * - `CONCURRENT_MODIFICATION` — another write changed the invoice first; read it again
21532
+ * and retry.
21533
+ * - `IDEMPOTENCY_KEY_PROCESSING` — the `Idempotency-Key` you sent is still in flight;
21534
+ * retry after a moment. `IDEMPOTENCY_KEY_MISMATCH` — it was already used for a
21535
+ * different body; use a new key.
21536
+ */
21537
+ 409: {
21538
+ headers: {
21539
+ [name: string]: unknown;
21540
+ };
21541
+ content: {
21542
+ /**
21543
+ * @example {
21544
+ * "success": false,
21545
+ * "error": {
21546
+ * "code": "CUSTOM_FIELD_ARCHIVED",
21547
+ * "message": "The custom field store is archived and cannot be added to an invoice."
21548
+ * },
21549
+ * "meta": {
21550
+ * "timestamp": "2026-10-17T10:30:00Z",
21551
+ * "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
21552
+ * }
21553
+ * }
21554
+ */
21555
+ "application/json": components["schemas"]["ErrorResponse"];
21556
+ };
21557
+ };
20925
21558
  /**
20926
21559
  * @description Validation error.
20927
21560
  * Separately: on a line priced by declared total (`total_excluding_tax` or
@@ -20952,6 +21585,7 @@ interface operations {
20952
21585
  *
20953
21586
  * Other `error.code` values with this status:
20954
21587
  *
21588
+ * - `CUSTOM_FIELD_UNKNOWN` — a `key` in `custom_fields` is not a custom field of this company in this environment; create it with `PUT …/custom-fields/{key}` or fix the key.
20955
21589
  * - `DUE_DATE_BEFORE_ISSUE_DATE` — `due_date` is earlier than the issue date (today on create, the stored one on edit); send a due date on or after it.
20956
21590
  * - `EXEMPT_ZERO_RATE_REQUIRES_REASON` — a 0 % IVA or IPSI line is the exemption sentinel and needs an `exemption_reason`; add one or use a real rate.
20957
21591
  * - `INVALID_IVA_SURCHARGE_PAIR` — the equivalence surcharge does not match the line's VAT rate (21↔5.2, 10↔1.4, 5↔0.62, 4↔0.5); fix either rate.
@@ -23002,6 +23636,19 @@ interface operations {
23002
23636
  "application/json": components["schemas"]["ErrorResponse"];
23003
23637
  };
23004
23638
  };
23639
+ /**
23640
+ * @description `CUSTOM_FIELD_ARCHIVED` — a `key` in `custom_fields` names a field the company has
23641
+ * archived. Nothing is created. Also `CONCURRENT_MODIFICATION`,
23642
+ * `IDEMPOTENCY_KEY_PROCESSING` and `IDEMPOTENCY_KEY_MISMATCH`.
23643
+ */
23644
+ 409: {
23645
+ headers: {
23646
+ [name: string]: unknown;
23647
+ };
23648
+ content: {
23649
+ "application/json": components["schemas"]["ErrorResponse"];
23650
+ };
23651
+ };
23005
23652
  /**
23006
23653
  * @description Validation error.
23007
23654
  * A line whose `exemption_reason` requires the recipient to carry a specific alternate
@@ -23034,6 +23681,7 @@ interface operations {
23034
23681
  *
23035
23682
  * Other `error.code` values with this status:
23036
23683
  *
23684
+ * - `CUSTOM_FIELD_UNKNOWN` — a `key` in `custom_fields` is not a custom field of this company in this environment; create it with `PUT …/custom-fields/{key}` or fix the key.
23037
23685
  * - `EXEMPTION_NOT_FOR_ISSUED_INVOICE` — `EXENTA_ART_26` exempts the buyer's intra-community acquisition, not a sale you invoice; use `EXENTA_ART_25` for the intra-community supply.
23038
23686
  * - `EXEMPT_ZERO_RATE_REQUIRES_REASON` — a 0 % IVA or IPSI line is the exemption sentinel and needs an `exemption_reason`; add one or use a real rate.
23039
23687
  * - `INVALID_IRPF` — the `irpf_rate` is not a withholding rate in force (see `IrpfPercentage`); send one of the published rates.
@@ -23461,6 +24109,7 @@ interface operations {
23461
24109
  *
23462
24110
  * Other `error.code` values with this status:
23463
24111
  *
24112
+ * - `CUSTOM_FIELD_UNKNOWN` — a `key` in `custom_fields` is not a custom field of this company in this environment; create it with `PUT …/custom-fields/{key}` or fix the key.
23464
24113
  * - `EXEMPTION_NOT_FOR_ISSUED_INVOICE` — `EXENTA_ART_26` exempts the buyer's intra-community acquisition, not a sale you invoice; use `EXENTA_ART_25` for the intra-community supply.
23465
24114
  * - `EXEMPT_ZERO_RATE_REQUIRES_REASON` — a 0 % IVA or IPSI line is the exemption sentinel and needs an `exemption_reason`; add one or use a real rate.
23466
24115
  * - `INVALID_IRPF` — the `irpf_rate` is not a withholding rate in force (see `IrpfPercentage`); send one of the published rates.
@@ -24386,6 +25035,40 @@ interface operations {
24386
25035
  "application/json": components["schemas"]["ErrorResponse"];
24387
25036
  };
24388
25037
  };
25038
+ /**
25039
+ * @description The request is well formed but collides with the state that is already there, told
25040
+ * apart by `error.code`:
25041
+ *
25042
+ * - `CUSTOM_FIELD_ARCHIVED` — a `key` in `custom_fields` names a field the company has
25043
+ * archived. Reactivate the field, or send `custom_fields` without it. No template is
25044
+ * created.
25045
+ * - `CONCURRENT_MODIFICATION` — another write changed the template first; read it again
25046
+ * and retry.
25047
+ * - `IDEMPOTENCY_KEY_PROCESSING` — the `Idempotency-Key` you sent is still in flight;
25048
+ * retry after a moment. `IDEMPOTENCY_KEY_MISMATCH` — it was already used for a
25049
+ * different body; use a new key.
25050
+ */
25051
+ 409: {
25052
+ headers: {
25053
+ [name: string]: unknown;
25054
+ };
25055
+ content: {
25056
+ /**
25057
+ * @example {
25058
+ * "success": false,
25059
+ * "error": {
25060
+ * "code": "CUSTOM_FIELD_ARCHIVED",
25061
+ * "message": "The custom field project is archived and cannot be added to an invoice"
25062
+ * },
25063
+ * "meta": {
25064
+ * "timestamp": "2026-10-17T10:30:00Z",
25065
+ * "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
25066
+ * }
25067
+ * }
25068
+ */
25069
+ "application/json": components["schemas"]["ErrorResponse"];
25070
+ };
25071
+ };
24389
25072
  /**
24390
25073
  * @description Validation error.
24391
25074
  * A line whose `exemption_reason` requires the recipient to carry a specific alternate
@@ -24424,6 +25107,7 @@ interface operations {
24424
25107
  *
24425
25108
  * Other `error.code` values with this status:
24426
25109
  *
25110
+ * - `CUSTOM_FIELD_UNKNOWN` — a `key` in `custom_fields` is not a custom field of this company in this environment; create it with `PUT …/custom-fields/{key}` or fix the key.
24427
25111
  * - `EXEMPTION_NOT_FOR_ISSUED_INVOICE` — `EXENTA_ART_26` exempts the buyer's intra-community acquisition, not a sale you invoice; use `EXENTA_ART_25` for the intra-community supply.
24428
25112
  * - `EXEMPT_ZERO_RATE_REQUIRES_REASON` — a 0 % IVA or IPSI line is the exemption sentinel and needs an `exemption_reason`; add one or use a real rate.
24429
25113
  * - `INVALID_IRPF` — the `irpf_rate` is not a withholding rate in force (see `IrpfPercentage`); send one of the published rates.
@@ -24815,6 +25499,7 @@ interface operations {
24815
25499
  *
24816
25500
  * Other `error.code` values with this status:
24817
25501
  *
25502
+ * - `CUSTOM_FIELD_UNKNOWN` — a `key` in `custom_fields` is not a custom field of this company in this environment; create it with `PUT …/custom-fields/{key}` or fix the key.
24818
25503
  * - `EXEMPTION_NOT_FOR_ISSUED_INVOICE` — `EXENTA_ART_26` exempts the buyer's intra-community acquisition, not a sale you invoice; use `EXENTA_ART_25` for the intra-community supply.
24819
25504
  * - `EXEMPT_ZERO_RATE_REQUIRES_REASON` — a 0 % IVA or IPSI line is the exemption sentinel and needs an `exemption_reason`; add one or use a real rate.
24820
25505
  * - `INVALID_IRPF` — the `irpf_rate` is not a withholding rate in force (see `IrpfPercentage`); send one of the published rates.
@@ -28360,6 +29045,530 @@ interface operations {
28360
29045
  default: components["responses"]["UnexpectedError"];
28361
29046
  };
28362
29047
  };
29048
+ listCompanyCustomFields: {
29049
+ parameters: {
29050
+ query?: {
29051
+ /** @description Adds the options of this customer to the common ones. A value that names no customer of this company is not an error: only the common options come back. */
29052
+ customer_id?: string;
29053
+ /** @description Include archived fields and archived options. */
29054
+ include_archived?: boolean;
29055
+ };
29056
+ header?: never;
29057
+ path: {
29058
+ /** @description Unique identifier (UUID) of the company the operation acts on — its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
29059
+ company_id: string;
29060
+ };
29061
+ cookie?: never;
29062
+ };
29063
+ requestBody?: never;
29064
+ responses: {
29065
+ /** @description Custom fields of the company. */
29066
+ 200: {
29067
+ headers: {
29068
+ [name: string]: unknown;
29069
+ };
29070
+ content: {
29071
+ "application/json": components["schemas"]["CustomFieldListResponse"];
29072
+ };
29073
+ };
29074
+ 400: components["responses"]["InvalidRequestTarget"];
29075
+ 401: components["responses"]["Unauthorized"];
29076
+ /**
29077
+ * @description Your account does not own or manage this company, or does not hold the required
29078
+ * access over it. A company that does not exist answers the same way.
29079
+ * That case answers `error.code` `ACTIVE_COMPANY_NOT_ACCESSIBLE`.
29080
+ */
29081
+ 403: {
29082
+ headers: {
29083
+ [name: string]: unknown;
29084
+ };
29085
+ content: {
29086
+ "application/json": components["schemas"]["ErrorResponse"];
29087
+ };
29088
+ };
29089
+ 429: components["responses"]["TooManyRequests"];
29090
+ 500: components["responses"]["InternalServerError"];
29091
+ default: components["responses"]["UnexpectedError"];
29092
+ };
29093
+ };
29094
+ getCompanyCustomField: {
29095
+ parameters: {
29096
+ query?: {
29097
+ /** @description Adds the options of this customer to the common ones. A value that names no customer of this company is not an error: only the common options come back. */
29098
+ customer_id?: string;
29099
+ /** @description Include archived options. */
29100
+ include_archived?: boolean;
29101
+ };
29102
+ header?: never;
29103
+ path: {
29104
+ /** @description Unique identifier (UUID) of the company the operation acts on — its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
29105
+ company_id: string;
29106
+ /** @description Key of the custom field: lowercase letters, digits and `_`, up to 64 characters. A key outside that format answers `422`. */
29107
+ key: components["schemas"]["CustomFieldKey"];
29108
+ };
29109
+ cookie?: never;
29110
+ };
29111
+ requestBody?: never;
29112
+ responses: {
29113
+ /** @description The custom field. */
29114
+ 200: {
29115
+ headers: {
29116
+ [name: string]: unknown;
29117
+ };
29118
+ content: {
29119
+ "application/json": components["schemas"]["CustomFieldResponse"];
29120
+ };
29121
+ };
29122
+ 400: components["responses"]["InvalidRequestTarget"];
29123
+ 401: components["responses"]["Unauthorized"];
29124
+ /**
29125
+ * @description Your account does not own or manage this company, or does not hold the required
29126
+ * access over it. A company that does not exist answers the same way.
29127
+ * That case answers `error.code` `ACTIVE_COMPANY_NOT_ACCESSIBLE`.
29128
+ */
29129
+ 403: {
29130
+ headers: {
29131
+ [name: string]: unknown;
29132
+ };
29133
+ content: {
29134
+ "application/json": components["schemas"]["ErrorResponse"];
29135
+ };
29136
+ };
29137
+ /** @description `CUSTOM_FIELD_NOT_FOUND` — this company has no custom field with this `key` in the environment of the credential. Test and Live keep separate catalogues. */
29138
+ 404: {
29139
+ headers: {
29140
+ [name: string]: unknown;
29141
+ };
29142
+ content: {
29143
+ /**
29144
+ * @example {
29145
+ * "success": false,
29146
+ * "error": {
29147
+ * "code": "CUSTOM_FIELD_NOT_FOUND",
29148
+ * "message": "Custom field not found: store"
29149
+ * },
29150
+ * "meta": {
29151
+ * "timestamp": "2026-10-17T10:30:00Z",
29152
+ * "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
29153
+ * }
29154
+ * }
29155
+ */
29156
+ "application/json": components["schemas"]["ErrorResponse"];
29157
+ };
29158
+ };
29159
+ 422: components["responses"]["UnprocessableQueryParameter"];
29160
+ 429: components["responses"]["TooManyRequests"];
29161
+ 500: components["responses"]["InternalServerError"];
29162
+ default: components["responses"]["UnexpectedError"];
29163
+ };
29164
+ };
29165
+ upsertCompanyCustomField: {
29166
+ parameters: {
29167
+ query?: never;
29168
+ header?: {
29169
+ /**
29170
+ * @description Idempotency key to prevent duplicates in sensitive operations.
29171
+ *
29172
+ * - Any unique client-generated string (e.g. an order id). A UUID also works but is not required
29173
+ * - Allowed characters: letters, digits, `_` and `-` (max 255 chars)
29174
+ * - Retrying with the same key replays the first response when it was a success (2xx) or a
29175
+ * server error (5xx): same status and body, plus the header `Idempotency-Replay: true`.
29176
+ * After a 5xx, check whether the operation took effect before retrying with a **new** key
29177
+ * - A 4xx is not stored: the key is released, so the corrected request can reuse it
29178
+ * - Stored responses expire 24 hours after processing
29179
+ *
29180
+ * The key is scoped per user and environment, and bound to the request body, so retrying after
29181
+ * a network timeout replays the stored response instead of repeating the operation.
29182
+ *
29183
+ * | Status | Code | When |
29184
+ * |---|---|---|
29185
+ * | `400` | `INVALID_IDEMPOTENCY_KEY` | The key breaks the format rules above. |
29186
+ * | `409` | `IDEMPOTENCY_KEY_PROCESSING` | The first request is still in flight. Wait for the `Retry-After` seconds (2) and retry with the same key. |
29187
+ * | `409` | `IDEMPOTENCY_KEY_MISMATCH` | The key was already used with a **different** body. Use a new key. |
29188
+ * @example invoice-order-12345
29189
+ */
29190
+ "Idempotency-Key"?: components["parameters"]["IdempotencyKeyHeader"];
29191
+ };
29192
+ path: {
29193
+ /** @description Unique identifier (UUID) of the company the operation acts on — its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
29194
+ company_id: string;
29195
+ /** @description Key of the custom field: lowercase letters, digits and `_`, up to 64 characters. A key outside that format answers `422`. */
29196
+ key: components["schemas"]["CustomFieldKey"];
29197
+ };
29198
+ cookie?: never;
29199
+ };
29200
+ requestBody: {
29201
+ content: {
29202
+ "application/json": components["schemas"]["UpsertCustomFieldRequest"];
29203
+ };
29204
+ };
29205
+ responses: {
29206
+ /** @description The custom field already existed and was updated. */
29207
+ 200: {
29208
+ headers: {
29209
+ [name: string]: unknown;
29210
+ };
29211
+ content: {
29212
+ "application/json": components["schemas"]["CustomFieldResponse"];
29213
+ };
29214
+ };
29215
+ /** @description The custom field was created. */
29216
+ 201: {
29217
+ headers: {
29218
+ Location: components["headers"]["CreatedResourceLocation"];
29219
+ [name: string]: unknown;
29220
+ };
29221
+ content: {
29222
+ "application/json": components["schemas"]["CustomFieldResponse"];
29223
+ };
29224
+ };
29225
+ 400: components["responses"]["BadRequest"];
29226
+ 401: components["responses"]["Unauthorized"];
29227
+ /**
29228
+ * @description Your account does not own or manage this company, or does not hold the required
29229
+ * access over it. A company that does not exist answers the same way.
29230
+ * That case answers `error.code` `ACTIVE_COMPANY_NOT_ACCESSIBLE`.
29231
+ */
29232
+ 403: {
29233
+ headers: {
29234
+ [name: string]: unknown;
29235
+ };
29236
+ content: {
29237
+ "application/json": components["schemas"]["ErrorResponse"];
29238
+ };
29239
+ };
29240
+ 409: components["responses"]["StateConflict"];
29241
+ 422: components["responses"]["ValidationError"];
29242
+ 429: components["responses"]["TooManyRequests"];
29243
+ 500: components["responses"]["InternalServerError"];
29244
+ default: components["responses"]["UnexpectedError"];
29245
+ };
29246
+ };
29247
+ listCompanyCustomFieldOptions: {
29248
+ parameters: {
29249
+ query?: {
29250
+ /**
29251
+ * @description Page number, starting at 1. The response echoes it back as `pagination.current_page`.
29252
+ * @example 1
29253
+ */
29254
+ page?: components["parameters"]["PageParam"];
29255
+ /**
29256
+ * @description How many items to return per page. The response echoes it back as `pagination.items_per_page`.
29257
+ * @example 20
29258
+ */
29259
+ limit?: components["parameters"]["LimitParam"];
29260
+ /** @description Limits the list to the common options and those of this customer. A value that names no customer of this company is not an error: only the common options come back. */
29261
+ customer_id?: string;
29262
+ /** @description Include archived options. */
29263
+ include_archived?: boolean;
29264
+ };
29265
+ header?: never;
29266
+ path: {
29267
+ /** @description Unique identifier (UUID) of the company the operation acts on — its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
29268
+ company_id: string;
29269
+ /** @description Key of the custom field: lowercase letters, digits and `_`, up to 64 characters. A key outside that format answers `422`. */
29270
+ key: components["schemas"]["CustomFieldKey"];
29271
+ };
29272
+ cookie?: never;
29273
+ };
29274
+ requestBody?: never;
29275
+ responses: {
29276
+ /** @description Options of the custom field. */
29277
+ 200: {
29278
+ headers: {
29279
+ [name: string]: unknown;
29280
+ };
29281
+ content: {
29282
+ "application/json": components["schemas"]["CustomFieldOptionListResponse"];
29283
+ };
29284
+ };
29285
+ 400: components["responses"]["InvalidRequestTarget"];
29286
+ 401: components["responses"]["Unauthorized"];
29287
+ /**
29288
+ * @description Your account does not own or manage this company, or does not hold the required
29289
+ * access over it. A company that does not exist answers the same way.
29290
+ * That case answers `error.code` `ACTIVE_COMPANY_NOT_ACCESSIBLE`.
29291
+ */
29292
+ 403: {
29293
+ headers: {
29294
+ [name: string]: unknown;
29295
+ };
29296
+ content: {
29297
+ "application/json": components["schemas"]["ErrorResponse"];
29298
+ };
29299
+ };
29300
+ /** @description `CUSTOM_FIELD_NOT_FOUND` — this company has no custom field with this `key` in the environment of the credential. Test and Live keep separate catalogues. */
29301
+ 404: {
29302
+ headers: {
29303
+ [name: string]: unknown;
29304
+ };
29305
+ content: {
29306
+ "application/json": components["schemas"]["ErrorResponse"];
29307
+ };
29308
+ };
29309
+ 422: components["responses"]["UnprocessableQueryParameter"];
29310
+ 429: components["responses"]["TooManyRequests"];
29311
+ 500: components["responses"]["InternalServerError"];
29312
+ default: components["responses"]["UnexpectedError"];
29313
+ };
29314
+ };
29315
+ createCompanyCustomFieldOption: {
29316
+ parameters: {
29317
+ query?: never;
29318
+ header?: {
29319
+ /**
29320
+ * @description Idempotency key to prevent duplicates in sensitive operations.
29321
+ *
29322
+ * - Any unique client-generated string (e.g. an order id). A UUID also works but is not required
29323
+ * - Allowed characters: letters, digits, `_` and `-` (max 255 chars)
29324
+ * - Retrying with the same key replays the first response when it was a success (2xx) or a
29325
+ * server error (5xx): same status and body, plus the header `Idempotency-Replay: true`.
29326
+ * After a 5xx, check whether the operation took effect before retrying with a **new** key
29327
+ * - A 4xx is not stored: the key is released, so the corrected request can reuse it
29328
+ * - Stored responses expire 24 hours after processing
29329
+ *
29330
+ * The key is scoped per user and environment, and bound to the request body, so retrying after
29331
+ * a network timeout replays the stored response instead of repeating the operation.
29332
+ *
29333
+ * | Status | Code | When |
29334
+ * |---|---|---|
29335
+ * | `400` | `INVALID_IDEMPOTENCY_KEY` | The key breaks the format rules above. |
29336
+ * | `409` | `IDEMPOTENCY_KEY_PROCESSING` | The first request is still in flight. Wait for the `Retry-After` seconds (2) and retry with the same key. |
29337
+ * | `409` | `IDEMPOTENCY_KEY_MISMATCH` | The key was already used with a **different** body. Use a new key. |
29338
+ * @example invoice-order-12345
29339
+ */
29340
+ "Idempotency-Key"?: components["parameters"]["IdempotencyKeyHeader"];
29341
+ };
29342
+ path: {
29343
+ /** @description Unique identifier (UUID) of the company the operation acts on — its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
29344
+ company_id: string;
29345
+ /** @description Key of the custom field: lowercase letters, digits and `_`, up to 64 characters. A key outside that format answers `422`. */
29346
+ key: components["schemas"]["CustomFieldKey"];
29347
+ };
29348
+ cookie?: never;
29349
+ };
29350
+ requestBody: {
29351
+ content: {
29352
+ "application/json": components["schemas"]["CreateCustomFieldOptionRequest"];
29353
+ };
29354
+ };
29355
+ responses: {
29356
+ /** @description An equivalent option already existed; this is that option, unchanged. */
29357
+ 200: {
29358
+ headers: {
29359
+ [name: string]: unknown;
29360
+ };
29361
+ content: {
29362
+ "application/json": components["schemas"]["CustomFieldOptionResponse"];
29363
+ };
29364
+ };
29365
+ /** @description The option was created. */
29366
+ 201: {
29367
+ headers: {
29368
+ Location: components["headers"]["CreatedResourceLocation"];
29369
+ [name: string]: unknown;
29370
+ };
29371
+ content: {
29372
+ "application/json": components["schemas"]["CustomFieldOptionResponse"];
29373
+ };
29374
+ };
29375
+ 400: components["responses"]["BadRequest"];
29376
+ 401: components["responses"]["Unauthorized"];
29377
+ /**
29378
+ * @description Your account does not own or manage this company, or does not hold the required
29379
+ * access over it. A company that does not exist answers the same way.
29380
+ * That case answers `error.code` `ACTIVE_COMPANY_NOT_ACCESSIBLE`.
29381
+ */
29382
+ 403: {
29383
+ headers: {
29384
+ [name: string]: unknown;
29385
+ };
29386
+ content: {
29387
+ "application/json": components["schemas"]["ErrorResponse"];
29388
+ };
29389
+ };
29390
+ /** @description Two causes, told apart by `error.code`: `CUSTOM_FIELD_NOT_FOUND` (this company has no custom field with this `key`) and `INVOICE_CLIENT_NOT_FOUND` (the `customer_id` of the body is not a customer of this company, or was deleted). */
29391
+ 404: {
29392
+ headers: {
29393
+ [name: string]: unknown;
29394
+ };
29395
+ content: {
29396
+ "application/json": components["schemas"]["ErrorResponse"];
29397
+ };
29398
+ };
29399
+ 409: components["responses"]["StateConflict"];
29400
+ 422: components["responses"]["ValidationError"];
29401
+ 429: components["responses"]["TooManyRequests"];
29402
+ 500: components["responses"]["InternalServerError"];
29403
+ default: components["responses"]["UnexpectedError"];
29404
+ };
29405
+ };
29406
+ getCompanyCustomFieldOption: {
29407
+ parameters: {
29408
+ query?: never;
29409
+ header?: never;
29410
+ path: {
29411
+ /** @description Unique identifier (UUID) of the company the operation acts on — its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
29412
+ company_id: string;
29413
+ /** @description Key of the custom field: lowercase letters, digits and `_`, up to 64 characters. A key outside that format answers `422`. */
29414
+ key: components["schemas"]["CustomFieldKey"];
29415
+ /** @description Unique identifier of the option. */
29416
+ option_id: string;
29417
+ };
29418
+ cookie?: never;
29419
+ };
29420
+ requestBody?: never;
29421
+ responses: {
29422
+ /** @description The option. */
29423
+ 200: {
29424
+ headers: {
29425
+ [name: string]: unknown;
29426
+ };
29427
+ content: {
29428
+ "application/json": components["schemas"]["CustomFieldOptionResponse"];
29429
+ };
29430
+ };
29431
+ 400: components["responses"]["InvalidRequestTarget"];
29432
+ 401: components["responses"]["Unauthorized"];
29433
+ /**
29434
+ * @description Your account does not own or manage this company, or does not hold the required
29435
+ * access over it. A company that does not exist answers the same way.
29436
+ * That case answers `error.code` `ACTIVE_COMPANY_NOT_ACCESSIBLE`.
29437
+ */
29438
+ 403: {
29439
+ headers: {
29440
+ [name: string]: unknown;
29441
+ };
29442
+ content: {
29443
+ "application/json": components["schemas"]["ErrorResponse"];
29444
+ };
29445
+ };
29446
+ /** @description Two causes, told apart by `error.code`: `CUSTOM_FIELD_NOT_FOUND` (this company has no custom field with this `key`) and `CUSTOM_FIELD_OPTION_NOT_FOUND` (the field has no option with this `option_id`; an option of another field answers the same way). */
29447
+ 404: {
29448
+ headers: {
29449
+ [name: string]: unknown;
29450
+ };
29451
+ content: {
29452
+ "application/json": components["schemas"]["ErrorResponse"];
29453
+ };
29454
+ };
29455
+ 422: components["responses"]["UnprocessableQueryParameter"];
29456
+ 429: components["responses"]["TooManyRequests"];
29457
+ 500: components["responses"]["InternalServerError"];
29458
+ default: components["responses"]["UnexpectedError"];
29459
+ };
29460
+ };
29461
+ patchCompanyCustomFieldOption: {
29462
+ parameters: {
29463
+ query?: never;
29464
+ header?: {
29465
+ /**
29466
+ * @description Idempotency key to prevent duplicates in sensitive operations.
29467
+ *
29468
+ * - Any unique client-generated string (e.g. an order id). A UUID also works but is not required
29469
+ * - Allowed characters: letters, digits, `_` and `-` (max 255 chars)
29470
+ * - Retrying with the same key replays the first response when it was a success (2xx) or a
29471
+ * server error (5xx): same status and body, plus the header `Idempotency-Replay: true`.
29472
+ * After a 5xx, check whether the operation took effect before retrying with a **new** key
29473
+ * - A 4xx is not stored: the key is released, so the corrected request can reuse it
29474
+ * - Stored responses expire 24 hours after processing
29475
+ *
29476
+ * The key is scoped per user and environment, and bound to the request body, so retrying after
29477
+ * a network timeout replays the stored response instead of repeating the operation.
29478
+ *
29479
+ * | Status | Code | When |
29480
+ * |---|---|---|
29481
+ * | `400` | `INVALID_IDEMPOTENCY_KEY` | The key breaks the format rules above. |
29482
+ * | `409` | `IDEMPOTENCY_KEY_PROCESSING` | The first request is still in flight. Wait for the `Retry-After` seconds (2) and retry with the same key. |
29483
+ * | `409` | `IDEMPOTENCY_KEY_MISMATCH` | The key was already used with a **different** body. Use a new key. |
29484
+ * @example invoice-order-12345
29485
+ */
29486
+ "Idempotency-Key"?: components["parameters"]["IdempotencyKeyHeader"];
29487
+ };
29488
+ path: {
29489
+ /** @description Unique identifier (UUID) of the company the operation acts on — its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. */
29490
+ company_id: string;
29491
+ /** @description Key of the custom field: lowercase letters, digits and `_`, up to 64 characters. A key outside that format answers `422`. */
29492
+ key: components["schemas"]["CustomFieldKey"];
29493
+ /** @description Unique identifier of the option. */
29494
+ option_id: string;
29495
+ };
29496
+ cookie?: never;
29497
+ };
29498
+ requestBody: {
29499
+ content: {
29500
+ "application/json": components["schemas"]["PatchCustomFieldOptionRequest"];
29501
+ };
29502
+ };
29503
+ responses: {
29504
+ /** @description The option, updated. */
29505
+ 200: {
29506
+ headers: {
29507
+ [name: string]: unknown;
29508
+ };
29509
+ content: {
29510
+ "application/json": components["schemas"]["CustomFieldOptionResponse"];
29511
+ };
29512
+ };
29513
+ 400: components["responses"]["BadRequest"];
29514
+ 401: components["responses"]["Unauthorized"];
29515
+ /**
29516
+ * @description Your account does not own or manage this company, or does not hold the required
29517
+ * access over it. A company that does not exist answers the same way.
29518
+ * That case answers `error.code` `ACTIVE_COMPANY_NOT_ACCESSIBLE`.
29519
+ */
29520
+ 403: {
29521
+ headers: {
29522
+ [name: string]: unknown;
29523
+ };
29524
+ content: {
29525
+ "application/json": components["schemas"]["ErrorResponse"];
29526
+ };
29527
+ };
29528
+ /** @description Two causes, told apart by `error.code`: `CUSTOM_FIELD_NOT_FOUND` (this company has no custom field with this `key`) and `CUSTOM_FIELD_OPTION_NOT_FOUND` (the field has no option with this `option_id`; an option of another field answers the same way). */
29529
+ 404: {
29530
+ headers: {
29531
+ [name: string]: unknown;
29532
+ };
29533
+ content: {
29534
+ "application/json": components["schemas"]["ErrorResponse"];
29535
+ };
29536
+ };
29537
+ /**
29538
+ * @description `CUSTOM_FIELD_OPTION_DUPLICATE` — another option of this field in the same scope is
29539
+ * equivalent to the new `value`, archived or not; nothing changed. Use that option
29540
+ * instead, reactivating it if it is archived.
29541
+ * The idempotency codes of `StateConflict` (`IDEMPOTENCY_KEY_PROCESSING`,
29542
+ * `IDEMPOTENCY_KEY_MISMATCH`) and `CONCURRENT_MODIFICATION` share this status.
29543
+ */
29544
+ 409: {
29545
+ headers: {
29546
+ [name: string]: unknown;
29547
+ };
29548
+ content: {
29549
+ /**
29550
+ * @example {
29551
+ * "success": false,
29552
+ * "error": {
29553
+ * "code": "CUSTOM_FIELD_OPTION_DUPLICATE",
29554
+ * "message": "This field already has an equivalent option",
29555
+ * "details": {}
29556
+ * },
29557
+ * "meta": {
29558
+ * "timestamp": "2026-10-17T10:30:00Z",
29559
+ * "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
29560
+ * }
29561
+ * }
29562
+ */
29563
+ "application/json": components["schemas"]["ErrorResponse"];
29564
+ };
29565
+ };
29566
+ 422: components["responses"]["ValidationError"];
29567
+ 429: components["responses"]["TooManyRequests"];
29568
+ 500: components["responses"]["InternalServerError"];
29569
+ default: components["responses"]["UnexpectedError"];
29570
+ };
29571
+ };
28363
29572
  listAccountMembers: {
28364
29573
  parameters: {
28365
29574
  query?: {
@@ -35223,6 +36432,7 @@ declare class InvoicesResource {
35223
36432
  id: string;
35224
36433
  created_at: string;
35225
36434
  updated_at: string;
36435
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
35226
36436
  }>;
35227
36437
  /**
35228
36438
  * Get an invoice by ID.
@@ -35280,6 +36490,7 @@ declare class InvoicesResource {
35280
36490
  id: string;
35281
36491
  created_at: string;
35282
36492
  updated_at: string;
36493
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
35283
36494
  }>;
35284
36495
  /**
35285
36496
  * Update a draft invoice. Only draft invoices can be updated.
@@ -35338,6 +36549,7 @@ declare class InvoicesResource {
35338
36549
  id: string;
35339
36550
  created_at: string;
35340
36551
  updated_at: string;
36552
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
35341
36553
  }>;
35342
36554
  /**
35343
36555
  * Delete a draft invoice. Only draft invoices can be deleted.
@@ -35405,6 +36617,7 @@ declare class InvoicesResource {
35405
36617
  id: string;
35406
36618
  created_at: string;
35407
36619
  updated_at: string;
36620
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
35408
36621
  }>;
35409
36622
  /**
35410
36623
  * Issue a draft invoice. Assigns an invoice number and triggers VeriFactu submission.
@@ -35465,6 +36678,7 @@ declare class InvoicesResource {
35465
36678
  id: string;
35466
36679
  created_at: string;
35467
36680
  updated_at: string;
36681
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
35468
36682
  }>;
35469
36683
  /**
35470
36684
  * Mark an invoice as paid.
@@ -35526,6 +36740,7 @@ declare class InvoicesResource {
35526
36740
  id: string;
35527
36741
  created_at: string;
35528
36742
  updated_at: string;
36743
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
35529
36744
  }>;
35530
36745
  /**
35531
36746
  * Mark an invoice as sent (e.g. delivered by other means).
@@ -35586,6 +36801,7 @@ declare class InvoicesResource {
35586
36801
  id: string;
35587
36802
  created_at: string;
35588
36803
  updated_at: string;
36804
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
35589
36805
  }>;
35590
36806
  /**
35591
36807
  * Revert a paid/sent invoice back to issued status.
@@ -35643,6 +36859,7 @@ declare class InvoicesResource {
35643
36859
  id: string;
35644
36860
  created_at: string;
35645
36861
  updated_at: string;
36862
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
35646
36863
  }>;
35647
36864
  /**
35648
36865
  * Void an issued invoice. Requires a reason (min 10 chars).
@@ -35707,6 +36924,7 @@ declare class InvoicesResource {
35707
36924
  id: string;
35708
36925
  created_at: string;
35709
36926
  updated_at: string;
36927
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
35710
36928
  }>;
35711
36929
  /**
35712
36930
  * Create a corrective invoice that references the original.
@@ -35765,6 +36983,7 @@ declare class InvoicesResource {
35765
36983
  id: string;
35766
36984
  created_at: string;
35767
36985
  updated_at: string;
36986
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
35768
36987
  }>;
35769
36988
  /**
35770
36989
  * Schedule a draft invoice to be issued on a future date.
@@ -35826,6 +37045,7 @@ declare class InvoicesResource {
35826
37045
  id: string;
35827
37046
  created_at: string;
35828
37047
  updated_at: string;
37048
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
35829
37049
  }>;
35830
37050
  /**
35831
37051
  * Cancel a scheduled invoice, returning it to draft.
@@ -35883,6 +37103,7 @@ declare class InvoicesResource {
35883
37103
  id: string;
35884
37104
  created_at: string;
35885
37105
  updated_at: string;
37106
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
35886
37107
  }>;
35887
37108
  /**
35888
37109
  * Change the scheduled date of a scheduled invoice.
@@ -35943,6 +37164,7 @@ declare class InvoicesResource {
35943
37164
  id: string;
35944
37165
  created_at: string;
35945
37166
  updated_at: string;
37167
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
35946
37168
  }>;
35947
37169
  /**
35948
37170
  * Get a pre-signed URL to download the invoice PDF.
@@ -37869,6 +39091,7 @@ declare class CompanyInvoicesResource {
37869
39091
  id: string;
37870
39092
  created_at: string;
37871
39093
  updated_at: string;
39094
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
37872
39095
  }>;
37873
39096
  private path;
37874
39097
  /**
@@ -37965,6 +39188,7 @@ declare class CompanyInvoicesResource {
37965
39188
  id: string;
37966
39189
  created_at: string;
37967
39190
  updated_at: string;
39191
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
37968
39192
  }>;
37969
39193
  /**
37970
39194
  * Create a standard or simplified invoice once per `external_ref`, safe to call again
@@ -38049,6 +39273,7 @@ declare class CompanyInvoicesResource {
38049
39273
  id: string;
38050
39274
  created_at: string;
38051
39275
  updated_at: string;
39276
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
38052
39277
  }>;
38053
39278
  /**
38054
39279
  * Get one invoice, including its `status` and its `verifactu` block
@@ -38108,6 +39333,7 @@ declare class CompanyInvoicesResource {
38108
39333
  id: string;
38109
39334
  created_at: string;
38110
39335
  updated_at: string;
39336
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
38111
39337
  }>;
38112
39338
  /**
38113
39339
  * Update a `DRAFT` or `SCHEDULED` invoice (or an `ACTIVE` proforma). Only the fields
@@ -38168,6 +39394,7 @@ declare class CompanyInvoicesResource {
38168
39394
  id: string;
38169
39395
  created_at: string;
38170
39396
  updated_at: string;
39397
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
38171
39398
  }>;
38172
39399
  /**
38173
39400
  * Delete a draft invoice. Deleting frees its `external_ref` for a new invoice.
@@ -38235,6 +39462,7 @@ declare class CompanyInvoicesResource {
38235
39462
  id: string;
38236
39463
  created_at: string;
38237
39464
  updated_at: string;
39465
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
38238
39466
  }>;
38239
39467
  /**
38240
39468
  * Void an invoice issued by mistake. The document is kept and its number never reused. If
@@ -38295,6 +39523,7 @@ declare class CompanyInvoicesResource {
38295
39523
  id: string;
38296
39524
  created_at: string;
38297
39525
  updated_at: string;
39526
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
38298
39527
  }>;
38299
39528
  /**
38300
39529
  * Create a corrective invoice (rectificativa) for an issued invoice.
@@ -38366,6 +39595,7 @@ declare class CompanyInvoicesResource {
38366
39595
  id: string;
38367
39596
  created_at: string;
38368
39597
  updated_at: string;
39598
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
38369
39599
  }>;
38370
39600
  /**
38371
39601
  * Convert a proforma into an invoice.
@@ -38425,6 +39655,7 @@ declare class CompanyInvoicesResource {
38425
39655
  id: string;
38426
39656
  created_at: string;
38427
39657
  updated_at: string;
39658
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
38428
39659
  }>;
38429
39660
  /**
38430
39661
  * Issue a full invoice in exchange for one or more issued simplified invoices, when the
@@ -38494,6 +39725,7 @@ declare class CompanyInvoicesResource {
38494
39725
  id: string;
38495
39726
  created_at: string;
38496
39727
  updated_at: string;
39728
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
38497
39729
  }>;
38498
39730
  /**
38499
39731
  * The VeriFactu records of an invoice, oldest first: its registration and, if it was
@@ -38573,6 +39805,7 @@ declare class CompanyInvoicesResource {
38573
39805
  id: string;
38574
39806
  created_at: string;
38575
39807
  updated_at: string;
39808
+ custom_fields: components["schemas"]["InvoiceCustomField"][];
38576
39809
  }>;
38577
39810
  /**
38578
39811
  * Get a short-lived download URL for the invoice PDF.
@@ -38811,6 +40044,11 @@ declare class CompanyInvoiceScheduleResource {
38811
40044
  id: string;
38812
40045
  created_at: string;
38813
40046
  updated_at: string;
40047
+ custom_fields: {
40048
+ key: components["schemas"]["CustomFieldKey"];
40049
+ label: string;
40050
+ value: string;
40051
+ }[];
38814
40052
  } | undefined>;
38815
40053
  /**
38816
40054
  * Clear the schedule, returning the invoice to a plain draft — the canonical form of
@@ -39309,6 +40547,11 @@ declare class CompanyRecurringInvoicesResource {
39309
40547
  payment_swift?: string | null | undefined;
39310
40548
  payment_term_days?: number | null | undefined;
39311
40549
  notes?: string | null | undefined;
40550
+ custom_fields: {
40551
+ key: components["schemas"]["CustomFieldKey"];
40552
+ label: string;
40553
+ value: string;
40554
+ }[];
39312
40555
  send_automatically?: boolean | undefined;
39313
40556
  email_configuration?: {
39314
40557
  recipients?: string[] | undefined;
@@ -39395,6 +40638,11 @@ declare class CompanyRecurringInvoicesResource {
39395
40638
  payment_swift?: string | null | undefined;
39396
40639
  payment_term_days?: number | null | undefined;
39397
40640
  notes?: string | null | undefined;
40641
+ custom_fields: {
40642
+ key: components["schemas"]["CustomFieldKey"];
40643
+ label: string;
40644
+ value: string;
40645
+ }[];
39398
40646
  send_automatically?: boolean | undefined;
39399
40647
  email_configuration?: {
39400
40648
  recipients?: string[] | undefined;
@@ -39472,6 +40720,11 @@ declare class CompanyRecurringInvoicesResource {
39472
40720
  payment_swift?: string | null | undefined;
39473
40721
  payment_term_days?: number | null | undefined;
39474
40722
  notes?: string | null | undefined;
40723
+ custom_fields: {
40724
+ key: components["schemas"]["CustomFieldKey"];
40725
+ label: string;
40726
+ value: string;
40727
+ }[];
39475
40728
  send_automatically?: boolean | undefined;
39476
40729
  email_configuration?: {
39477
40730
  recipients?: string[] | undefined;
@@ -39550,6 +40803,11 @@ declare class CompanyRecurringInvoicesResource {
39550
40803
  payment_swift?: string | null | undefined;
39551
40804
  payment_term_days?: number | null | undefined;
39552
40805
  notes?: string | null | undefined;
40806
+ custom_fields: {
40807
+ key: components["schemas"]["CustomFieldKey"];
40808
+ label: string;
40809
+ value: string;
40810
+ }[];
39553
40811
  send_automatically?: boolean | undefined;
39554
40812
  email_configuration?: {
39555
40813
  recipients?: string[] | undefined;
@@ -39635,6 +40893,11 @@ declare class CompanyRecurringInvoicesResource {
39635
40893
  payment_swift?: string | null | undefined;
39636
40894
  payment_term_days?: number | null | undefined;
39637
40895
  notes?: string | null | undefined;
40896
+ custom_fields: {
40897
+ key: components["schemas"]["CustomFieldKey"];
40898
+ label: string;
40899
+ value: string;
40900
+ }[];
39638
40901
  send_automatically?: boolean | undefined;
39639
40902
  email_configuration?: {
39640
40903
  recipients?: string[] | undefined;
@@ -39712,6 +40975,11 @@ declare class CompanyRecurringInvoicesResource {
39712
40975
  payment_swift?: string | null | undefined;
39713
40976
  payment_term_days?: number | null | undefined;
39714
40977
  notes?: string | null | undefined;
40978
+ custom_fields: {
40979
+ key: components["schemas"]["CustomFieldKey"];
40980
+ label: string;
40981
+ value: string;
40982
+ }[];
39715
40983
  send_automatically?: boolean | undefined;
39716
40984
  email_configuration?: {
39717
40985
  recipients?: string[] | undefined;
@@ -39921,6 +41189,11 @@ declare class CompanyRecurringInvoicesResource {
39921
41189
  reason?: string | null | undefined;
39922
41190
  } | undefined;
39923
41191
  deleted_at?: string | null | undefined;
41192
+ custom_fields: {
41193
+ key: components["schemas"]["CustomFieldKey"];
41194
+ label: string;
41195
+ value: string;
41196
+ }[];
39924
41197
  } | undefined>;
39925
41198
  /**
39926
41199
  * The generation history of the template: generated, skipped and failed occurrences.