# Update the payment connection settings of a NIF API Reference

Updates the auto-invoicing settings of the payment connection named by `{connection_id}` of a
company your account **owns or manages**.

- **Partial by field:** a field you omit keeps its current value. The series fields also
  accept an explicit `null`, which clears the series and falls back to the company default
  for that document type. `filter_config` is the exception: when sent, it **replaces the
  whole object**, not just the sub-fields you included — a partial `filter_config` clears
  every filter axis you left out.
- **Read-only fields:** `id`, `provider`, `status`, `environment`, `external_account_id`,
  `connected_at`, `last_event_at` and `active_filters` are not part of this request and are
  ignored if sent. `status` moves through the disconnect operation, never here.
- **Series:** each one must exist, be active, belong to this NIF and carry a compatible
  document type, or the request answers `422`.


## PATCH /v1/companies/{company_id}/payment-connections/{connection_id}

**Update the payment connection settings of a NIF**

Updates the auto-invoicing settings of the payment connection named by `{connection_id}` of a
company your account **owns or manages**.

- **Partial by field:** a field you omit keeps its current value. The series fields also
  accept an explicit `null`, which clears the series and falls back to the company default
  for that document type. `filter_config` is the exception: when sent, it **replaces the
  whole object**, not just the sub-fields you included — a partial `filter_config` clears
  every filter axis you left out.
- **Read-only fields:** `id`, `provider`, `status`, `environment`, `external_account_id`,
  `connected_at`, `last_event_at` and `active_filters` are not part of this request and are
  ignored if sent. `status` moves through the disconnect operation, never here.
- **Series:** each one must exist, be active, belong to this NIF and carry a compatible
  document type, or the request answers `422`.

### Authentication

Accepts any of:

- `ApiKeyAuth` (HTTP bearer, token format `beel_sk_*`)

### Parameters

- **company_id** (required) in path `string`: 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.
- **connection_id** (required) in path `string`: Unique identifier (UUID) of the payment connection the operation acts on, as returned by `GET /v1/companies/{company_id}/payment-connections`. A NIF can hold several connections of the same provider, so the provider slug alone does not name one. A connection of another NIF answers `404`, exactly like one that does not exist.
- **Idempotency-Key** (optional) in header `string`: Idempotency key to prevent duplicates in sensitive operations. - Any unique client-generated string (e.g. an order id). A UUID also works but is not required - Allowed characters: letters, digits, `_` and `-` (max 255 chars) - Retrying with the same key replays the first response when it was a success (2xx) or a server error (5xx): same status and body, plus the header `Idempotency-Replay: true`. After a 5xx other than 503, check whether the operation took effect before retrying with a **new** key - After a `503`, retry first with the **same** key. If the response carries `Idempotency-Replay: true`, the operation may have taken effect: check the resource before using a new key. Without that header, the retry runs the operation once - A 4xx is not stored: the key is released, so the corrected request can reuse it - Stored responses expire 24 hours after processing The key is scoped per user and environment, and bound to the request body, so retrying after a network timeout replays the stored response instead of repeating the operation. | Status | Code | When | |---|---|---| | `400` | `INVALID_IDEMPOTENCY_KEY` | The key breaks the format rules above. | | `409` | `IDEMPOTENCY_KEY_PROCESSING` | The first request is still in flight. Wait for the `Retry-After` seconds (2) and retry with the same key. | | `409` | `IDEMPOTENCY_KEY_MISMATCH` | The key was already used with a **different** body. Use a new key. |

### Request Body

Required.

**Content `application/json`:**

