{
  "openapi": "3.1.0",
  "info": {
    "title": "UBO API",
    "description": "The API of **UBO**, the white-label card issuing and processing platform: create cardholders, accounts and cards, authorize payments and follow their lifecycle, explain each decision, handle alerts and disputes, receive events and exchange files. Whatever the portal does goes through this API.\n\n## Getting a token\n\nEvery call carries an OAuth 2.0 access token of the platform's identity server, in `Authorization: Bearer <token>`. The token carries the **bank** of the account (claim `tenant_id`): everything you create or read is that bank's, and only that bank's. A token lasts 5 minutes; renew it with its `refresh_token`.\n\n```bash\ncurl -s https://app.ubo-demo.duckdns.org/auth/realms/ubo/protocol/openid-connect/token \\\n  -d grant_type=password -d client_id=ubo-api -d client_secret=$UBO_CLIENT_SECRET \\\n  -d username=$UBO_USER -d password=$UBO_PASSWORD\n```\n\nPaste the `access_token` in the **Authentication** box of this page: every \"Test request\" then uses it.\n\n## Amounts, identifiers, dates\n\n| | |\n|---|---|\n| Amounts | Integers in **cents** of the currency: `4250` = €42.50 |\n| Currencies, countries | ISO 4217 (`EUR`), ISO 3166-1 alpha-2 (`FR`) |\n| Identifiers | UUID v7 (they follow the creation order) |\n| Dates | RFC 3339, UTC |\n| Card numbers | Never returned: a card is named by its `id`, `last_four` displays it |\n\n## Lists and pagination\n\nThe large lists (`/cards`, `/cardholders`, `/authorizations`) take a `grid` parameter: the JSON of a `GridQuery` (search, filters, sort, page size, cursor), URL-encoded. The answer gives `next_cursor` for the next page and `total` (exact up to 10,000 rows, see `total_exact`).\n\n```bash\ncurl -G https://app.ubo-demo.duckdns.org/api/cards -H \"Authorization: Bearer $TOKEN\" \\\n  --data-urlencode 'grid={\"q\":\"martin\",\"filters\":{\"status\":[\"active\"]},\"limit\":50}'\n```\n\n## Errors\n\nEvery error is `{\"error\": {\"code\": <HTTP status>, \"message\": \"<French text for the portal's users>\"}}`.\n\n| Status | Meaning |\n|---|---|\n| 400 | Invalid request: missing or wrong field, value outside its list |\n| 401 | No token, expired or invalid token |\n| 403 | Permission missing, or object outside the account's scope |\n| 404 | Unknown object (or another bank's: it does not exist for you) |\n| 409 | Not possible in the object's state (status transition, already presented) |\n| 429 | Quota of the bank exceeded: wait `Retry-After` seconds |\n\n## Quotas\n\nEach bank has quotas of API calls (per user and per bank, per minute) and of authorizations (per second, burst, simultaneous). Beyond them: 429 with `Retry-After` (and 91 on the card networks).\n\n## Main response codes of an authorization\n\n| Code | Meaning | Code | Meaning |\n|---|---|---|---|\n| `00` | Approved | `61` | Amount limit exceeded |\n| `05` | Do not honour (bank's rule) | `62` | Restricted card (country, channel, MCC) |\n| `10` | Partial approval | `65` | Count limit exceeded |\n| `14` | Invalid card number | `78` | Card not yet activated |\n| `1A` | Strong authentication required (PSD2) | `91` | Issuer unavailable (quota) |\n| `51` | Insufficient funds | `93` | Forbidden (sanctions) |\n| `54` | Expired card | `N7` | Wrong CVV2 |\n| `55` | Wrong PIN | `59` | Suspected fraud |\n\n## Events\n\nEach business change is published as an event: to your **webhooks** (signed HTTPS POST, see *Webhooks*) and on **Kafka** (topic `ubo.<object>`). Delivery is at least once: deduplicate on the event's identifier.\n\n## Guides\n\nQuickstart, authentication, conventions, webhooks, events, files and SFTP, sandbox: see the developer guide at `/docs/en/developers/quickstart/` (French at `/docs/developers/quickstart/`).",
    "contact": {
      "name": "UBO",
      "url": "https://ubo-demo.duckdns.org/developers/quickstart/"
    },
    "license": {
      "name": ""
    },
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://app.ubo-demo.duckdns.org/api",
      "description": "UBO demonstration platform"
    }
  ],
  "paths": {
    "/accounts": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "List the accounts",
        "operationId": "list_accounts",
        "responses": {
          "200": {
            "description": "The accounts of the bank (of the user's organisations)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AccountResponse"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Accounts"
        ],
        "summary": "Open an account",
        "operationId": "create_account",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAccountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/accounts/{id}": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Get an account",
        "operationId": "get_account",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/accounts/{id}/balance": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Balance of an account",
        "description": "Ledger balance, amounts held by authorizations not yet presented, available balance (cents).",
        "operationId": "account_balance",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The balance",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "account_id": "01a21e88-f95c-746f-babd-af2f22f7f602",
                  "available_cents": 145750,
                  "booked_cents": 145750,
                  "currency_code": "EUR",
                  "held_cents": 0,
                  "overdraft_cents": 0
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/accounts/{id}/credit": {
      "post": {
        "tags": [
          "Accounts"
        ],
        "summary": "Credit an account",
        "description": "Money paid into the account (transfer, top-up). Permission `cards:write`.",
        "operationId": "account_credit",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreditBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The new balance",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "account_id": "01a21e88-f95c-746f-babd-af2f22f7f602",
                  "available_cents": 145750,
                  "booked_cents": 145750,
                  "currency_code": "EUR",
                  "held_cents": 0,
                  "overdraft_cents": 0
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/accounts/{id}/ledger": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Movements of an account",
        "description": "Holds, releases, debits and credits, most recent first.",
        "operationId": "account_ledger",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The movements",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/alerts": {
      "get": {
        "tags": [
          "Alerts"
        ],
        "summary": "List the alerts",
        "operationId": "list_alerts",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "`open`, `in_review`, `closed`",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The alerts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/alerts/{id}": {
      "patch": {
        "tags": [
          "Alerts"
        ],
        "summary": "Handle an alert",
        "operationId": "update_alert",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertUpdateBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The alert",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/authorizations": {
      "get": {
        "tags": [
          "Authorizations"
        ],
        "summary": "List the authorizations",
        "description": "With `grid`: a page (search on merchant, last four digits, cardholder, approval code; filters on status, journey, period, amount, response code, channel, network, country, organisation). Permission `authorizations:read`.",
        "operationId": "list_authorizations",
        "parameters": [
          {
            "name": "grid",
            "in": "query",
            "description": "JSON of a `GridQuery`",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "card_id",
            "in": "query",
            "description": "The authorizations of a card",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "view",
            "in": "query",
            "description": "`summary`: without the steps' details",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of authorizations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationsPage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/authorizations/{id}": {
      "get": {
        "tags": [
          "Authorizations"
        ],
        "summary": "Get an authorization",
        "operationId": "get_authorization",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The authorization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/authorizations/{id}/capture": {
      "post": {
        "tags": [
          "Authorizations"
        ],
        "summary": "Present an authorization",
        "description": "Records the merchant's presentment (normally received in the clearing file): the cardholder is debited, the hold released. Permission `authorizations:write`.",
        "operationId": "capture",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Optional",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LifecycleBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The authorization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Not possible in its state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/authorizations/{id}/credit-authorization": {
      "post": {
        "tags": [
          "Authorizations"
        ],
        "summary": "Authorize a refund (credit)",
        "description": "The authorization of a refund to the card, before its presentment.",
        "operationId": "credit_authorization",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LifecycleBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The credit authorization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/authorizations/{id}/decision": {
      "get": {
        "tags": [
          "Decisions"
        ],
        "summary": "Decision of an authorization",
        "description": "Outcome, deciding step and element (a rule and its version, a limit, a check), rules evaluated with their conditions and the values read, external calls, sentence of explanation, fingerprint and its integrity.",
        "operationId": "get_decision",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The decision record",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/authorizations/{id}/decision/replay": {
      "post": {
        "tags": [
          "Decisions"
        ],
        "summary": "Replay a decision",
        "description": "Runs the rules again on the recorded context: `mode` `identical` (the rules' versions of the time, by default) or `current` (today's rules); `live_calls` to call the external services again instead of reusing their recorded answers.",
        "operationId": "replay_decision",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "live_calls": false,
                "mode": "current"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The original and replayed decisions, and the rules that change",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/authorizations/{id}/events": {
      "get": {
        "tags": [
          "Authorizations"
        ],
        "summary": "Events of an authorization",
        "operationId": "authorization_events",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Its domain events",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EventEnvelope"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/authorizations/{id}/increment": {
      "post": {
        "tags": [
          "Authorizations"
        ],
        "summary": "Increment a pre-authorization",
        "description": "Hotel extra night, rental extension: the extra amount goes through the limits and the funds check; a refusal leaves the pre-authorization untouched.",
        "operationId": "increment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IncrementBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The authorization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/authorizations/{id}/journey": {
      "get": {
        "tags": [
          "Authorizations"
        ],
        "summary": "Journey of an authorization",
        "description": "What happened after it: presentments, reversals, refunds, expiry, disputes.",
        "operationId": "authorization_journey",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The journey",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/authorizations/{id}/refund": {
      "post": {
        "tags": [
          "Authorizations"
        ],
        "summary": "Refund a presented authorization",
        "operationId": "refund",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LifecycleBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The authorization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/authorizations/{id}/reverse": {
      "post": {
        "tags": [
          "Authorizations"
        ],
        "summary": "Reverse an authorization",
        "description": "Before presentment: releases all of it, or down to a new total (partial reversal). The hold and the limits are released.",
        "operationId": "reverse",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Optional: total reversal without a body",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReverseBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The authorization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/authorize": {
      "post": {
        "tags": [
          "Authorizations"
        ],
        "summary": "Authorize a payment",
        "description": "Runs the six steps of an authorization (decoding, identification, validation, rules, reservation, response) and answers with the decision, its response code and each step. The card is given by `card_id` (or its token). For tests and channels outside the card networks: the networks' messages arrive through the network stations. Its own quota: authorizations per second of the bank.",
        "operationId": "authorize",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthorizeRequest"
              },
              "example": {
                "amount": 4250,
                "card_id": "01a21d38-1a30-738f-9e82-094535b05394",
                "currency": "EUR",
                "mcc": "5411",
                "merchant_country": "FR",
                "merchant_name": "Leclerc",
                "terminal_type": "pos"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The decision (approved or declined: see `approved` and `response_code`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizeResponse"
                },
                "example": {
                  "amount": 4250,
                  "approved": true,
                  "captured_cents": 0,
                  "card_id": "01a21e8a-0ec9-7607-8fa8-deb17e39fd17",
                  "checks": [
                    {
                      "detail": null,
                      "kind": "card_status",
                      "label": "Statut de la carte",
                      "outcome": "pass",
                      "ref_id": "01a21e8a-0ec9-7607-8fa8-deb17e39fd17",
                      "ref_type": "card",
                      "stage": "validate"
                    }
                  ],
                  "created_at": "2026-11-27T19:44:54.120Z",
                  "currency": "EUR",
                  "entity_id": "e0000000-0000-0000-0000-000000000011",
                  "id": "01a21e8a-0fe2-7566-8cfc-42682e0e27e9",
                  "mcc": "5411",
                  "merchant_country": "FR",
                  "merchant_name": "Leclerc",
                  "message": {
                    "children": [],
                    "incremented_cents": 0,
                    "initial_cents": 4250,
                    "message_type": "authorization",
                    "reversed_cents": 0,
                    "source": "api",
                    "steps": []
                  },
                  "pattern": [
                    "AUT 00"
                  ],
                  "pipeline_duration_ms": 31,
                  "refunded_cents": 0,
                  "response_code": "00",
                  "response_message": "Approved",
                  "sca": {
                    "cavv_result": null,
                    "eci": null,
                    "exemption": null
                  },
                  "stages": [
                    {
                      "detail": null,
                      "duration_ms": 0,
                      "passed": true,
                      "stage": "decode"
                    },
                    {
                      "detail": "Card identified",
                      "duration_ms": 8,
                      "passed": true,
                      "stage": "identify"
                    },
                    {
                      "detail": null,
                      "duration_ms": 1,
                      "passed": true,
                      "stage": "validate"
                    },
                    {
                      "detail": null,
                      "duration_ms": 6,
                      "passed": true,
                      "stage": "check_rules"
                    },
                    {
                      "detail": null,
                      "duration_ms": 12,
                      "passed": true,
                      "stage": "reserve"
                    },
                    {
                      "detail": null,
                      "duration_ms": 0,
                      "passed": true,
                      "stage": "respond"
                    }
                  ],
                  "status": "authorized",
                  "tenant_id": "a0000000-0000-0000-0000-000000000001",
                  "terminal_type": "contactless"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/card-products": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "List the card products",
        "operationId": "list_products",
        "responses": {
          "200": {
            "description": "The products",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CardProductResponse"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/card-products/{id}": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Get a card product",
        "operationId": "get_product",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The product",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardProductResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/card-products/{id}/visuals": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Designs of a product",
        "operationId": "product_visuals",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The designs a card of this product can have",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CardVisualResponse"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/card-visuals": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "List the card designs",
        "operationId": "list_visuals",
        "responses": {
          "200": {
            "description": "The designs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CardVisualResponse"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/card-visuals/{id}": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Get a card design",
        "operationId": "get_visual",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The design",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardVisualResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/cardholders": {
      "get": {
        "tags": [
          "Cardholders"
        ],
        "summary": "List the cardholders",
        "description": "With `grid`: a page (search on name, e-mail, phone; filters; sort; cursor). Permission `cardholders:read`.",
        "operationId": "list_cardholders",
        "parameters": [
          {
            "name": "grid",
            "in": "query",
            "description": "JSON of a `GridQuery`",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of cardholders",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Cardholders"
        ],
        "summary": "Create a cardholder",
        "description": "Permission `cardholders:write`.",
        "operationId": "create_cardholder",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCardholderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The cardholder",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardholderResponse"
                },
                "example": {
                  "address": null,
                  "aml_risk": "standard",
                  "created_at": "2026-11-27T19:43:42.852Z",
                  "date_of_birth": null,
                  "email": "camille.durand@example.com",
                  "entity_id": "e0000000-0000-0000-0000-000000000011",
                  "first_name": "Camille",
                  "id": "01a21e88-f904-7423-863e-98684b8b1fec",
                  "kyc_level": 2,
                  "last_name": "Durand",
                  "nationality": null,
                  "pep": false,
                  "phone": null,
                  "status": "active",
                  "tenant_id": "a0000000-0000-0000-0000-000000000001",
                  "updated_at": "2026-11-27T19:43:42.852Z"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/cardholders/{id}": {
      "get": {
        "tags": [
          "Cardholders"
        ],
        "summary": "Get a cardholder",
        "operationId": "get_cardholder",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The cardholder",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardholderResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Unknown",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/cards": {
      "get": {
        "tags": [
          "Cards"
        ],
        "summary": "List the cards",
        "description": "With `grid`: a page of cards (search on the last four digits, the cardholder, the identifier; filters on status, product, organisation, form). Without it: every card of the bank (avoid on large banks). The full card number is never returned. Permission `cards:read`.",
        "operationId": "list_cards",
        "parameters": [
          {
            "name": "grid",
            "in": "query",
            "description": "JSON of a `GridQuery`",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of cards",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardsPage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Cards"
        ],
        "summary": "Issue a card",
        "description": "The number is generated in the product's range and sealed in the vault. A virtual card is usable at once; a physical card goes to manufacturing. Permission `cards:write`.",
        "operationId": "create_card",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCardRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The card",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardResponse"
                },
                "example": {
                  "account_id": "01a21e88-f95c-746f-babd-af2f22f7f602",
                  "bin_id": "b0000000-0000-0000-0000-000000000001",
                  "card_role": "STANDALONE",
                  "cardholder_id": "01a21e88-f904-7423-863e-98684b8b1fec",
                  "created_at": "2026-11-27T19:44:21.111Z",
                  "entity_id": "e0000000-0000-0000-0000-000000000011",
                  "expiry_month": 11,
                  "expiry_year": 2030,
                  "form_factor": "VIRTUAL",
                  "id": "01a21e8a-0ec9-7607-8fa8-deb17e39fd17",
                  "issued_at": "2026-11-27T19:44:21.111Z",
                  "last_four": "0033",
                  "product_code": "VISA-CLQ-PART",
                  "product_version_id": "01a21d33-6405-7596-a0fb-2fff0b0074b0",
                  "status": "created",
                  "tenant_id": "a0000000-0000-0000-0000-000000000001",
                  "updated_at": "2026-11-27T19:44:21.111Z"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/cards/{id}": {
      "get": {
        "tags": [
          "Cards"
        ],
        "summary": "Get a card",
        "operationId": "get_card",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The card",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Unknown",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/cards/{id}/deliveries": {
      "get": {
        "tags": [
          "Cards"
        ],
        "summary": "Deliveries of a card",
        "operationId": "card_deliveries",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The plastics sent and their tracking",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/cards/{id}/services": {
      "get": {
        "tags": [
          "Cards"
        ],
        "summary": "Services of a card",
        "description": "In-store payment, e-commerce, cash withdrawal, contactless, abroad… and their status.",
        "operationId": "card_services",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The services",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/cards/{id}/services/{sid}": {
      "patch": {
        "tags": [
          "Cards"
        ],
        "summary": "Turn a service of a card on or off",
        "operationId": "update_card_service",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "sid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCardServiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The service",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/cards/{id}/status": {
      "patch": {
        "tags": [
          "Cards"
        ],
        "summary": "Change the status of a card",
        "description": "Activate, suspend (temporary block by the cardholder), block, declare lost or stolen, cancel. Only the transitions of the card's lifecycle are allowed (409 otherwise). Permission `cards:write`.",
        "operationId": "update_card_status",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCardStatusRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The card",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Transition not allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/cards/{id}/status-history": {
      "get": {
        "tags": [
          "Cards"
        ],
        "summary": "Status history of a card",
        "operationId": "card_status_history",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Each change: before, after, reason, author, date",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/cards/{id}/tokens": {
      "get": {
        "tags": [
          "Cards"
        ],
        "summary": "Tokens of a card",
        "operationId": "card_tokens",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The tokens (wallets) of the card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/decisions": {
      "get": {
        "tags": [
          "Decisions"
        ],
        "summary": "List the decisions",
        "operationId": "list_decisions",
        "parameters": [
          {
            "name": "outcome",
            "in": "query",
            "description": "`approved`, `declined`, `challenge`",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code",
            "in": "query",
            "description": "Response code",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stage",
            "in": "query",
            "description": "Deciding step, `P1` to `P6`",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rule_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "decisive",
            "in": "query",
            "description": "Only the decisions this rule made",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "rule_version",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "calls",
            "in": "query",
            "description": "`failed` or `any`",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "frame",
            "in": "query",
            "description": "Response fields changed by the rules",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "RFC 3339",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Merchant or identifier",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "card_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of decisions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/decisions/summary": {
      "get": {
        "tags": [
          "Decisions"
        ],
        "summary": "Summary of the decisions",
        "description": "Same filters as the list: counts, decline reasons, deciding steps and rules.",
        "operationId": "decisions_summary",
        "responses": {
          "200": {
            "description": "The summary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/disputes": {
      "get": {
        "tags": [
          "Disputes"
        ],
        "summary": "List the dispute cases",
        "operationId": "list_disputes",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "case_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assigned_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "view",
            "in": "query",
            "description": "`open`, `overdue`, `due_soon`, `pending_decision`",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "card_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "authorization_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The cases",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Disputes"
        ],
        "summary": "Open a dispute case",
        "description": "Permission `disputes:write`.",
        "operationId": "create_dispute",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewCaseBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The case",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/disputes/decisions/{id}/approve": {
      "post": {
        "tags": [
          "Disputes"
        ],
        "summary": "Approve a financial decision",
        "description": "By another person than the one who proposed it.",
        "operationId": "approve_decision",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Approved and executed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/disputes/decisions/{id}/reject": {
      "post": {
        "tags": [
          "Disputes"
        ],
        "summary": "Reject a financial decision",
        "operationId": "reject_decision",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rejected",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/disputes/{id}": {
      "get": {
        "tags": [
          "Disputes"
        ],
        "summary": "Get a dispute case",
        "description": "Transactions, evidence, deadlines, decisions, history, and the actions possible now.",
        "operationId": "get_dispute",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The case",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/disputes/{id}/actions/{action}": {
      "post": {
        "tags": [
          "Disputes"
        ],
        "summary": "Move a dispute case on",
        "description": "`open`, `submit` (send to the network), `withdraw`, `close`, `pre_arbitration`, `accept_pre_arbitration`, `decline_pre_arbitration`, `file_arbitration`, `recall`: only the actions of the case's current status.",
        "operationId": "dispute_action",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "action",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Optional details of the action",
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Done",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Not possible in its status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/disputes/{id}/decisions": {
      "post": {
        "tags": [
          "Disputes"
        ],
        "summary": "Propose a financial decision",
        "description": "Beyond the bank's threshold, it waits for the approval of another person (four eyes); once approved it has its effect once only.",
        "operationId": "propose_decision",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProposalBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The decision",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/disputes/{id}/notes": {
      "post": {
        "tags": [
          "Disputes"
        ],
        "summary": "Add a note to a case",
        "operationId": "add_note",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NoteBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Added",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/entities": {
      "get": {
        "tags": [
          "Organisations"
        ],
        "summary": "List the organisations",
        "operationId": "list_entities",
        "responses": {
          "200": {
            "description": "The organisations of the bank",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EntityResponse"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/entities/{id}": {
      "get": {
        "tags": [
          "Organisations"
        ],
        "summary": "Get an organisation",
        "operationId": "get_entity",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The organisation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntityResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/events": {
      "get": {
        "tags": [
          "Events"
        ],
        "summary": "Journal of the events",
        "operationId": "list_events",
        "parameters": [
          {
            "name": "event_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "aggregate_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Kafka publication: `pending`, `retrying`, `published`",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "description": "Events before this sequence number (next page)",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The events, most recent first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/events/{id}": {
      "get": {
        "tags": [
          "Events"
        ],
        "summary": "Get an event",
        "operationId": "get_event",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The event, its publication and its deliveries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/files": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "List the files",
        "operationId": "list_files",
        "parameters": [
          {
            "name": "direction",
            "in": "query",
            "description": "`in` or `out`",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "file_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Name or fingerprint",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "description": "RFC 3339: files received before (next page)",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The files",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Files"
        ],
        "summary": "Send a file",
        "description": "The body is the file itself. It is checked line by line against its format, then integrated in the background. A content already received is refused. Permission `files:write`.",
        "operationId": "receive_file",
        "parameters": [
          {
            "name": "file_type",
            "in": "query",
            "description": "e.g. `UBO_CARD_STATUS`",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "File name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "description": "`api` for a bank's system",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "int32",
                  "minimum": 0
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The file and its control",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/files/types": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "Types of files",
        "operationId": "file_types",
        "responses": {
          "200": {
            "description": "Each type: direction, format, version",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/files/{id}": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "Get a file",
        "description": "Status, counts, control totals, anomalies, history.",
        "operationId": "get_file",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/files/{id}/download": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "Download a file",
        "description": "Permission `files:admin`, through the controlled access to sensitive data; journaled.",
        "operationId": "download_file",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "format": "int32",
                    "minimum": 0
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/files/{id}/records": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "Lines of a file",
        "description": "Masked sensitive fields; status, anomalies and object touched of each line.",
        "operationId": "file_records",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "role",
            "in": "query",
            "description": "Comma separated: `header`, `detail`, `continuation`, `batch`, `trailer`",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of lines",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/files/{id}/replay": {
      "post": {
        "tags": [
          "Files"
        ],
        "summary": "Replay the failed lines of a file",
        "description": "The lines already integrated are not replayed.",
        "operationId": "replay_file",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "tags": [
          "Platform"
        ],
        "summary": "Health",
        "operationId": "health",
        "responses": {
          "200": {
            "description": "The gateway answers"
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/webhooks": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List the subscriptions",
        "operationId": "list_webhooks",
        "responses": {
          "200": {
            "description": "The subscriptions of the bank",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Subscribe to events",
        "description": "The signing secret is returned once here. Each delivery is a POST of `{\"id\": <event id>, \"type\": <event type>, \"created_at\": …, \"data\": <the object after the change>}`, signed: `X-UBO-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256(secret, \"<t>.<body>\")>`; retried until answered 2xx (30 s × 2^n, 6 attempts at most). Headers `X-UBO-Event` and `X-UBO-Delivery` give the type and the delivery.",
        "operationId": "create_webhook",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The subscription and its secret",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/deliveries/{id}/retry": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Deliver again",
        "operationId": "retry_delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Scheduled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/{id}": {
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete a subscription",
        "operationId": "delete_webhook",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Change a subscription",
        "operationId": "update_webhook",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The subscription",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/{id}/deliveries": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Deliveries of a subscription",
        "operationId": "webhook_deliveries",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Each delivery: event, status, attempts, last answer",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/{id}/secret": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Signing secret of a subscription",
        "description": "Administrators only; the read is journaled.",
        "operationId": "webhook_secret",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The secret",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/{id}/test": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Send a test event",
        "operationId": "test_webhook",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The delivery and the answer of the endpoint",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "No or invalid token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Permission missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Quota of the bank exceeded (see `Retry-After`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AccountResponse": {
        "type": "object",
        "required": [
          "id",
          "tenant_id",
          "entity_id",
          "currency_code",
          "status",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "account_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The bank's account number."
          },
          "cardholder_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Holder of the account."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Creation time."
          },
          "currency_code": {
            "type": "string",
            "description": "Currency, ISO 4217."
          },
          "entity_id": {
            "type": "string",
            "format": "uuid",
            "description": "Organisation of the bank."
          },
          "iban": {
            "type": [
              "string",
              "null"
            ],
            "description": "IBAN."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Identifier of the account."
          },
          "status": {
            "type": "string",
            "description": "`ACTIVE` when it can be debited."
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "description": "The bank."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Last change."
          }
        }
      },
      "AlertUpdateBody": {
        "type": "object",
        "description": "Handling of an alert.",
        "properties": {
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "resolution": {
            "type": [
              "string",
              "null"
            ],
            "description": "`legitimate`, `fraud`, `suspicious`, `false_positive` (required to close)."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "description": "`in_review` (taken by the caller), `closed`, `open`."
          }
        }
      },
      "AuthorizationListResponse": {
        "type": "object",
        "required": [
          "authorizations",
          "total"
        ],
        "properties": {
          "authorizations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuthorizeResponse"
            },
            "description": "The authorizations."
          },
          "total": {
            "type": "integer",
            "description": "Their number.",
            "minimum": 0
          }
        }
      },
      "AuthorizeRequest": {
        "type": "object",
        "required": [
          "amount",
          "currency",
          "mcc",
          "merchant_name",
          "merchant_country"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "description": "Amount in cents of `currency`."
          },
          "card_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Card id, for the portal simulation: the card's token is never sent to the browser."
          },
          "cashback_amount": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Cash-back with purchase: the cash part of `amount` (Field 61.1)."
          },
          "currency": {
            "type": "string",
            "description": "Currency, ISO 4217 (`EUR`)."
          },
          "expiry_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "Card expiry date, YYMM, as read at the point of sale (optional)."
          },
          "mcc": {
            "type": "string",
            "description": "Merchant category code (`5411` supermarket, `5541` fuel, `6011` ATM…)."
          },
          "merchant_country": {
            "type": "string",
            "description": "Merchant's country, ISO 3166-1 alpha-2."
          },
          "merchant_name": {
            "type": "string",
            "description": "Merchant's name."
          },
          "message_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "authorization (default) | preauth (estimated amount, can be raised by incrementals)."
          },
          "mit_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "delayed_charge | reauthorization | no_show | resubmission | recurring"
          },
          "network_tid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Network transaction identifier (Visa F62.2) of a request received as a network message."
          },
          "pan_token": {
            "type": "string",
            "description": "Network token of the card. Either this or `card_id` (portal simulation) is required."
          },
          "parent_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Merchant-initiated authorization linked to an earlier one (same Transaction ID)."
          },
          "partial_approval": {
            "type": "boolean",
            "description": "Terminal accepts a partial approval (code 10) instead of a 51."
          },
          "pin": {
            "type": [
              "string",
              "null"
            ],
            "description": "PIN entered at the terminal (simulates the decrypted PIN block). Never stored."
          },
          "retry_of": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Declined attempt this request retries (otherwise found automatically)."
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "description": "api | portal | simulator."
          },
          "stand_in": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/StandIn",
                "description": "Decision of the network's stand-in, from its advice (network route only)."
              }
            ]
          },
          "terminal_type": {
            "type": "string",
            "description": "`pos` (chip and PIN), `contactless`, `ecommerce`, `atm`, `moto`, `recurring`."
          },
          "three_ds": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ThreeDsData",
                "description": "Visa Secure data: CAVV, ECI, SCA exemption requested by the acquirer."
              }
            ]
          },
          "verification": {
            "$ref": "#/components/schemas/Verification",
            "description": "Simulated results of the CVV2, CVV/iCVV, chip cryptogram and PIN checks."
          }
        }
      },
      "AuthorizeResponse": {
        "type": "object",
        "required": [
          "id",
          "approved",
          "response_code",
          "response_message",
          "card_id",
          "tenant_id",
          "entity_id",
          "amount",
          "currency",
          "merchant_name",
          "mcc",
          "merchant_country",
          "terminal_type",
          "created_at",
          "pipeline_duration_ms",
          "stages",
          "status",
          "captured_cents",
          "refunded_cents",
          "sca",
          "checks",
          "message",
          "pattern"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "description": "Amount in cents."
          },
          "approved": {
            "type": "boolean",
            "description": "Whether it is approved."
          },
          "captured_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Amount presented so far, cents."
          },
          "card_id": {
            "type": "string",
            "format": "uuid",
            "description": "The card."
          },
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CheckTrace"
            },
            "description": "Each check made (card status, expiry, PIN, CVV2, cryptogram, 3-D Secure, rules, limits, funds) with its outcome."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Time of the decision."
          },
          "currency": {
            "type": "string",
            "description": "Currency, ISO 4217."
          },
          "entity_id": {
            "type": "string",
            "format": "uuid",
            "description": "Organisation of the card."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Identifier of the authorization."
          },
          "mcc": {
            "type": "string",
            "description": "Merchant category code."
          },
          "merchant_country": {
            "type": "string",
            "description": "Merchant's country."
          },
          "merchant_name": {
            "type": "string",
            "description": "Merchant's name."
          },
          "message": {
            "$ref": "#/components/schemas/MessageInfo",
            "description": "Message type, origin, requested amount (partial approval), incremented amount."
          },
          "pattern": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Journey in short codes: [\"PRÉ\", \"INC\", \"COMP½\", \"REMB\"] (\"↻\" first for a retry)."
          },
          "pipeline_duration_ms": {
            "type": "integer",
            "format": "int64",
            "description": "Time spent in UBO to decide, milliseconds.",
            "minimum": 0
          },
          "refunded_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Amount refunded so far, cents."
          },
          "response_code": {
            "type": "string",
            "description": "Response code (`00` approved; see the codes in the developer guide)."
          },
          "response_message": {
            "type": "string",
            "description": "Meaning of the code."
          },
          "sca": {
            "$ref": "#/components/schemas/ScaInfo",
            "description": "ECI, CAVV verification result and SCA exemption."
          },
          "stages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StageResult"
            },
            "description": "Each step of the authorization (decode, identify, validate, rules, reserve, respond) and its result."
          },
          "status": {
            "type": "string",
            "description": "`authorized`, `declined`, `captured`, `reversed`, `refunded`, `partially_refunded`, `expired`, `verified`."
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "description": "The bank."
          },
          "terminal_type": {
            "type": "string",
            "description": "Channel."
          }
        }
      },
      "CardProductResponse": {
        "type": "object",
        "required": [
          "id",
          "tenant_id",
          "entity_id",
          "name",
          "code",
          "network",
          "card_type",
          "status",
          "currency",
          "restrictions",
          "rule_ids",
          "fixed_fields",
          "derivation_type",
          "subscribable",
          "is_active",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "bin_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "BIN range of its cards."
          },
          "bin_range_end": {
            "type": [
              "string",
              "null"
            ],
            "description": "Last number of its range."
          },
          "bin_range_start": {
            "type": [
              "string",
              "null"
            ],
            "description": "First number of its range."
          },
          "card_type": {
            "type": "string",
            "description": "`debit` or `credit`."
          },
          "code": {
            "type": "string",
            "description": "Code, used to issue a card."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Creation time."
          },
          "currency": {
            "type": "string",
            "description": "Currency, ISO 4217."
          },
          "derivation_type": {
            "type": "string",
            "description": "How cards derive from the product."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Description."
          },
          "entity_id": {
            "type": "string",
            "format": "uuid",
            "description": "Organisation offering the product."
          },
          "fixed_fields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Settings a card cannot change."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Identifier of the product."
          },
          "is_active": {
            "type": "boolean",
            "description": "Whether the product is in use."
          },
          "name": {
            "type": "string",
            "description": "Name."
          },
          "network": {
            "type": "string",
            "description": "`visa` or `mastercard`."
          },
          "parent_product_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Product it derives from."
          },
          "restrictions": {
            "description": "Channels, countries and MCCs allowed or blocked."
          },
          "rule_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Rules attached to the product."
          },
          "status": {
            "type": "string",
            "description": "`active` when cards can be issued on it."
          },
          "subscribable": {
            "type": "boolean",
            "description": "Whether new cards can be issued on it."
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "description": "The bank."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Last change."
          }
        }
      },
      "CardResponse": {
        "type": "object",
        "required": [
          "id",
          "tenant_id",
          "entity_id",
          "cardholder_id",
          "last_four",
          "expiry_month",
          "expiry_year",
          "status",
          "product_code",
          "form_factor",
          "card_role",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "account_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Account debited by the card."
          },
          "activated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the card was activated."
          },
          "bin_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "BIN range the number was taken from."
          },
          "block_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "End of a temporary block."
          },
          "block_reason_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Reason code of the block."
          },
          "block_reason_detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "Free text of the block."
          },
          "blocked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the card was last blocked or suspended."
          },
          "cancelled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the card was cancelled."
          },
          "card_role": {
            "type": "string",
            "description": "`STANDALONE`, `PRIMARY`, `SUPPLEMENTARY` or `DERIVED`."
          },
          "cardholder_id": {
            "type": "string",
            "format": "uuid",
            "description": "The cardholder."
          },
          "closed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the card was closed."
          },
          "contract_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Contract the card belongs to."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Creation time."
          },
          "derived_from_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Card this one is derived from (a token of a wallet, for instance)."
          },
          "entity_id": {
            "type": "string",
            "format": "uuid",
            "description": "Organisation of the bank holding the card."
          },
          "expiry_month": {
            "type": "integer",
            "format": "int32",
            "description": "Expiry month (1-12)."
          },
          "expiry_year": {
            "type": "integer",
            "format": "int32",
            "description": "Expiry year (four digits)."
          },
          "external_reference": {
            "type": [
              "string",
              "null"
            ],
            "description": "The bank's own reference for the card."
          },
          "form_factor": {
            "type": "string",
            "description": "`PHYSICAL`, `VIRTUAL` or `TOKENIZED`."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Identifier of the card."
          },
          "issued_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the card was issued."
          },
          "language_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Language of the card (ATM, terminals, letters), ISO 639-1."
          },
          "last_four": {
            "type": "string",
            "description": "Last four digits of the card number (the full number is never returned)."
          },
          "parent_card_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Main card of a supplementary or derived card."
          },
          "payment_method_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Payment method (network and scheme) of the card."
          },
          "product_code": {
            "type": "string",
            "description": "Code of the card product."
          },
          "product_version_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Version of the product the card was issued on."
          },
          "renewed_by_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Card renewing this one."
          },
          "renewed_from_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Card this one renews."
          },
          "replaced_from_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Card this one replaces (lost, stolen, damaged)."
          },
          "start_validity_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Start of validity."
          },
          "status": {
            "$ref": "#/components/schemas/CardStatus",
            "description": "Status in the card lifecycle."
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "description": "The bank the card belongs to."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Last change."
          },
          "visual_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The card's design."
          }
        }
      },
      "CardStatus": {
        "type": "string",
        "enum": [
          "created",
          "pending_activation",
          "active",
          "suspended",
          "blocked",
          "lost",
          "stolen",
          "expired",
          "cancelled",
          "replaced",
          "pending_renewal",
          "destroyed"
        ]
      },
      "CardVisualResponse": {
        "type": "object",
        "required": [
          "id",
          "tenant_id",
          "name",
          "status",
          "card_format",
          "width_mm",
          "height_mm",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "card_format": {
            "type": "string",
            "description": "Card format (`ID-1`)."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Creation time."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Description."
          },
          "design_profile_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Layout used in the studio."
          },
          "height_mm": {
            "type": "number",
            "format": "double",
            "description": "Height, millimetres."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Identifier of the design."
          },
          "name": {
            "type": "string",
            "description": "Name."
          },
          "recto_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Image of the front."
          },
          "status": {
            "type": "string",
            "description": "`active` when it can be chosen for a card."
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "description": "The bank."
          },
          "thumbnail_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Small image."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Last change."
          },
          "valid_from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "First day of use."
          },
          "valid_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Last day of use."
          },
          "verso_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Image of the back."
          },
          "width_mm": {
            "type": "number",
            "format": "double",
            "description": "Width, millimetres."
          }
        }
      },
      "CardholderResponse": {
        "type": "object",
        "required": [
          "id",
          "tenant_id",
          "entity_id",
          "first_name",
          "last_name",
          "status",
          "kyc_level",
          "pep",
          "aml_risk",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "address": {
            "description": "Postal address (lines, city, postal code, country)."
          },
          "aml_risk": {
            "type": "string",
            "description": "Anti-money laundering risk: `low`, `standard`, `high`."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Creation time."
          },
          "date_of_birth": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date of birth."
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "E-mail."
          },
          "entity_id": {
            "type": "string",
            "format": "uuid",
            "description": "Organisation of the bank managing the cardholder."
          },
          "first_name": {
            "type": "string",
            "description": "First name."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Identifier of the cardholder."
          },
          "kyc_level": {
            "type": "integer",
            "format": "int32",
            "description": "Know-your-customer level: 0 none, 1 simplified, 2 standard, 3 enhanced."
          },
          "last_name": {
            "type": "string",
            "description": "Last name."
          },
          "nationality": {
            "type": [
              "string",
              "null"
            ],
            "description": "Nationality, ISO 3166-1 alpha-2."
          },
          "pep": {
            "type": "boolean",
            "description": "Politically exposed person."
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "description": "Phone, international format."
          },
          "status": {
            "type": "string",
            "description": "`active` for a customer in relationship."
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "description": "The bank."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Last change."
          }
        }
      },
      "CardsPage": {
        "type": "object",
        "description": "A page of cards.",
        "required": [
          "cards",
          "total_exact",
          "holders"
        ],
        "properties": {
          "cards": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CardResponse"
            }
          },
          "holders": {
            "type": "object",
            "description": "The cardholders of the page's cards, by identifier: first and last names."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cursor of the next page; none on the last one."
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Number of matching cards (counted up to 10 000)."
          },
          "total_exact": {
            "type": "boolean",
            "description": "Whether `total` is exact."
          }
        }
      },
      "CheckTrace": {
        "type": "object",
        "description": "One check of the authorization: what was checked, the result, and a link to the object\n(card, product, rule, limit, account, 3DS authentication) for the back office.",
        "required": [
          "stage",
          "kind",
          "label",
          "outcome"
        ],
        "properties": {
          "detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the check found (French)."
          },
          "kind": {
            "type": "string",
            "description": "card_status, expiry, pin, cvv2, cryptogram, 3ds, product_restriction, card_service,\nrule, limit, funds"
          },
          "label": {
            "type": "string",
            "description": "Label of the check (French)."
          },
          "outcome": {
            "type": "string",
            "description": "pass | fail | flag | skip | info"
          },
          "ref_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Identifier of the object checked."
          },
          "ref_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "card | product | rule | card_limits | account | three_ds"
          },
          "stage": {
            "$ref": "#/components/schemas/PipelineStage",
            "description": "Step of the check."
          }
        }
      },
      "CreateAccountRequest": {
        "type": "object",
        "required": [
          "entity_id"
        ],
        "properties": {
          "account_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The bank's account number."
          },
          "cardholder_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Holder of the account."
          },
          "currency_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Currency, ISO 4217 (`EUR` by default)."
          },
          "entity_id": {
            "type": "string",
            "format": "uuid",
            "description": "Organisation of the bank."
          },
          "iban": {
            "type": [
              "string",
              "null"
            ],
            "description": "IBAN."
          }
        }
      },
      "CreateCardRequest": {
        "type": "object",
        "required": [
          "entity_id",
          "cardholder_id",
          "product_code"
        ],
        "properties": {
          "account_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Account to debit (the cardholder's account by default)."
          },
          "card_role": {
            "type": [
              "string",
              "null"
            ],
            "description": "`STANDALONE` (default), `PRIMARY`, `SUPPLEMENTARY` or `DERIVED` (these two need `parent_card_id`)."
          },
          "cardholder_id": {
            "type": "string",
            "format": "uuid",
            "description": "The cardholder."
          },
          "contract_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Contract the card belongs to."
          },
          "entity_id": {
            "type": "string",
            "format": "uuid",
            "description": "Organisation of the bank holding the card."
          },
          "external_reference": {
            "type": [
              "string",
              "null"
            ],
            "description": "The bank's own reference."
          },
          "form_factor": {
            "type": [
              "string",
              "null"
            ],
            "description": "`PHYSICAL` (default, manufactured), `VIRTUAL` (usable at once) or `TOKENIZED`."
          },
          "language_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Language of the card, ISO 639-1."
          },
          "parent_card_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Main card, for a supplementary or derived card."
          },
          "product_code": {
            "type": "string",
            "description": "Code of the card product (`GET /card-products`)."
          },
          "visual_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Design among the product's (`GET /card-products/{id}/visuals`); the product's default otherwise."
          }
        }
      },
      "CreateCardholderRequest": {
        "type": "object",
        "required": [
          "entity_id",
          "first_name",
          "last_name"
        ],
        "properties": {
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "E-mail."
          },
          "entity_id": {
            "type": "string",
            "format": "uuid",
            "description": "Organisation of the bank managing the cardholder."
          },
          "first_name": {
            "type": "string",
            "description": "First name."
          },
          "last_name": {
            "type": "string",
            "description": "Last name."
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "description": "Phone, international format."
          }
        }
      },
      "CreateWebhookBody": {
        "type": "object",
        "description": "A webhook subscription.",
        "required": [
          "url",
          "events"
        ],
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Event types, e.g. `authorization.approved`, `card.status_changed`; `*` for all."
          },
          "url": {
            "type": "string",
            "description": "HTTPS address receiving the events."
          }
        }
      },
      "CreditBody": {
        "type": "object",
        "description": "Money paid into an account.",
        "required": [
          "amount"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "description": "Cents."
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "EntityResponse": {
        "type": "object",
        "required": [
          "id",
          "tenant_id",
          "name",
          "entity_type",
          "status",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Creation time."
          },
          "entity_type": {
            "$ref": "#/components/schemas/EntityType",
            "description": "Kind of organisation."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Identifier of the organisation."
          },
          "name": {
            "type": "string",
            "description": "Name."
          },
          "parent_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Parent organisation (none for the bank itself)."
          },
          "status": {
            "$ref": "#/components/schemas/EntityStatus",
            "description": "Status."
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "description": "The bank."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Last change."
          }
        }
      },
      "EntityStatus": {
        "type": "string",
        "enum": [
          "active",
          "suspended",
          "closed"
        ]
      },
      "EntityType": {
        "type": "string",
        "enum": [
          "institution",
          "program",
          "bin_range"
        ]
      },
      "ErrorBody": {
        "type": "object",
        "description": "An error.",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorDetail"
          }
        }
      },
      "ErrorDetail": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "format": "int32",
            "description": "The HTTP status.",
            "example": 404,
            "minimum": 0
          },
          "message": {
            "type": "string",
            "description": "What went wrong (French, for the portal's users).",
            "example": "Carte introuvable"
          }
        }
      },
      "EventEnvelope": {
        "type": "object",
        "description": "The envelope of every event (webhooks, Kafka, journal).",
        "required": [
          "eventId",
          "eventType",
          "occurredAt",
          "tenantId",
          "aggregateType",
          "aggregateId",
          "version",
          "actorType",
          "payload",
          "metadata"
        ],
        "properties": {
          "actor": {
            "type": [
              "string",
              "null"
            ]
          },
          "actorType": {
            "type": "string",
            "description": "`system`, `user`, `integration`."
          },
          "aggregateId": {
            "type": "string"
          },
          "aggregateType": {
            "type": "string",
            "description": "`authorization`, `card`, `file`, `dispute`…"
          },
          "causationId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "correlationId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The operation the event belongs to."
          },
          "eventId": {
            "type": "string",
            "format": "uuid",
            "description": "Unique: a consumer deduplicates on it (delivery at least once)."
          },
          "eventType": {
            "type": "string",
            "description": "`<object>.<fact>`, e.g. `authorization.captured`."
          },
          "metadata": {
            "type": "object"
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "payload": {
            "type": "object",
            "description": "The object after the change."
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "GridQuery": {
        "type": "object",
        "description": "A page of a list, given as the JSON of the `grid` parameter (URL-encoded): search, filters,\nsort, page size and the cursor of the previous page.",
        "properties": {
          "cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "`next_cursor` of the previous page."
          },
          "filters": {
            "type": [
              "object",
              "null"
            ],
            "description": "Values kept for each filter (any of them).",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "limit": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Page size (25 by default, 500 at most)."
          },
          "q": {
            "type": [
              "string",
              "null"
            ],
            "description": "Free search (name, last four digits, merchant, identifier…)."
          },
          "sort": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/GridSort"
              }
            ]
          }
        },
        "example": {
          "filters": {
            "status": [
              "active"
            ]
          },
          "limit": 50,
          "q": "martin",
          "sort": {
            "dir": "desc",
            "key": "created_at"
          }
        }
      },
      "GridSort": {
        "type": "object",
        "required": [
          "key",
          "dir"
        ],
        "properties": {
          "dir": {
            "type": "string",
            "description": "`asc` or `desc`."
          },
          "key": {
            "type": "string"
          }
        }
      },
      "IdResponse": {
        "type": "object",
        "description": "The identifier of what was created.",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "IncrementBody": {
        "type": "object",
        "description": "Incremental authorization of a pre-authorization.",
        "required": [
          "amount"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "description": "Extra amount, in cents."
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "LifecycleBody": {
        "type": "object",
        "description": "Presentment or refund.",
        "properties": {
          "amount": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Cents. Presentment: the authorized amount by default. Refund: required."
          },
          "reference": {
            "type": [
              "string",
              "null"
            ],
            "description": "Reference of the merchant or of the network."
          }
        }
      },
      "MessageInfo": {
        "type": "object",
        "description": "Message type, origin and amounts of an authorization beyond the decision.",
        "required": [
          "message_type",
          "source",
          "incremented_cents"
        ],
        "properties": {
          "cashback_cents": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Cash-back with purchase: the cash part of the amount (never refunded)."
          },
          "children": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "hold_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "End of the validity: the hold is released then if neither presented nor reversed."
          },
          "incremented_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Total added by incremental authorizations (included in the amount)."
          },
          "initial_cents": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Amount granted at decision time."
          },
          "message_type": {
            "type": "string",
            "description": "authorization | preauth"
          },
          "mit_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "parent_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Merchant-initiated authorization: its parent and reason; linked children of this one."
          },
          "requested_amount": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Amount asked for, when a partial approval granted less."
          },
          "retried_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "retry_of": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Declined attempt this one retries, and the attempt that retried this one."
          },
          "reversed_cents": {
            "type": "integer",
            "format": "int64",
            "description": "Total released by partial reversals (deducted from the amount)."
          },
          "source": {
            "type": "string",
            "description": "api | portal | simulator"
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StepBrief"
            },
            "description": "Steps after the decision, in order."
          }
        }
      },
      "NewCaseBody": {
        "type": "object",
        "description": "A new dispute case.",
        "required": [
          "authorization_ids"
        ],
        "properties": {
          "assigned_to": {
            "type": [
              "string",
              "null"
            ]
          },
          "authorization_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The disputed authorizations (one active case per transaction)."
          },
          "case_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "`fraud`, `cardholder_dispute`, `non_receipt`, `processing_error`, `authorization`, `other`."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cardholder's statement."
          },
          "disputed_cents": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Disputed amount in cents (the transactions' amounts by default)."
          },
          "open": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Open at once (a draft otherwise)."
          },
          "priority": {
            "type": [
              "string",
              "null"
            ],
            "description": "`low`, `normal`, `high`, `urgent`."
          },
          "reason_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Network reason code, e.g. `10.4`, `13.1`."
          }
        }
      },
      "NoteBody": {
        "type": "object",
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string"
          }
        }
      },
      "OperationsPage": {
        "type": "object",
        "description": "A page of authorizations.",
        "required": [
          "authorizations",
          "total_exact",
          "cards"
        ],
        "properties": {
          "authorizations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuthorizeResponse"
            }
          },
          "cards": {
            "type": "object",
            "description": "The page's cards and organisations, by identifier."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "total_exact": {
            "type": "boolean"
          }
        }
      },
      "PipelineStage": {
        "type": "string",
        "enum": [
          "decode",
          "identify",
          "validate",
          "check_rules",
          "reserve",
          "respond"
        ]
      },
      "ProposalBody": {
        "type": "object",
        "description": "A financial decision proposed on a case.",
        "required": [
          "decision_type"
        ],
        "properties": {
          "amount_cents": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "decision_type": {
            "type": "string",
            "description": "`provisional_credit` (credit the cardholder during the case), `rebill` (take the credit\nback), `write_off` (the bank keeps the loss)."
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ReverseBody": {
        "type": "object",
        "description": "Reversal, total or partial.",
        "properties": {
          "amount": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Released amount, in cents (partial reversal)."
          },
          "new_total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Or the new total authorized, in cents."
          },
          "reference": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ScaInfo": {
        "type": "object",
        "description": "SCA outcome recorded with the authorization (for disputes 10.4 and reporting).",
        "properties": {
          "cavv_result": {
            "type": [
              "string",
              "null"
            ],
            "description": "CAVV verification result, as Field 44.13: 2 valid (authentication), 8 valid (Visa\nAttempts service), 1 failed, 0 not verified."
          },
          "eci": {
            "type": [
              "string",
              "null"
            ],
            "description": "Electronic commerce indicator."
          },
          "exemption": {
            "type": [
              "string",
              "null"
            ],
            "description": "Exemption applied (`low_value`, `tra`, `mit`)."
          }
        }
      },
      "StageResult": {
        "type": "object",
        "required": [
          "stage",
          "passed",
          "duration_ms"
        ],
        "properties": {
          "detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the step found."
          },
          "duration_ms": {
            "type": "integer",
            "format": "int64",
            "description": "Time spent, milliseconds.",
            "minimum": 0
          },
          "passed": {
            "type": "boolean",
            "description": "Whether the operation passed it."
          },
          "stage": {
            "$ref": "#/components/schemas/PipelineStage",
            "description": "The step."
          }
        }
      },
      "StandIn": {
        "type": "object",
        "description": "Decision of the network's stand-in processing (STIP), from its advice (0120).",
        "required": [
          "response_code"
        ],
        "properties": {
          "auth_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Authorization code the network gave (F38)."
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Reason of the stand-in (F63.4): 9001 issuer signed off or unavailable, 9020 time-out…"
          },
          "response_code": {
            "type": "string",
            "description": "Response the network gave the acquirer (F39)."
          }
        }
      },
      "StepBrief": {
        "type": "object",
        "description": "One step after the decision, as summarised in lists: event type, amount, anomaly.",
        "required": [
          "t",
          "a"
        ],
        "properties": {
          "a": {
            "type": "integer",
            "format": "int64",
            "description": "Amount of the step, cents."
          },
          "r": {
            "type": [
              "string",
              "null"
            ],
            "description": "Response code of the step."
          },
          "t": {
            "type": "string",
            "description": "incremental | partial_reversal | reversal | completion_advice | capture | credit_auth |\nrefund | expiry"
          },
          "v": {
            "type": "boolean",
            "description": "Visa message journal entry (`t` is then a spec/visa catalog key, `r` the F39 answered)."
          },
          "x": {
            "type": "boolean",
            "description": "The step was accepted against the rules (late or unequal presentment…)."
          }
        }
      },
      "ThreeDsData": {
        "type": "object",
        "properties": {
          "cavv": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cardholder authentication verification value produced by 3-D Secure."
          },
          "eci": {
            "type": [
              "string",
              "null"
            ],
            "description": "Electronic commerce indicator (`05` authenticated, `06` attempted, `07` not authenticated)."
          },
          "exemption": {
            "type": [
              "string",
              "null"
            ],
            "description": "low_value | tra | mit (merchant-initiated, out of SCA scope)"
          }
        }
      },
      "UpdateCardServiceRequest": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "description": "`active` or `inactive`."
          }
        }
      },
      "UpdateCardStatusRequest": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "reason_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Reason code (kept in the history)."
          },
          "reason_detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "Free text (kept in the history)."
          },
          "status": {
            "$ref": "#/components/schemas/CardStatus",
            "description": "Target status: only the transitions of the lifecycle are allowed."
          }
        }
      },
      "UpdateWebhookBody": {
        "type": "object",
        "properties": {
          "active": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "events": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Verification": {
        "type": "object",
        "description": "Outcome of the security checks done before the authorization (simulated in the POC).",
        "properties": {
          "cdcvm": {
            "type": [
              "string",
              "null"
            ],
            "description": "Consumer device cardholder verification (mobile wallet): \"ok\"."
          },
          "cryptogram": {
            "type": [
              "string",
              "null"
            ],
            "description": "Chip cryptogram (ARQC): \"valid\" | \"invalid\"."
          },
          "cvv": {
            "type": [
              "string",
              "null"
            ],
            "description": "CVV / iCVV read from the magnetic stripe or the chip: \"valid\" | \"invalid\"."
          },
          "cvv2": {
            "type": [
              "string",
              "null"
            ],
            "description": "CVV2 (card not present): \"match\" | \"no_match\"."
          },
          "pin": {
            "type": [
              "string",
              "null"
            ],
            "description": "PIN: \"ok\" | \"wrong\" | \"tries_exceeded\" | \"unverifiable\"."
          }
        }
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Access token of the platform's identity server (OAuth 2.0: client credentials for a bank's system, password or authorization code for a user)."
      },
      "platform_bank": {
        "type": "apiKey",
        "in": "header",
        "name": "X-UBO-Tenant",
        "description": "Platform administrators only: the bank to work on (its identifier); without it, every bank read only."
      }
    }
  },
  "security": [
    {
      "bearer": []
    }
  ],
  "tags": [
    {
      "name": "Cardholders",
      "description": "The bank's customers. A cardholder belongs to an organisation of the bank, has an identity, a due-diligence level (KYC, PEP, AML risk) read by the authorization rules, accounts and cards. Permissions `cardholders:read`, `cardholders:write`."
    },
    {
      "name": "Accounts",
      "description": "The card accounts. An account has a booked balance, amounts held by authorizations not yet presented, and an available balance (booked − held + overdraft) checked when each authorization reserves its amount. Its ledger records holds, releases, debits and credits."
    },
    {
      "name": "Cards",
      "description": "Cards of the cardholders. A card is issued on a product, in its BIN range; its number is sealed in the vault and never returned (`last_four` displays it). It follows a lifecycle: created → pending_activation → active, then suspended, blocked, lost, stolen, cancelled, expired, renewed, replaced; only the allowed transitions are accepted. Its services (channels) and limits come from the product and can be changed per card."
    },
    {
      "name": "Products",
      "description": "The bank's card range. A product sets the network, the BIN range, debit or credit, the currency, the channels, countries and MCCs allowed, the limits, the services and the designs of its cards; it is versioned, a card keeps the version it was issued on."
    },
    {
      "name": "Organisations",
      "description": "The bank's structure as a tree: the bank, its brands, networks, legal entities. Organisations file the cardholders, cards and products, scope the rules and limits, and limit what a user sees."
    },
    {
      "name": "Authorizations",
      "description": "Payment authorizations. Each request goes through six steps — decode, identify the card, validate (status, expiry, PIN, CVV, chip cryptogram, 3-D Secure), the bank's rules, reserve (funds and limits), respond — and is recorded with its decision. Then its lifecycle: presentment (capture), partial or total reversal, refund, increment, expiry. In production the requests come from the networks (ISO 8583 stations) and the presentments from the clearing files; the API runs the same path."
    },
    {
      "name": "Decisions",
      "description": "The record of each decision: outcome, deciding step and element (a rule and its version, a limit, a check), rules evaluated with their conditions and the values read, external calls, response fields changed, a sentence of explanation, and a SHA-256 fingerprint checked at each read. A decision can be replayed with the rules of the time or today's."
    },
    {
      "name": "Alerts",
      "description": "Operations flagged by the rules (probable fraud, AML) or by sanctions screening, to review: open → in_review → closed with a resolution."
    },
    {
      "name": "Disputes",
      "description": "Dispute cases, issuer side. A case groups disputed transactions, encrypted evidence, network and internal deadlines (PSD2 refund by the next business day), financial decisions approved by a second person above the bank's threshold, and the exchanges with the network (chargeback, pre-arbitration, arbitration)."
    },
    {
      "name": "Webhooks",
      "description": "Subscriptions to the bank's events, delivered as signed HTTPS POSTs (HMAC-SHA256), retried 6 times at most with an increasing delay, at least once: deduplicate on the event's `id`."
    },
    {
      "name": "Events",
      "description": "The journal of the business events, written in the same transaction as the change they describe, then fanned out to the webhooks and published on Kafka (one topic per object type, keyed by the object: order kept per object)."
    },
    {
      "name": "Files",
      "description": "Files received and produced (card status, authorization journal, accounting report, clearing). A file is immutable; it is checked line by line against its declarative format and its control totals, integrated in the background, replayable line by line; the same content is received once only. Files also travel over SFTP with acknowledgements."
    },
    {
      "name": "Platform",
      "description": "Health of the platform."
    }
  ]
}
