{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/beel-es/json-schema/beel-es-list-managed-payment-connections-response-schema.json",
  "title": "ListManagedPaymentConnectionsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/beel-es-companypaymentconnections-api-openapi.yml#/components/schemas/ListManagedPaymentConnectionsResponse",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean"
    },
    "data": {
      "type": "object",
      "required": [
        "connections"
      ],
      "properties": {
        "connections": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ManagedPaymentConnection"
          }
        }
      }
    },
    "meta": {
      "$ref": "#/$defs/ResponseMeta"
    }
  },
  "$defs": {
    "ConnectionStatus": {
      "type": "string",
      "enum": [
        "PENDING",
        "ACTIVE",
        "DISCONNECTED",
        "ERROR"
      ],
      "description": "Status of the payment provider connection.\n\n- `PENDING`: authorization opened, not completed yet\n- `ACTIVE`: the connection invoices incoming charges\n- `DISCONNECTED`: withdrawn — it no longer invoices anything\n- `ERROR`: the provider rejected the last call, so it needs reconnecting\n"
    },
    "Environment": {
      "type": "string",
      "description": "Mode a record lives in — its Test/Live twin. It decides where invoices, customers and\nquota are accounted.\n\nFor a company it also decides which AEAT its NIF is registered against: switching a\ncompany on in `PROD` is what registers it with the real AEAT, so `aeat_environment`\nis that same mode and uses this same enum.\n",
      "enum": [
        "TEST",
        "PROD"
      ]
    },
    "ManagedPaymentConnection": {
      "type": "object",
      "description": "A payment provider connection of a NIF (curated subset).",
      "required": [
        "id",
        "provider",
        "external_account_id",
        "environment",
        "status"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier of the connection. It is what addresses the connection everywhere\nelse — `PATCH`, `DELETE` and events all take it as `{connection_id}`.\n"
        },
        "provider": {
          "type": "string",
          "description": "Payment provider slug (lowercase)."
        },
        "external_account_id": {
          "type": "string",
          "description": "Provider-side account id (e.g. Stripe `acct_...`)."
        },
        "external_account_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Provider-side account display name, if any."
        },
        "environment": {
          "allOf": [
            {
              "$ref": "#/$defs/Environment"
            }
          ],
          "description": "Mode the connection lives in (`beel_sk_test_*` → `TEST`, `beel_sk_live_*` → `PROD`).\nTest and Live connections are independent, so the same provider account may appear in\nboth modes; this field tells them apart without inferring it from the key you asked\nwith.\n"
        },
        "status": {
          "$ref": "#/$defs/ConnectionStatus"
        },
        "connected_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When the connection was established."
        }
      }
    },
    "ResponseMeta": {
      "type": "object",
      "properties": {
        "timestamp": {
          "type": "string",
          "format": "date-time"
        },
        "request_id": {
          "type": "string"
        }
      }
    }
  }
}