- **auto_invoice_enabled** `boolean`: Whether incoming charges are auto-invoiced.
- **event_source**: Which family of Stripe events this connection acts on. Changing it affects the events that arrive from then on; events already recorded keep their outcome.
- **auto_create_customer** `boolean`: Whether customers are created from the fiscal data the provider supplies.
- **send_invoice_by_email** `boolean`: Whether the auto-issued invoice is emailed to the payer.
- **tax_inclusive_tax**: Optional. The tax applied to a charge for which the provider sends no tax breakdown; when set, it takes precedence over the company's tax configuration for those charges. Omit it to keep the current value; send `null` to clear it, so the company's tax configuration applies again.
- **series** `UpdateCompanyPaymentConnectionSeries`: Series to number auto-issued invoices in. Omit a field to keep it, send `null` to clear it and fall back to the company default series for that document type.
- **simplificada_threshold** `number` (double): Amount in EUR up to which a charge whose buyer has no complete fiscal data (tax ID, name and address) is invoiced as a simplified invoice. Above it, the charge is not issued: it waits as a draft standard invoice until the buyer's fiscal data is completed. A buyer with complete fiscal data always gets a standard invoice, whatever the amount. Up to 400.00 is the general limit; a higher value, up to 3000.00, is the issuer's statement that its activity is one of those in article 4.2 of RD 1619/2012 (rule SIM-002). Omit to keep the current value.
- **filter_config**: Omit to keep the current filter configuration untouched. When sent, it **replaces the whole object** — every axis you leave out is cleared, not preserved. Send the complete configuration you want, not just the axis you are changing.

**Example `update_payment_connection_settings`** — Invoice payments automatically, skipping refunds:

```json
{
  "auto_invoice_enabled": true,
  "event_source": "PAYMENTS",
  "auto_create_customer": true,
  "send_invoice_by_email": true,
  "tax_inclusive_tax": {
    "type": "IVA",
    "percentage": 21,
    "regime_key": "01"
  },
  "filter_config": {
    "min_amount": 1,
    "disabled_categories": [
      "REFUND"
    ]
  }
}
```

### Responses

#### 200: Connection updated

**Content `application/json`:**

- **success** `boolean`: No description
- **data** `CompanyPaymentConnection`: A payment provider connection of a NIF with the settings that decide what BeeL does with each incoming charge. Credentials of the provider are never part of this document.
- **meta** `ResponseMeta`

#### 401: Missing or invalid authentication. Like every other error, `message`/`detail` is
localized according to `Accept-Language` (`es`, `en`, `ca`); defaults to English when the
header is missing or asks for none of those.


**Content `application/json`:**

- **success** (required) `boolean`: No description (example: false)
- **error** (required) `ErrorDetail`
- **meta** `ResponseMeta`
- **type** `string` (uri): Stable URI that identifies the problem type and where the integrator will find its documentation. (example: "https://docs.beel.es/errors/INVOICE_NO_LINES")
- **title** `string`: Short summary of the problem type. Stable between occurrences of the same `type`. (example: "INVOICE_NO_LINES")
- **detail** `string`: Specific message for this occurrence, localized according to `Accept-Language` (`es`, `en`, `ca`); defaults to English. Matches the legacy `error.message`. (example: "The invoice must have at least one line")
- **instance** `string` (uri-reference): URI that identifies the specific occurrence of the problem — typically the path of the affected resource. (example: "/v1/invoices/abc-123")

**Example:**

```json
{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Authentication is required to access this resource"
  },
  "meta": {
    "timestamp": "2025-01-15T10:30:00Z",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}
```

#### 403: Your account does not own or manage this company. The same answer is given for a
NIF that does not exist. Nothing is updated.
That case answers `error.code` `ACTIVE_COMPANY_NOT_ACCESSIBLE`.


**Content `application/json`:**

- **success** (required) `boolean`: No description (example: false)
- **error** (required) `ErrorDetail`
- **meta** `ResponseMeta`
- **type** `string` (uri): Stable URI that identifies the problem type and where the integrator will find its documentation. (example: "https://docs.beel.es/errors/INVOICE_NO_LINES")
- **title** `string`: Short summary of the problem type. Stable between occurrences of the same `type`. (example: "INVOICE_NO_LINES")
- **detail** `string`: Specific message for this occurrence, localized according to `Accept-Language` (`es`, `en`, `ca`); defaults to English. Matches the legacy `error.message`. (example: "The invoice must have at least one line")
- **instance** `string` (uri-reference): URI that identifies the specific occurrence of the problem — typically the path of the affected resource. (example: "/v1/invoices/abc-123")

#### 404: `CONNECTION_NOT_FOUND` — no connection of this NIF carries this `{connection_id}`. It speaks of the connection, never of the NIF: a NIF you cannot reach answers `403`, while a connection of another NIF answers this same `404` so that naming it reveals nothing.

**Content `application/json`:**

- **success** (required) `boolean`: No description (example: false)
- **error** (required) `ErrorDetail`
- **meta** `ResponseMeta`
- **type** `string` (uri): Stable URI that identifies the problem type and where the integrator will find its documentation. (example: "https://docs.beel.es/errors/INVOICE_NO_LINES")
- **title** `string`: Short summary of the problem type. Stable between occurrences of the same `type`. (example: "INVOICE_NO_LINES")
- **detail** `string`: Specific message for this occurrence, localized according to `Accept-Language` (`es`, `en`, `ca`); defaults to English. Matches the legacy `error.message`. (example: "The invoice must have at least one line")
- **instance** `string` (uri-reference): URI that identifies the specific occurrence of the problem — typically the path of the affected resource. (example: "/v1/invoices/abc-123")

**Example:**

```json
{
  "success": false,
  "error": {
    "code": "CONNECTION_NOT_FOUND",
    "message": "Payment connection not found"
  },
  "meta": {
    "timestamp": "2025-01-15T10:30:00Z",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}
```

#### 422: A setting is not acceptable, and nothing is updated. Branch on `error.code`:

- `CONNECTION_SERIE_NOT_FOUND` — a series in `series` does not exist or belongs to
  another NIF.
- `CONNECTION_SERIE_INACTIVE` — the series exists but is inactive.
- `CONNECTION_SERIE_TIPO_INCOMPATIBLE` — the series' document type does not fit the
  slot it was sent for.
- `FILTER_PATTERNS_TOO_MANY` — more than 20 patterns in one of
  `excluded_description_patterns` or `required_description_patterns`.
- `FILTER_PATTERN_TOO_LONG` — a pattern over 200 characters.
- `FILTER_PATTERN_INVALID` — a pattern that is not a valid regular expression.
- `FILTER_CATEGORY_NOT_ACTIONABLE` — `disabled_categories` names `REFUND` or
  `CREDIT_NOTE`, which the rules never evaluate, so disabling them would do nothing.
- `VALIDATION_ERROR` — a field breaks its declared constraint.


**Content `application/json`:**

- **success** (required) `boolean`: No description (example: false)
- **error** (required) `ErrorDetail`
- **meta** `ResponseMeta`
- **type** `string` (uri): Stable URI that identifies the problem type and where the integrator will find its documentation. (example: "https://docs.beel.es/errors/INVOICE_NO_LINES")
- **title** `string`: Short summary of the problem type. Stable between occurrences of the same `type`. (example: "INVOICE_NO_LINES")
- **detail** `string`: Specific message for this occurrence, localized according to `Accept-Language` (`es`, `en`, `ca`); defaults to English. Matches the legacy `error.message`. (example: "The invoice must have at least one line")
- **instance** `string` (uri-reference): URI that identifies the specific occurrence of the problem — typically the path of the affected resource. (example: "/v1/invoices/abc-123")

#### 429: Rate limit exceeded. `RATE_LIMIT_EXCEEDED` when the request rate of your credential is
over its limit; `TOO_MANY_REQUESTS` when an email the operation sends is held back because
too many went out to that recipient in a short time. Either way, retry after the
`Retry-After` seconds.

`QUOTA_EXCEEDED` is the other `429`: the operation would go over a quota of your plan
for the current period (issued invoices, for instance). Retrying does not help until the
quota resets or the plan changes. `error.details` carries `feature_code`,
`current_usage`, `quota_limit` and `reset_date`, and `RateLimit-Reset` the seconds until
the reset when it is known.


**Headers:**

- `Retry-After` `integer`: Seconds until the rate limit resets
- `RateLimit-Limit` `integer`: Maximum requests allowed in the window
- `RateLimit-Remaining` `integer`: Remaining requests in the current window
- `RateLimit-Reset` `integer`: Seconds until the current window resets

**Content `application/json`:**

- **success** (required) `boolean`: No description (example: false)
- **error** (required) `ErrorDetail`
- **meta** `ResponseMeta`
- **type** `string` (uri): Stable URI that identifies the problem type and where the integrator will find its documentation. (example: "https://docs.beel.es/errors/INVOICE_NO_LINES")
- **title** `string`: Short summary of the problem type. Stable between occurrences of the same `type`. (example: "INVOICE_NO_LINES")
- **detail** `string`: Specific message for this occurrence, localized according to `Accept-Language` (`es`, `en`, `ca`); defaults to English. Matches the legacy `error.message`. (example: "The invoice must have at least one line")
- **instance** `string` (uri-reference): URI that identifies the specific occurrence of the problem — typically the path of the affected resource. (example: "/v1/invoices/abc-123")

**Example:**

```json
{
  "success": false,
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Too many requests. Please try again in 60 seconds."
  },
  "meta": {
    "timestamp": "2025-01-15T10:30:00Z",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}
```

#### 500: Internal server error

**Content `application/json`:**

- **success** (required) `boolean`: No description (example: false)
- **error** (required) `ErrorDetail`
- **meta** `ResponseMeta`
- **type** `string` (uri): Stable URI that identifies the problem type and where the integrator will find its documentation. (example: "https://docs.beel.es/errors/INVOICE_NO_LINES")
- **title** `string`: Short summary of the problem type. Stable between occurrences of the same `type`. (example: "INVOICE_NO_LINES")
- **detail** `string`: Specific message for this occurrence, localized according to `Accept-Language` (`es`, `en`, `ca`); defaults to English. Matches the legacy `error.message`. (example: "The invoice must have at least one line")
- **instance** `string` (uri-reference): URI that identifies the specific occurrence of the problem — typically the path of the affected resource. (example: "/v1/invoices/abc-123")

**Example:**

```json
{
  "success": false,
  "error": {
    "code": "INTERNAL_ERROR",
    "message": "Internal server error"
  },
  "meta": {
    "timestamp": "2025-01-15T10:30:00Z",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}
```

#### default: Any status code the operation does not list above. Every operation declares it, so a
generated client always has a branch to fall into and never loses the cause of a failure
it did not anticipate.

This is where the transport-level answers land — `405`, `406`, `415` and `429` — together
with any status a future version of the API starts returning. All of them carry the same
error envelope as the codes listed explicitly, so `error.code` is what tells them apart:
switching on the status code alone is not enough. See «Transport-level errors» in the
API description for when each one is produced.

A `402` carrying `SUBSCRIPTION_REQUIRED` lands here when the account has no active
subscription. `error.details` says why and what to do: `current_status` (absent if it
never had one), `required_permission` and `action`.

A `503` carrying `SERVICE_UNAVAILABLE` lands here too, with a `Retry-After` header: a
dependency of BeeL itself (the database, the email provider) was momentarily
unavailable and nothing was done. Retry after those seconds.

A `502` carrying `EXTERNAL_SERVICE_ERROR` also lands here: an outbound integration the
operation depends on failed or did not answer in time. It is a transient condition — retry
with the same `Idempotency-Key` where the operation accepts one.

One exception to the envelope: a failure of the network edge that never reaches the
application (`502`, `503`, `504`, `524`) is generated by Cloudflare and its body is not
BeeL's — it may not even be JSON. Treat those as "no answer", and retry.


**Content `application/json`:**

- **success** (required) `boolean`: No description (example: false)
- **error** (required) `ErrorDetail`
- **meta** `ResponseMeta`
- **type** `string` (uri): Stable URI that identifies the problem type and where the integrator will find its documentation. (example: "https://docs.beel.es/errors/INVOICE_NO_LINES")
- **title** `string`: Short summary of the problem type. Stable between occurrences of the same `type`. (example: "INVOICE_NO_LINES")
- **detail** `string`: Specific message for this occurrence, localized according to `Accept-Language` (`es`, `en`, `ca`); defaults to English. Matches the legacy `error.message`. (example: "The invoice must have at least one line")
- **instance** `string` (uri-reference): URI that identifies the specific occurrence of the problem — typically the path of the affected resource. (example: "/v1/invoices/abc-123")

**Example:**

```json
{
  "success": false,
  "error": {
    "code": "UNSUPPORTED_MEDIA_TYPE",
    "message": "Unsupported media type: text/plain. Supported: application/json"
  },
  "meta": {
    "timestamp": "2025-01-15T10:30:00Z",
    "request_id": "4bf92f3577b34da6a3ce929d0e0e4736"
  }
}
```

---

# Related Schema Definitions

## UpdateCompanyPaymentConnectionRequest

The settings to change. A field you omit keeps its current value; the series fields and
`tax_inclusive_tax` also accept an explicit `null`, which clears them.

- **auto_invoice_enabled** `boolean`: Whether incoming charges are auto-invoiced.
- **event_source**: Which family of Stripe events this connection acts on. Changing it affects the events that arrive from then on; events already recorded keep their outcome.
- **auto_create_customer** `boolean`: Whether customers are created from the fiscal data the provider supplies.
- **send_invoice_by_email** `boolean`: Whether the auto-issued invoice is emailed to the payer.
- **tax_inclusive_tax**: Optional. The tax applied to a charge for which the provider sends no tax breakdown; when set, it takes precedence over the company's tax configuration for those charges. Omit it to keep the current value; send `null` to clear it, so the company's tax configuration applies again.
- **series** `UpdateCompanyPaymentConnectionSeries`: Series to number auto-issued invoices in. Omit a field to keep it, send `null` to clear it and fall back to the company default series for that document type.
- **simplificada_threshold** `number` (double): Amount in EUR up to which a charge whose buyer has no complete fiscal data (tax ID, name and address) is invoiced as a simplified invoice. Above it, the charge is not issued: it waits as a draft standard invoice until the buyer's fiscal data is completed. A buyer with complete fiscal data always gets a standard invoice, whatever the amount. Up to 400.00 is the general limit; a higher value, up to 3000.00, is the issuer's statement that its activity is one of those in article 4.2 of RD 1619/2012 (rule SIM-002). Omit to keep the current value.
- **filter_config**: Omit to keep the current filter configuration untouched. When sent, it **replaces the whole object** — every axis you leave out is cleared, not preserved. Send the complete configuration you want, not just the axis you are changing.

## UpdateCompanyPaymentConnectionSeries

Series to number auto-issued invoices in. Omit a field to keep it, send `null` to clear it
and fall back to the company default series for that document type.

- **ordinaria** `string` (uuid): Series for auto-issued ordinary invoices.
- **simplificada** `string` (uuid): Series for auto-issued simplified invoices.
- **rectificativa** `string` (uuid): Series for auto-issued corrective invoices (refunds).

## CompanyPaymentConnectionResponse

- **success** `boolean`: No description
- **data** `CompanyPaymentConnection`: A payment provider connection of a NIF with the settings that decide what BeeL does with each incoming charge. Credentials of the provider are never part of this document.
- **meta** `ResponseMeta`

## CompanyPaymentConnection

A payment provider connection of a NIF with the settings that decide what BeeL does with
each incoming charge. Credentials of the provider are never part of this document.

- **id** (required) `string` (uuid): Unique identifier of the connection, the `{connection_id}` that addresses it. (example: "5f2b1c0e-9a3d-4c11-8f6e-7b0d2a4c9e13")
- **provider** (required) `string`: Payment provider slug (lowercase). (example: "stripe")
- **external_account_id** (required) `string`: Provider-side account id (e.g. Stripe `acct_...`). Read-only. (example: "acct_1234567890")
- **external_account_name** `string`: Provider-side account display name, if any.
- **environment** (required): Mode the connection lives in (`beel_sk_test_*` → `TEST`, `beel_sk_live_*` → `PROD`). Read-only: Test and Live connections are independent and never move between modes.
- **status** (required) `ConnectionStatus`: Status of the payment provider connection. - `PENDING`: authorization opened, not completed yet - `ACTIVE`: the connection invoices incoming charges - `DISCONNECTED`: withdrawn — it no longer invoices anything - `ERROR`: the provider rejected the last call, so it needs reconnecting
- **connected_at** `string` (date-time): When the connection was established. Read-only.
- **last_event_at** `string` (date-time): When the last charge from the provider came in through this connection. Read-only, and a signal of **traffic**, not of success: it is stamped even when the charge is filtered out. `null` means no charge has ever arrived.
- **auto_invoice_enabled** (required) `boolean`: Whether incoming charges are auto-invoiced. Disconnecting the connection does not change it.
- **event_source** (required): Which family of Stripe events this connection acts on. A single webhook endpoint receives everything the connected account emits, so the events outside the declared family are recorded as skipped and deliberately ignored, and need no attention.
- **auto_create_customer** (required) `boolean`: Whether customers are created from the fiscal data the provider supplies.
- **send_invoice_by_email** (required) `boolean`: Whether the auto-issued invoice is emailed to the payer, using the address the provider reported. A charge with no payer email is invoiced all the same and sends nothing.
- **tax_inclusive_tax**: The tax applied to a charge for which the provider sends no tax breakdown (for example, Stripe without Stripe Tax). When set, it takes precedence over the company's tax configuration for those charges. `null` means the company's tax configuration applies.
- **series** `CompanyPaymentConnectionSeries`: Invoice series the connection numbers its auto-issued invoices in, one per document type. A series left out falls back to the company default series for that type.
- **simplificada_threshold** `number` (double): Amount in EUR up to which a charge whose buyer has no complete fiscal data (tax ID, name and address) is invoiced as a simplified invoice. Above it, the charge is not issued: it waits as a draft standard invoice until the buyer's fiscal data is completed. A buyer with complete fiscal data always gets a standard invoice, whatever the amount. Up to 400.00 is the general limit; a higher value, up to 3000.00, is the issuer's statement that its activity is one of those in article 4.2 of RD 1619/2012 (rule SIM-002). (example: 400)
- **filter_config** `CompanyPaymentConnectionFilters`: Rules that decide which incoming charges reach auto-invoicing. Every axis is opt-in: a field left out does not filter anything. A charge filtered out produces no invoice and is recorded as skipped.
- **active_filters** (required) `array[string]`: Filter axes that currently hold a value, so you can tell a connection that filters nothing from one that does without reading every field. An empty list means every charge reaches auto-invoicing. - `amount`: `min_amount` or `max_amount` is set. - `customer`: `only_mapped_customers` is on or `allowed_customer_ids` has entries. - `description`: `excluded_description_patterns` or `required_description_patterns` has entries. - `category`: `disabled_categories` has entries.

## ResponseMeta

- **timestamp** `string` (date-time): No description (example: "2025-01-15T10:30:00Z")
- **request_id** `string`: No description (example: "4bf92f3577b34da6a3ce929d0e0e4736")

## ErrorResponse

Error response shared by all BeeL. APIs.

The payload carries **two contracts at once** (additive, non-breaking):

- **Legacy** (`success`, `error.{code,message,details}`, `meta`) — kept
  intact for existing consumers.
- **RFC 9457** (`type`, `title`, `detail`, `instance`) — new fields
  for integrators following Problem Details for HTTP APIs. The
  `type` URI is the stable, shareable link to the error's
  documentation page (e.g. `https://docs.beel.es/errors/{code}`).

Future migration: the legacy fields will be deprecated via
`Deprecation`/`Sunset` headers after a sufficient adoption window,
and the response Content-Type will move to
`application/problem+json`.

- **success** (required) `boolean`: No description (example: false)
- **error** (required) `ErrorDetail`
- **meta** `ResponseMeta`
- **type** `string` (uri): Stable URI that identifies the problem type and where the integrator will find its documentation. (example: "https://docs.beel.es/errors/INVOICE_NO_LINES")
- **title** `string`: Short summary of the problem type. Stable between occurrences of the same `type`. (example: "INVOICE_NO_LINES")
- **detail** `string`: Specific message for this occurrence, localized according to `Accept-Language` (`es`, `en`, `ca`); defaults to English. Matches the legacy `error.message`. (example: "The invoice must have at least one line")
- **instance** `string` (uri-reference): URI that identifies the specific occurrence of the problem — typically the path of the affected resource. (example: "/v1/invoices/abc-123")

## ErrorDetail

- **code** (required) `string`: No description (example: "VALIDATION_ERROR")
- **message** (required) `string`: No description (example: "The provided data is not valid")
- **details** `object`: No description (example: {"field":"specific error message"})

## ConnectionStatus

Status of the payment provider connection.

- `PENDING`: authorization opened, not completed yet
- `ACTIVE`: the connection invoices incoming charges
- `DISCONNECTED`: withdrawn — it no longer invoices anything
- `ERROR`: the provider rejected the last call, so it needs reconnecting

Type: `string` — one of: PENDING, ACTIVE, DISCONNECTED, ERROR

## CompanyPaymentConnectionSeries

Invoice series the connection numbers its auto-issued invoices in, one per document type.
A series left out falls back to the company default series for that type.

- **ordinaria** `string` (uuid): Series for auto-issued ordinary invoices.
- **simplificada** `string` (uuid): Series for auto-issued simplified invoices.
- **rectificativa** `string` (uuid): Series for auto-issued corrective invoices (refunds).

## CompanyPaymentConnectionFilters

Rules that decide which incoming charges reach auto-invoicing. Every axis is opt-in: a
field left out does not filter anything. A charge filtered out produces no invoice and is
recorded as skipped.

- **min_amount** `number` (double): Charges below this amount are skipped. (example: 10)
- **max_amount** `number` (double): Charges above this amount are skipped. (example: 5000)
- **only_mapped_customers** `boolean`: When true, only charges from customers already mapped to a BeeL customer are invoiced.
- **allowed_customer_ids** `array[string]`: Provider-side customer ids (e.g. Stripe `cus_...`) allowed through. When set, no other customer is invoiced.
- **excluded_description_patterns** `array[string]`: Regular expressions matched against the charge description. A charge matching any of them is skipped.
- **required_description_patterns** `array[string]`: Regular expressions matched against the charge description. A charge must match at least one of them to be invoiced.
- **disabled_categories** `array[PaymentEventCategory]`: Charge categories opted out of auto-invoicing. An empty list, or the field left out, leaves every category active.

## PaymentEventCategory

Which product line a payment event's money came from. A different axis from `event_kind`,
which says what happened: a `checkout.session.completed` is `PAYMENT_COMPLETED` either way,
and the category tells you whether it was a one-off checkout or the start of a subscription.

- `DIRECT_PAYMENT`: a one-off charge
- `SUBSCRIPTION`: a charge produced by a recurring subscription
- `REFUND`: money given back
- `CREDIT_NOTE`: a credit note issued on the provider's side

Type: `string` — one of: DIRECT_PAYMENT, SUBSCRIPTION, REFUND, CREDIT_NOTE


---

Full OpenAPI spec: https://docs.beel.es/api/openapi