{
  "openapi": "3.0.0",
  "paths": {
    "/v1/auth/sign-up": {
      "post": {
        "operationId": "AuthController_signUp",
        "summary": "Create an account",
        "description": "Creates an organization and its first user, then signs in. Answers identically whether or not the address is already registered, so this route cannot be used to enumerate accounts. Sets the session cookie; no token appears in the response body.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignUpDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/sign-in": {
      "post": {
        "operationId": "AuthController_signIn",
        "summary": "Sign in",
        "description": "Verifies email and password and issues a session. For an account with an active second factor, returns a `SessionChallengeDto` (challengeToken) instead, with no cookie set — complete with `POST /v1/auth/sign-in/mfa`.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignInDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/sign-in/mfa": {
      "post": {
        "operationId": "AuthController_signInWithMfa",
        "summary": "Complete sign-in with a second factor",
        "description": "Prerequisite: a `challengeToken` from a `sign-in` response that returned an MFA challenge. Verifies the TOTP or recovery code and issues the session.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MfaChallengeDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/sign-out": {
      "post": {
        "operationId": "AuthController_signOut",
        "summary": "Sign out",
        "description": "Revokes the current session and clears the session cookie regardless of whether the revocation call succeeded.",
        "parameters": [],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/session": {
      "get": {
        "operationId": "AuthController_session",
        "summary": "Current session",
        "description": "Returns the current signed-in user, their organization, their roles, and `servedKeyEnvironments` — the API-key environments this deployment issues and accepts (`[\"test\",\"live\"]` locally, `[\"test\"]` on the hosted sandbox, `[\"live\"]` in production; ADR-036). The route the cabinet calls on every page load.",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/verify-email": {
      "post": {
        "operationId": "AuthController_verifyEmail",
        "summary": "Verify email address",
        "description": "Redeems a verification token from the emailed link, marking the account's email verified. Required before a `live` API key can be created.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyEmailDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          }
        },
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/resend-verification": {
      "post": {
        "operationId": "AuthController_resendVerification",
        "summary": "Resend verification email",
        "description": "Issues a fresh verification link. Answers 204 regardless of whether anything was sent, including for an already-verified account.",
        "parameters": [],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/request-password-reset": {
      "post": {
        "operationId": "AuthController_requestPasswordReset",
        "summary": "Request a password reset",
        "description": "Always answers 204, including for an address with no account — the uniform answer is the point, not a simplification of it.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestPasswordResetDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          }
        },
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/reset-password": {
      "post": {
        "operationId": "AuthController_resetPassword",
        "summary": "Reset a password",
        "description": "Redeems a reset token and sets a new password. Every session of that user is revoked, including the one performing the reset if it is holding a stale cookie.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          }
        },
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/change-password": {
      "post": {
        "operationId": "AuthController_changePassword",
        "summary": "Change password",
        "description": "For a signed-in user; requires the current password. Revokes every OTHER session — the tab performing the change stays signed in, everyone else is signed out.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePasswordDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          }
        },
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/auth/invitations/{token}/accept": {
      "post": {
        "operationId": "AuthController_acceptInvitation",
        "summary": "Accept an invitation",
        "description": "Redeems an organization invitation token. No session required — the caller may not have an account yet. `password` is required only when the invited email has no existing account.",
        "parameters": [
          {
            "name": "token",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptInvitationDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "auth"
        ]
      }
    },
    "/v1/dashboard/escrows": {
      "get": {
        "operationId": "DashboardController_list",
        "summary": "List the signed-in organization’s escrows",
        "description": "Session-authenticated read of the same rows `GET /v1/escrows` exposes to an API key. `organizationId` always comes from the session, never a parameter. `q` searches escrow id prefix, order-reference prefix or an exact wallet; another organization's escrow never matches.",
        "parameters": [
          {
            "name": "q",
            "required": false,
            "in": "query",
            "description": "Search: escrow id prefix (with or without `esc_`, any case), order-reference prefix (as written), or an exact wallet address. At least 4 characters.",
            "schema": {
              "maxLength": 200,
              "example": "esc_01J8ZQ",
              "type": "string"
            }
          },
          {
            "name": "createdFrom",
            "required": false,
            "in": "query",
            "description": "Created on or after this UTC day (YYYY-MM-DD).",
            "schema": {
              "example": "2026-10-01",
              "type": "string"
            }
          },
          {
            "name": "createdTo",
            "required": false,
            "in": "query",
            "description": "Created on or before this UTC day (YYYY-MM-DD), inclusive.",
            "schema": {
              "example": "2026-10-31",
              "type": "string"
            }
          },
          {
            "name": "amountMin",
            "required": false,
            "in": "query",
            "description": "Minimum amount, inclusive, in atomic units as a decimal string (never a float).",
            "schema": {
              "example": "1000000",
              "type": "string"
            }
          },
          {
            "name": "amountMax",
            "required": false,
            "in": "query",
            "description": "Maximum amount, inclusive, in atomic units as a decimal string (never a float).",
            "schema": {
              "example": "50000000",
              "type": "string"
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Filter by escrow status.",
            "schema": {
              "example": "FUNDED",
              "enum": [
                "CREATED",
                "AWAITING_APPROVAL",
                "AWAITING_FUNDING",
                "FUNDING_SUBMITTED",
                "FUNDED",
                "RELEASE_SUBMITTED",
                "RELEASED",
                "REFUND_SUBMITTED",
                "REFUNDED",
                "DISPUTED",
                "RESOLUTION_SUBMITTED",
                "RESOLVED",
                "CANCELLED",
                "EXPIRED",
                "PAID",
                "RECONCILIATION_REQUIRED"
              ],
              "type": "string"
            }
          },
          {
            "name": "settlementMode",
            "required": false,
            "in": "query",
            "description": "Filter by settlement mode (ADR-040).",
            "schema": {
              "$ref": "#/components/schemas/SettlementMode"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "Opaque pagination cursor from a previous response's `nextCursor`. Omit for the first page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Page size, 1-100.",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "example": 20,
              "type": "number"
            }
          },
          {
            "name": "buyerWallet",
            "required": false,
            "in": "query",
            "description": "Filter by the buyer wallet address (current buyer; provisional for a late-bound escrow until funded).",
            "schema": {
              "example": "0xAbC1230000000000000000000000000000dEf9",
              "type": "string"
            }
          },
          {
            "name": "externalReference",
            "required": false,
            "in": "query",
            "description": "Filter by the merchant-supplied external reference.",
            "schema": {
              "example": "order_4471",
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "required": false,
            "in": "query",
            "description": "Filter to the members of one milestone group (ADR-034).",
            "schema": {
              "example": "egrp_01J8Z3K4M5N6P7Q8R9S0T1V2W3",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      },
      "post": {
        "operationId": "DashboardController_createEscrow",
        "summary": "Create a payment link",
        "description": "Session-authenticated equivalent of `POST /v1/escrows`, in the **test** environment only (ADR-032). Requires OWNER or ADMIN. Same body, validation, errors and response; share the returned `checkoutUrl` with the buyer. `buyerWallet` is optional — omit it and any wallet may pay. Supports `Idempotency-Key`. On a deployment that does not serve the test environment (production, ADR-036) it answers `422` with `details.reason: environment_not_served`.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEscrowDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EscrowResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/analytics": {
      "get": {
        "operationId": "DashboardController_analytics",
        "summary": "Payment analytics",
        "description": "Payments created in the last `days` whole UTC days (1-365, default 30), counted exactly by bucket — paid (RELEASED, PAID, RESOLVED), in progress, failed (CANCELLED, EXPIRED), refunded (REFUND_SUBMITTED, REFUNDED) — in total and per UTC day (zero-filled), the settled volume of the paid ones per token as an atomic-unit string (gross of instant-order partial refunds), and `paymentLinks`, the escrows created through `POST /v1/dashboard/escrows`. Days are attributed by creation time. Session-authenticated, test environment.",
        "parameters": [
          {
            "name": "days",
            "required": false,
            "in": "query",
            "description": "Window length in whole UTC days ending today, 1-365.",
            "schema": {
              "minimum": 1,
              "maximum": 365,
              "default": 30,
              "example": 30,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentAnalyticsDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/seller-wallets": {
      "get": {
        "operationId": "DashboardController_listSellerWallets",
        "summary": "List verified seller wallets",
        "description": "Session-authenticated equivalent of `GET /v1/seller-wallets`, for choosing a seller in the payment-link form.",
        "parameters": [
          {
            "name": "sellerReference",
            "required": false,
            "in": "query",
            "description": "Only wallets verified for this seller reference.",
            "schema": {
              "example": "seller_812",
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Page size, 1-100.",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "example": 20,
              "type": "number"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "Opaque pagination cursor from a previous response's `nextCursor`. Omit for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/integration-checklist": {
      "get": {
        "operationId": "DashboardController_integrationChecklist",
        "summary": "Integration checklist",
        "description": "Four steps — an unrevoked API key, a webhook endpoint, a successful delivery, an escrow that has reached FUNDED — each read from stored data, in any environment. `done` is null when the service that knows could not be asked.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationChecklistDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/request-logs": {
      "get": {
        "operationId": "DashboardController_requestLogs",
        "summary": "API request log",
        "description": "Requests made with the organization's API keys, newest first, across both environments — the one dashboard read that is not limited to test, because it carries no money data (ADR-035). Filter by `apiKeyId`, `status` (an exact code such as 404, or a class such as 4xx), `route` (an exact route template) and `environment`; page with `cursor` and `limit` (1-100, default 50). Recorded: every request whose API key authenticated, including those refused for a missing scope, by validation, not found, conflicting or failing. Not recorded: requests without a valid key (401) and rate-limited requests (429). Never stored: request or response bodies, headers (including Authorization), the raw path or query string, IP address, user agent — `route` is the matched template. Best-effort: entries arrive within seconds and may be lost if the log store is unavailable; the API request itself is never slowed or failed by it. Kept 30 days.",
        "parameters": [
          {
            "name": "apiKeyId",
            "required": false,
            "in": "query",
            "description": "Only requests made with this API key.",
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "An exact status code (404) or a class (2xx, 4xx, 5xx).",
            "schema": {
              "example": "4xx",
              "type": "string"
            }
          },
          {
            "name": "route",
            "required": false,
            "in": "query",
            "description": "An exact route template.",
            "schema": {
              "maxLength": 200,
              "example": "/v1/escrows/:escrowId",
              "type": "string"
            }
          },
          {
            "name": "environment",
            "required": false,
            "in": "query",
            "description": "Only one environment; both when omitted.",
            "schema": {
              "enum": [
                "test",
                "live"
              ],
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "Opaque cursor from a previous response. Omit for the first page.",
            "schema": {
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Page size, 1-100.",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 50,
              "example": 50,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of the request log, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestLogPageDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/escrow-groups/{groupId}": {
      "get": {
        "operationId": "DashboardController_getGroup",
        "summary": "Get one milestone group with its members",
        "description": "Read-only: the group and every member, in milestone order, each with its current status and hosted-page links. `progress` is computed on every read. Creating a group is API-key only (`POST /v1/escrow-groups`). Another organization's group returns 404, not 403.",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EscrowGroupResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/escrows/{escrowId}": {
      "get": {
        "operationId": "DashboardController_get",
        "summary": "Get one escrow with its history and transactions",
        "description": "Composed from three internal calls: the escrow, its status history (oldest first) and its transactions (newest first). Degrades rather than fails if transaction-service is unreachable — `transactions: []` with `transactionsUnavailable: true`, never a 5xx for a secondary-service outage. Another organization's escrow returns 404, not 403.",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/webhook-endpoints": {
      "get": {
        "operationId": "DashboardController_listWebhookEndpoints",
        "summary": "List webhook endpoints",
        "description": "Session-authenticated equivalent of `GET /v1/webhook-endpoints`. `secret` is absent from every response but the creation one.",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      },
      "post": {
        "operationId": "DashboardController_createWebhookEndpoint",
        "summary": "Register a webhook endpoint",
        "description": "Session-authenticated equivalent of `POST /v1/webhook-endpoints`. The only dashboard response that carries the signing secret — shown once.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookEndpointDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/webhook-endpoints/{endpointId}/test": {
      "post": {
        "operationId": "DashboardController_sendWebhookTest",
        "summary": "Send a test event",
        "description": "Session-authenticated equivalent of `POST /v1/webhook-endpoints/{id}/test`: a signed `webhook.test` to this endpoint only, with the delivery result returned. Changes no escrow and no endpoint health.",
        "parameters": [
          {
            "name": "endpointId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/webhook-endpoints/{endpointId}": {
      "patch": {
        "operationId": "DashboardController_updateWebhookEndpoint",
        "summary": "Update a webhook endpoint",
        "description": "Partially updates URL, subscribed events, or enabled flag. Available to any signed-in member of the organization.",
        "parameters": [
          {
            "name": "endpointId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookEndpointDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      },
      "delete": {
        "operationId": "DashboardController_deleteWebhookEndpoint",
        "summary": "Remove a webhook endpoint",
        "description": "Permanently removes a webhook endpoint. Available to any signed-in member of the organization.",
        "parameters": [
          {
            "name": "endpointId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/webhook-events": {
      "get": {
        "operationId": "DashboardController_listWebhookEvents",
        "summary": "List webhook events",
        "description": "Session-authenticated equivalent of `GET /v1/webhook-events` — the only way the cabinet reaches this data, since a browser session must never authenticate against the API-key surface.",
        "parameters": [
          {
            "name": "type",
            "required": false,
            "in": "query",
            "description": "Filter by event type.",
            "schema": {
              "enum": [
                "escrow.created",
                "escrow.funded",
                "escrow.released",
                "escrow.refunded",
                "escrow.disputed",
                "escrow.resolved",
                "escrow.cancelled",
                "escrow.expired",
                "escrow.group.completed",
                "escrow.paid",
                "escrow.payment_refunded",
                "subscription.created",
                "subscription.charged",
                "subscription.payment_failed",
                "subscription.cancelled",
                "subscription.charge_refunded",
                "transaction.failed",
                "seller_wallet.verified",
                "webhook.test"
              ],
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "Opaque pagination cursor from a previous response. Omit for the first page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Page size, 1-100.",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "example": 20,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/webhook-events/{eventId}": {
      "get": {
        "operationId": "DashboardController_getWebhookEvent",
        "summary": "Get webhook event",
        "description": "Retrieves one webhook event by id.",
        "parameters": [
          {
            "name": "eventId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/webhook-events/{eventId}/deliveries": {
      "get": {
        "operationId": "DashboardController_listWebhookEventDeliveries",
        "summary": "List delivery attempts of a webhook event",
        "description": "Lists every delivery attempt of one event, including retries and replays, with per-attempt HTTP status and a bounded response-body preview.",
        "parameters": [
          {
            "name": "eventId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/webhook-events/{eventId}/replay": {
      "post": {
        "operationId": "DashboardController_replayWebhookEvent",
        "summary": "Replay webhook event",
        "description": "Redelivers an already-recorded event to every currently subscribed endpoint. Resends the original event unchanged; never regenerates it.",
        "parameters": [
          {
            "name": "eventId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/disputes": {
      "get": {
        "operationId": "DashboardController_listDisputes",
        "summary": "List disputes",
        "description": "Lists disputes for the signed-in organization, cursor-paginated. Available to any signed-in member.",
        "parameters": [
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Filter by dispute status.",
            "schema": {
              "enum": [
                "CREATED",
                "UNDER_REVIEW",
                "RESOLUTION_PREPARED",
                "RESOLVED",
                "CANCELLED"
              ],
              "type": "string"
            }
          },
          {
            "name": "q",
            "required": false,
            "in": "query",
            "description": "Search by dispute id prefix or escrow id prefix, at least 4 characters. Case-insensitive; the `dsp_` / `esc_` prefix is optional.",
            "schema": {
              "maxLength": 200,
              "example": "dsp_01J8ZQ",
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "Opaque pagination cursor from a previous response. Omit for the first page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Page size, 1-100.",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "example": 20,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/disputes/{disputeId}": {
      "get": {
        "operationId": "DashboardController_getDispute",
        "summary": "Get dispute detail",
        "description": "Retrieves a dispute plus its evidence, in submission order.",
        "parameters": [
          {
            "name": "disputeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/disputes/{disputeId}/evidence": {
      "post": {
        "operationId": "DashboardController_addDisputeEvidence",
        "summary": "Add evidence to a dispute",
        "description": "Attaches evidence metadata to one of the signed-in organization's open disputes. Requires the OWNER, ADMIN or DEVELOPER role. The decision itself is made by platform staff, never by the merchant.",
        "parameters": [
          {
            "name": "disputeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddDisputeEvidenceDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/audit-records": {
      "get": {
        "operationId": "DashboardController_listAuditRecords",
        "summary": "Search audit records",
        "description": "Searches the signed-in organization's audit trail. `organizationId` is always the session's own; a member can search their own organization's trail, never another's.",
        "parameters": [
          {
            "name": "actorId",
            "required": false,
            "in": "query",
            "description": "Filter by the id of the actor who performed the action.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "action",
            "required": false,
            "in": "query",
            "description": "Filter by action name.",
            "schema": {
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "name": "targetType",
            "required": false,
            "in": "query",
            "description": "Filter by the type of the audited target (e.g. \"escrow\").",
            "schema": {
              "maxLength": 100,
              "type": "string"
            }
          },
          {
            "name": "targetId",
            "required": false,
            "in": "query",
            "description": "Filter by the id of the audited target.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "correlationId",
            "required": false,
            "in": "query",
            "description": "Filter by request correlation id — traces every audited action one request touched.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "required": false,
            "in": "query",
            "description": "Only records at or after this RFC 3339 timestamp.",
            "schema": {
              "example": "2026-08-01T00:00:00.000Z",
              "type": "string"
            }
          },
          {
            "name": "to",
            "required": false,
            "in": "query",
            "description": "Only records at or before this RFC 3339 timestamp.",
            "schema": {
              "example": "2026-09-01T00:00:00.000Z",
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "Opaque pagination cursor from a previous response. Omit for the first page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Page size, 1-200.",
            "schema": {
              "minimum": 1,
              "maximum": 200,
              "default": 50,
              "example": 50,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/organizations/{orgId}/invitations": {
      "post": {
        "operationId": "DashboardController_inviteMember",
        "summary": "Invite a colleague",
        "description": "Requires OWNER or ADMIN. Sends an invitation for the given email to join with the given role.",
        "parameters": [
          {
            "name": "orgId",
            "required": true,
            "in": "path",
            "description": "Your organization's id. Ignored: the organization always comes from the session.",
            "schema": {}
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteMemberDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      },
      "get": {
        "operationId": "DashboardController_listInvitations",
        "summary": "List pending invitations",
        "description": "Lists outstanding (not yet accepted or revoked) invitations. Available to any signed-in member.",
        "parameters": [
          {
            "name": "orgId",
            "required": true,
            "in": "path",
            "description": "Your organization's id. Ignored: the organization always comes from the session.",
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/organizations/{orgId}/invitations/{invitationId}": {
      "delete": {
        "operationId": "DashboardController_revokeInvitation",
        "summary": "Revoke an invitation",
        "description": "Requires OWNER or ADMIN. Revokes a pending invitation before it is accepted.",
        "parameters": [
          {
            "name": "invitationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orgId",
            "required": true,
            "in": "path",
            "description": "Your organization's id. Ignored: the organization always comes from the session.",
            "schema": {}
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/organizations/{orgId}/members": {
      "get": {
        "operationId": "DashboardController_listMembers",
        "summary": "List organization members",
        "description": "Lists every member of the organization with their active roles. Available to any signed-in member.",
        "parameters": [
          {
            "name": "orgId",
            "required": true,
            "in": "path",
            "description": "Your organization's id. Ignored: the organization always comes from the session.",
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/organizations/{orgId}/members/{userId}/role": {
      "patch": {
        "operationId": "DashboardController_changeRole",
        "summary": "Change a member's role",
        "description": "Requires OWNER or ADMIN. Also the grant/withdraw surface for DISPUTE_OPERATOR — no separate route. `reason` is required when granting or revoking DISPUTE_OPERATOR.",
        "parameters": [
          {
            "name": "userId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orgId",
            "required": true,
            "in": "path",
            "description": "Your organization's id. Ignored: the organization always comes from the session.",
            "schema": {}
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeRoleDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/organizations/{orgId}/members/{userId}": {
      "delete": {
        "operationId": "DashboardController_removeMember",
        "summary": "Remove a member",
        "description": "Requires OWNER or ADMIN. Removes a member's access to the organization entirely.",
        "parameters": [
          {
            "name": "userId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orgId",
            "required": true,
            "in": "path",
            "description": "Your organization's id. Ignored: the organization always comes from the session.",
            "schema": {}
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/mfa/enroll": {
      "post": {
        "operationId": "DashboardController_enrollMfa",
        "summary": "Begin TOTP enrolment",
        "description": "Starts second-factor enrolment for the signed-in user, returning a TOTP secret and provisioning URI. Does not yet gate sign-in and issues no recovery codes — complete with `POST /v1/dashboard/mfa/confirm` first.",
        "parameters": [],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/mfa/confirm": {
      "post": {
        "operationId": "DashboardController_confirmMfa",
        "summary": "Confirm TOTP enrolment",
        "description": "Prerequisite: `POST /v1/dashboard/mfa/enroll` must have been called first. Verifies the holder can generate a valid code and returns ten single-use recovery codes — shown exactly once, here only.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmMfaDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/mfa": {
      "delete": {
        "operationId": "DashboardController_removeMfa",
        "summary": "Remove the second factor",
        "description": "Requires a valid current TOTP or recovery code, supplied in the body, to disable second-factor authentication for the signed-in user.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmMfaDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/brand": {
      "get": {
        "operationId": "BrandController_getBrand",
        "summary": "Read your brand profile",
        "description": "Session-authenticated. Any member may read. The display name, description and logo shown on your hosted checkout. `logoUploadEnabled` is false when the operator configured no logo storage. An organization that has set nothing gets empty fields at version 0.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandSettingsDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      },
      "put": {
        "operationId": "BrandController_updateBrand",
        "summary": "Set your brand name and description",
        "description": "Session-authenticated; requires OWNER or ADMIN. A field you omit is unchanged; `null` or blank clears it. The name is one line of at most 60 characters; the description at most 280 characters on at most 4 lines; both are shown as plain text. Send `expectedVersion` to refuse the write if someone else changed the profile first (409 `brand_version_conflict`). Answers 422 `brand_name_invalid` or `brand_description_invalid`. Changes show on checkouts within about 30 seconds.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBrandDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandSettingsDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/brand/logo": {
      "put": {
        "operationId": "BrandController_setLogo",
        "summary": "Upload or replace your logo",
        "description": "Session-authenticated; requires OWNER or ADMIN. `multipart/form-data` with one file in the field `file`: PNG, JPEG or WebP, at most 2 MB and 4096×4096 pixels. The image is checked by content, re-encoded to WebP at no more than 512×512 and stripped of metadata; the file you send is never served. Answers 409 `logo_storage_not_configured` when the operator configured no logo storage, 413 `logo_too_large`, 422 `logo_type_unsupported`, `logo_unreadable` or `logo_dimensions_exceeded`, and 503 `logo_storage_unavailable` (your previous logo is untouched). Uploading the same picture again changes nothing. Shows on checkouts within about 30 seconds.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandSettingsDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      },
      "delete": {
        "operationId": "BrandController_removeLogo",
        "summary": "Remove your logo",
        "description": "Session-authenticated; requires OWNER or ADMIN. The name and description stay. Removing when there is no logo is a no-op. Works even if logo storage has since been turned off.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandSettingsDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/embed-origins": {
      "get": {
        "operationId": "BrandController_list",
        "summary": "List the sites allowed to frame your checkout",
        "description": "Session-authenticated. Any member may read. Each entry is a canonical origin (`scheme://host[:port]`). At most 10 per organization.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbedOriginListDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      },
      "post": {
        "operationId": "BrandController_add",
        "summary": "Allow a site to frame your checkout",
        "description": "Session-authenticated; requires OWNER or ADMIN. HTTPS only (plain HTTP for localhost, 127.0.0.1, [::1], *.localhost and *.test). No wildcard, path, query or credentials. Registering the same origin again returns it with 200. Answers 422 `embed_origin_invalid` for an unacceptable origin and 409 `embed_origin_limit` at 10.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddEmbedOriginDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbedOriginDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/embed-origins/{originId}": {
      "delete": {
        "operationId": "BrandController_remove",
        "summary": "Stop allowing a site to frame your checkout",
        "description": "Session-authenticated; requires OWNER or ADMIN. Removing an origin that is already gone is a no-op.",
        "parameters": [
          {
            "name": "originId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/staff/merchants/{organizationId}/brand": {
      "get": {
        "operationId": "StaffBrandController_get",
        "summary": "Read a merchant's brand profile",
        "description": "Any staff role. The name, description and logo the merchant shows on its checkouts, so a take-down can be judged first.",
        "parameters": [
          {
            "name": "organizationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandSettingsDto"
                }
              }
            }
          }
        },
        "tags": [
          "staff"
        ]
      },
      "delete": {
        "operationId": "StaffBrandController_reset",
        "summary": "Reset a merchant's branding",
        "description": "STAFF_ADMIN only. Clears the name, description and logo, so checkouts are unbranded. Embed origins are NOT touched. A no-op, with the same 204, when there is nothing to remove. Unknown organization is 404. One audit record per real removal.",
        "parameters": [
          {
            "name": "organizationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/merchants/{organizationId}/brand/logo": {
      "delete": {
        "operationId": "StaffBrandController_removeLogo",
        "summary": "Remove a merchant's logo",
        "description": "STAFF_ADMIN only. Clears the logo and keeps the name and description. Works when logo storage is not configured (the object, if any, is left to the cleanup sweep). A no-op, with the same 204, when there is no logo. Unknown organization is 404. One audit record per real removal.",
        "parameters": [
          {
            "name": "organizationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/checkout/{escrowId}/embed-origin": {
      "get": {
        "operationId": "CheckoutEmbedController_check",
        "summary": "May this origin show the checkout in a frame?",
        "description": "No credential required. `allowed` is true only when the origin is exactly (canonical form) one the escrow's organization registered. Used by the public site to send `frame-ancestors`; an unknown escrow id answers the same generic 404 as the rest of checkout.",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbedOriginCheckDto"
                }
              }
            }
          }
        },
        "tags": [
          "checkout"
        ]
      }
    },
    "/v1/checkout/{escrowId}": {
      "get": {
        "operationId": "CheckoutController_get",
        "summary": "Get the checkout view of an escrow",
        "description": "No credential required — the escrow id itself is the capability. Returns an allow-listed projection (15 fields) of the escrow — including `fundingDeadline` (the payment window), `expiresAt` (when the buyer's own refund right unlocks) and `settlementMode` (`INSTANT` means the payment goes straight to the seller and is not escrow-protected, ADR-040) — never the full merchant-facing shape. This is also the buyer's polling endpoint: one projection means the displayed status and the payment amount can never disagree. An unknown escrow id and one belonging to another organization both return an identical generic 404, so this route cannot be used to enumerate escrow ids.",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "checkout"
        ]
      }
    },
    "/v1/checkout/{escrowId}/funding-intent": {
      "post": {
        "operationId": "CheckoutController_fundingIntent",
        "summary": "Prepare funding transaction(s)",
        "description": "No credential required. Returns one or two unsigned transactions — `[approve, createAndFund]`, or `[createAndFund]` alone when the buyer's allowance already covers the amount — for the buyer's own wallet to sign. Preparation changes no state on the escrow's status. Body: `buyerWallet` (optional address) is the wallet the buyer will pay from. Required when the escrow was created without a buyer (\"pay from any wallet\"): it is bound as the buyer, and may be replaced by a later call until funding is submitted. When the merchant fixed the buyer at creation it must match (409 `buyer_wallet_mismatch` otherwise). Once a funding transaction has been submitted the buyer cannot change (409 `funding_submitted`).",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FundingIntentDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "checkout"
        ]
      }
    },
    "/v1/checkout/{escrowId}/funding-transactions": {
      "post": {
        "operationId": "CheckoutController_registerFunding",
        "summary": "Register a funding transaction hash (a claim, not a confirmation)",
        "description": "No credential required. Registers a transaction hash the buyer's wallet already broadcast — an untrusted claim, verified against confirmed chain evidence before anything is believed. Returns 202 with status FUNDING_SUBMITTED; the escrow becomes FUNDED only once the indexer observes the funding event at the configured confirmation depth. Idempotent on the hash.",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterTransactionDto"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": ""
          }
        },
        "tags": [
          "checkout"
        ]
      }
    },
    "/v1/checkout/{escrowId}/release-intent": {
      "post": {
        "operationId": "CheckoutController_releaseIntent",
        "summary": "Prepare the release transaction",
        "description": "No credential required. Returns unsigned calldata for the buyer's own wallet to release a funded escrow to the seller — release lives on checkout, not the merchant dashboard, because the contract requires `msg.sender == escrow.buyer`. Prerequisite: the escrow must be in a releasable state; refused otherwise, naming the current and required state. `expectedRecipients` shows the seller and fee amounts, snapshotted at creation, before the wallet prompt.",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettlementIntentDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "checkout"
        ]
      }
    },
    "/v1/checkout/{escrowId}/release-transactions": {
      "post": {
        "operationId": "CheckoutController_registerRelease",
        "summary": "Register a release transaction hash (a claim, not a confirmation)",
        "description": "No credential required. Registers a release transaction hash the buyer's wallet already broadcast — a claim, verified against confirmed chain evidence before anything is believed. The escrow reaches RELEASE_SUBMITTED here and RELEASED only when evidence at depth confirms it.",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterTransactionDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "checkout"
        ]
      }
    },
    "/v1/checkout/{escrowId}/refund-intent": {
      "post": {
        "operationId": "CheckoutController_refundIntent",
        "summary": "Prepare the refund transaction",
        "description": "No credential required. Returns unsigned calldata for the buyer's own wallet to refund a funded escrow back to themselves. The contract (ADR-014) permits this from the buyer only after the escrow's `expiresAt` has passed. Prerequisite: the escrow must be FUNDED; refused otherwise, naming the current and required state. Refunds charge no platform fee, so `expectedRecipients` names only the buyer.",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettlementIntentDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "checkout"
        ]
      }
    },
    "/v1/checkout/{escrowId}/seller-refund-intent": {
      "post": {
        "operationId": "CheckoutController_sellerRefundIntent",
        "summary": "Prepare the refund transaction for the seller",
        "description": "No credential required. Returns unsigned calldata for the seller's own wallet to refund a funded escrow back to the buyer. The contract (ADR-014) permits this from the seller at any time — no expiry required. Prerequisite: the escrow must be FUNDED; refused otherwise, naming the current and required state. Refunds charge no platform fee, so `expectedRecipients` names only the buyer.",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettlementIntentDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "checkout"
        ]
      }
    },
    "/v1/checkout/{escrowId}/payment-refund-intent": {
      "post": {
        "operationId": "CheckoutController_paymentRefundIntent",
        "summary": "Prepare the seller's refund of an instant payment",
        "description": "No credential required. For an INSTANT order in status PAID: returns unsigned calldata for the seller's own wallet — an exact `approve` of the escrow contract when the wallet's allowance is short, then `refundPayment(escrowId, amount)` — and names the buyer as recipient. `wallet` must be the order's seller and `amount` (atomic units) must be positive and at most the paid amount minus what is already refunded; refused otherwise with `details.reason` (`payment_refund_requires_seller_wallet`, `refund_exceeds_remaining`, `payment_refund_requires_instant`). The platform fee is not returned. The refund counts once its `PaymentRefunded` log is confirmed (`escrow.payment_refunded` webhook).",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentRefundIntentDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "checkout"
        ]
      }
    },
    "/v1/checkout/{escrowId}/refund-transactions": {
      "post": {
        "operationId": "CheckoutController_registerRefund",
        "summary": "Register a refund transaction hash (a claim, not a confirmation)",
        "description": "No credential required. Registers a refund transaction hash the buyer's or seller's wallet already broadcast — a claim, verified against confirmed chain evidence before anything is believed. The escrow reaches REFUND_SUBMITTED here and REFUNDED only when evidence at depth confirms it.",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterTransactionDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "checkout"
        ]
      }
    },
    "/v1/checkout/{escrowId}/disputes": {
      "post": {
        "operationId": "CheckoutController_openDispute",
        "summary": "Open a dispute",
        "description": "No credential required. Opens a dispute on a funded escrow. Returns 201 with a narrowed projection.",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "idempotency-key",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckoutOpenDisputeDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "checkout"
        ]
      }
    },
    "/v1/wallet-verifications/lookup": {
      "post": {
        "operationId": "WalletVerificationController_lookup",
        "summary": "Look up a seller wallet verification link",
        "description": "No credential required — the link token is the capability, sent in the body (never the path). Returns who asked and for which seller reference, and the link status. Send the connected wallet as `address` to receive `message`: the exact EIP-4361 text to sign, rendered by the platform. An unknown token returns the generic 404.",
        "parameters": [
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WalletVerificationLookupRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletVerificationLookupDto"
                }
              }
            }
          }
        },
        "tags": [
          "wallet-verification"
        ]
      }
    },
    "/v1/wallet-verifications/confirm": {
      "post": {
        "operationId": "WalletVerificationController_confirm",
        "summary": "Confirm a seller wallet verification",
        "description": "No credential required. Submits the signature of the message from `lookup`. The platform recovers the signer; when it is `address`, the wallet is recorded as verified for the merchant and seller reference that issued the link, and the link is used up. 422 `validation_failed` with `details.reason`: `signature_mismatch` (signed by another wallet, or a contract wallet — the link stays usable), `verification_link_used`, `verification_link_expired`. Repeating a confirmation that already succeeded returns the same result.",
        "parameters": [
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WalletVerificationConfirmRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletVerificationConfirmDto"
                }
              }
            }
          }
        },
        "tags": [
          "wallet-verification"
        ]
      }
    },
    "/v1/escrows": {
      "post": {
        "operationId": "EscrowsController_create",
        "x-required-scope": "escrows:write",
        "summary": "Create escrow",
        "description": "Creates an escrow in status CREATED. No prerequisites. `description` (optional, 1-500 characters) is shown to the buyer on the hosted checkout. `successUrl` and `cancelUrl` (optional) are where the buyer may return afterwards: absolute URLs without a username or password, https for a live key (http is also accepted for a test key), otherwise 422 `validation_failed` naming the field; the hosted pages offer them only as links the buyer clicks, carrying `escrow_id` and nothing else, and arriving at one is not proof of payment — wait for the `escrow.funded` webhook. The response carries `links` (checkout, release, sellerRefund, buyerRefund) when the deployment has a hosted checkout. `buyerWallet` is optional: omit it for a \"pay from any wallet\" escrow, whose buyer is bound when the payer requests funding calldata; supply it to lock the buyer at creation. `fundingDeadline` (optional, must not be later than `expiresAt`, defaults to `expiresAt`) is the payment window: funding cannot be started after it (409 `funding_window_closed`). `expiresAt` is the refund lock: the moment the buyer may refund themselves. `settlementMode` (optional, default `ESCROW`) chooses how the order settles: `ESCROW` holds the payment until the buyer releases it; `INSTANT` (ADR-040) pays the seller and the fee in the buyer's payment transaction and ends in `PAID` with no release, dispute or buyer refund — for goods delivered at payment. `INSTANT` with `expiresAt` is 422 `validation_failed` (`details.reason` `expires_at_not_allowed_for_instant`), and on a deployment still running escrow contract v1 it is 422 with `instant_settlement_unavailable`. The mode cannot be changed later. The platform fee is computed and snapshotted at creation (100bps, truncated) — any `platformFee` in the body is ignored. Supports `Idempotency-Key` (optional; 8-255 characters when sent, otherwise 422 `validation_failed`): the same key with the same body replays the original response; the same key with a different body is a conflict.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEscrowDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created escrow, in status CREATED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EscrowResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "escrows"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "get": {
        "operationId": "EscrowsController_list",
        "x-required-scope": "escrows:read",
        "summary": "List escrows",
        "description": "Lists escrows for the calling organization, newest first. Filterable by status, buyer wallet and external reference. Cursor-paginated.",
        "parameters": [
          {
            "name": "q",
            "required": false,
            "in": "query",
            "description": "Search: escrow id prefix (with or without `esc_`, any case), order-reference prefix (as written), or an exact wallet address. At least 4 characters.",
            "schema": {
              "maxLength": 200,
              "example": "esc_01J8ZQ",
              "type": "string"
            }
          },
          {
            "name": "createdFrom",
            "required": false,
            "in": "query",
            "description": "Created on or after this UTC day (YYYY-MM-DD).",
            "schema": {
              "example": "2026-10-01",
              "type": "string"
            }
          },
          {
            "name": "createdTo",
            "required": false,
            "in": "query",
            "description": "Created on or before this UTC day (YYYY-MM-DD), inclusive.",
            "schema": {
              "example": "2026-10-31",
              "type": "string"
            }
          },
          {
            "name": "amountMin",
            "required": false,
            "in": "query",
            "description": "Minimum amount, inclusive, in atomic units as a decimal string (never a float).",
            "schema": {
              "example": "1000000",
              "type": "string"
            }
          },
          {
            "name": "amountMax",
            "required": false,
            "in": "query",
            "description": "Maximum amount, inclusive, in atomic units as a decimal string (never a float).",
            "schema": {
              "example": "50000000",
              "type": "string"
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Filter by escrow status.",
            "schema": {
              "example": "FUNDED",
              "enum": [
                "CREATED",
                "AWAITING_APPROVAL",
                "AWAITING_FUNDING",
                "FUNDING_SUBMITTED",
                "FUNDED",
                "RELEASE_SUBMITTED",
                "RELEASED",
                "REFUND_SUBMITTED",
                "REFUNDED",
                "DISPUTED",
                "RESOLUTION_SUBMITTED",
                "RESOLVED",
                "CANCELLED",
                "EXPIRED",
                "PAID",
                "RECONCILIATION_REQUIRED"
              ],
              "type": "string"
            }
          },
          {
            "name": "settlementMode",
            "required": false,
            "in": "query",
            "description": "Filter by settlement mode (ADR-040).",
            "schema": {
              "$ref": "#/components/schemas/SettlementMode"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "Opaque pagination cursor from a previous response's `nextCursor`. Omit for the first page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Page size, 1-100.",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "example": 20,
              "type": "number"
            }
          },
          {
            "name": "buyerWallet",
            "required": false,
            "in": "query",
            "description": "Filter by the buyer wallet address (current buyer; provisional for a late-bound escrow until funded).",
            "schema": {
              "example": "0xAbC1230000000000000000000000000000dEf9",
              "type": "string"
            }
          },
          {
            "name": "externalReference",
            "required": false,
            "in": "query",
            "description": "Filter by the merchant-supplied external reference.",
            "schema": {
              "example": "order_4471",
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "required": false,
            "in": "query",
            "description": "Filter to the members of one milestone group (ADR-034).",
            "schema": {
              "example": "egrp_01J8Z3K4M5N6P7Q8R9S0T1V2W3",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of escrows, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EscrowListResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "escrows"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/escrows/{escrowId}": {
      "get": {
        "operationId": "EscrowsController_get",
        "x-required-scope": "escrows:read",
        "summary": "Get escrow",
        "description": "Retrieves one escrow by id. Carries `fundingEvidence` once funded (transaction hash, block number/hash, log index, confirmations) so a caller can verify the payment on-chain rather than trust the status alone.",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EscrowResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "escrows"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/escrows/{escrowId}/funding-intent": {
      "post": {
        "operationId": "EscrowsController_fundingIntent",
        "x-required-scope": "escrows:write",
        "summary": "Prepare funding transaction(s)",
        "description": "Returns unsigned transaction(s) (calldata) for the buyer's own wallet to sign and broadcast — the backend never signs or holds a private key. This call changes nothing on the escrow; the escrow does not advance until the resulting hash is registered and confirmed on chain. Prerequisite: the escrow must be in a pre-funding state (e.g. AWAITING_FUNDING). Body: `buyerWallet` (optional address) — required when the escrow was created without a buyer, where it is bound as the buyer (replaceable until funding is submitted); must match when the buyer was fixed at creation (409 `buyer_wallet_mismatch`).",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FundingIntentDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Unsigned transactions to sign in order. The escrow did not move.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EscrowIntentResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "escrows"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/escrows/{escrowId}/funding-transactions": {
      "post": {
        "operationId": "EscrowsController_registerFunding",
        "x-required-scope": "escrows:write",
        "summary": "Register funding transaction",
        "description": "Registers a transaction hash the buyer's wallet already broadcast. Returns 202, NOT 201 or 200 — the platform has accepted a claim for verification, not confirmed a payment. The escrow becomes FUNDED only once the indexer observes the funding event at the configured confirmation depth (poll `GET /v1/escrows/{escrowId}` or subscribe to the `escrow.funded` webhook). A verification failure against the chain is `422 transaction_verification_failed`. Prerequisite: a funding-intent should normally have been requested first, though this route accepts any hash and verifies it independently. Supports `Idempotency-Key`.",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterTransactionDto"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted for verification — not a confirmed payment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisteredFundingTransactionDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "escrows"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/escrows/{escrowId}/release-intent": {
      "post": {
        "operationId": "EscrowsController_releaseIntent",
        "x-required-scope": "escrows:write",
        "summary": "Prepare release transaction",
        "description": "Returns unsigned calldata to release a funded escrow to the seller, for the buyer's wallet to sign. Prerequisite: the escrow must be FUNDED. This call does not advance the escrow — it reaches RELEASED only once the chain confirms it. The response's `expectedRecipients` names the seller and the fee recipient and how much each receives, from the escrow's own snapshotted amounts. Partial amounts are not supported by the deployed contract (BL-02): the body takes no fields, and any field is refused with 422 — to pay in stages, create a milestone group (`POST /v1/escrow-groups`).",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettlementIntentDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Unsigned release calldata and who it pays. The escrow did not move.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EscrowIntentResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "escrows"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/escrows/{escrowId}/release-transactions": {
      "post": {
        "operationId": "EscrowsController_registerRelease",
        "x-required-scope": "escrows:write",
        "summary": "Register release transaction",
        "description": "Registers a release transaction hash the buyer's wallet already broadcast. Prerequisite: the escrow must be FUNDED (a release-intent should normally precede this). The escrow moves to RELEASE_SUBMITTED immediately (a hash was registered) and reaches RELEASED only once the chain confirms it — registering a hash is not confirmation. Supports `Idempotency-Key`.",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterTransactionDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The escrow, now RELEASE_SUBMITTED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EscrowResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "escrows"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/escrows/{escrowId}/refund-intent": {
      "post": {
        "operationId": "EscrowsController_refundIntent",
        "x-required-scope": "escrows:write",
        "summary": "Prepare refund transaction",
        "description": "Returns unsigned calldata to refund a funded escrow back to the buyer, for the buyer's wallet to sign. Prerequisite: the escrow must be FUNDED. Refunds charge no platform fee — `refundEscrow` transfers the whole amount back — so `expectedRecipients` names only the buyer. Partial amounts are not supported by the deployed contract (BL-02): the body takes no fields, and any field is refused with 422 — to pay in stages, create a milestone group (`POST /v1/escrow-groups`).",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettlementIntentDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Unsigned refund calldata and who it pays. The escrow did not move.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EscrowIntentResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "escrows"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/escrows/{escrowId}/refunds": {
      "get": {
        "operationId": "EscrowsController_refunds",
        "x-required-scope": "escrows:read",
        "summary": "List the seller's refunds of an instant payment",
        "description": "For an INSTANT order: every refund the seller sent back to the buyer, oldest first, as recorded from confirmed `PaymentRefunded` logs. A refund a chain reorganization removed stays listed with status REORGED and no longer counts toward `refundedAmount`. Empty for an ESCROW order.",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Seller refunds, oldest first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InstantRefundDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "escrows"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/escrows/{escrowId}/refund-transactions": {
      "post": {
        "operationId": "EscrowsController_registerRefund",
        "x-required-scope": "escrows:write",
        "summary": "Register refund transaction",
        "description": "Registers a refund transaction hash the buyer's wallet already broadcast. Prerequisite: the escrow must be FUNDED (a refund-intent should normally precede this). Reaches REFUNDED only once the chain confirms it. Supports `Idempotency-Key`.",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterTransactionDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The escrow, now REFUND_SUBMITTED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EscrowResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "escrows"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/escrows/{escrowId}/cancel": {
      "post": {
        "operationId": "EscrowsController_cancel",
        "x-required-scope": "escrows:write",
        "summary": "Cancel escrow",
        "description": "Cancels an escrow before it is funded. Prerequisite: the escrow must not yet be FUNDED — a funded escrow cannot be cancelled through this route, only released or refunded via chain-confirmed evidence.",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelEscrowDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The cancelled escrow.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EscrowResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "escrows"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/escrow-groups": {
      "post": {
        "operationId": "EscrowGroupsController_create",
        "x-required-scope": "escrows:write",
        "summary": "Create milestone group",
        "description": "Creates 2-20 ordinary escrows that are paid, released or refunded independently and read as one group — the way to pay a project in stages. Each item of `members` is exactly a `POST /v1/escrows` body, with the same rules and defaults; array order is the milestone order. Atomic: every member is created or none is. Each member gets its own platform fee, computed from its own amount and rounded down. An invalid member is 422 `validation_failed` naming the field as `members.<index>.<field>` (zero-based); an `externalReference` already used in the organization (the group's or a member's) is 409 and nothing is created. Supports `Idempotency-Key` for the whole request (optional; 8-255 characters when sent): the same key with the same body returns the same group; the same key with a different body is a conflict; without a key, a retried request creates a second group. When every member has reached a final state (RELEASED, REFUNDED, RESOLVED, CANCELLED or EXPIRED) one `escrow.group.completed` webhook is sent. Partial release, partial refund and split dispute outcomes are not supported by the deployed contract (BL-02) — a group of separate escrows is the supported way to pay in parts.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEscrowGroupDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The group with every member, each in status CREATED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EscrowGroupResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "escrow-groups"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/escrow-groups/{groupId}": {
      "get": {
        "operationId": "EscrowGroupsController_get",
        "x-required-scope": "escrows:read",
        "summary": "Get milestone group",
        "description": "Retrieves one milestone group with every member, in milestone order, each a full escrow with its current status and links. `progress` is computed from the members on every read; `completedAt` is when `escrow.group.completed` was sent, and is not cleared if a member is later reconciled after a chain reorganization — read `progress` for the current state. Another organization's group is 404.",
        "parameters": [
          {
            "name": "groupId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EscrowGroupResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "escrow-groups"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/seller-wallet-verifications": {
      "post": {
        "operationId": "SellerWalletsController_create",
        "x-required-scope": "escrows:write",
        "summary": "Create seller wallet verification",
        "description": "Creates a single-use link for one of your sellers to prove they control a payout wallet. Send `url` to the seller: they open it, connect a wallet and sign a message (no gas, no access to funds). `url` is returned only here — the token in it is not stored, so a lost link means creating another. It expires at `expiresAt` (72 hours by default). `sellerReference` (1-128 characters, no control characters) is your own reference for the seller and is shown to them, so do not put personal data in it. `returnUrl` (optional; https for a live key, http or https for a test key) is your page the seller comes back to: when `/embed/v1.js` opens the link in a popup, the page tells that origin `verified` or `cancelled` — advisory only. Learn the result from the `seller_wallet.verified` webhook, or poll `GET /v1/seller-wallet-verifications/{verificationId}` until `status` is `VERIFIED`; then create escrows with `sellerWalletId`. Wallets are verified per environment: a test key cannot use a live verification. 503 `service_unavailable` when this deployment has no hosted pages.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSellerWalletVerificationDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The link to send the seller, shown only in this response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SellerWalletVerificationDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "seller-wallets"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/seller-wallet-verifications/{verificationId}": {
      "get": {
        "operationId": "SellerWalletsController_getVerification",
        "x-required-scope": "escrows:read",
        "summary": "Get seller wallet verification",
        "description": "`status` is `PENDING` until the seller signs, then `VERIFIED` with `sellerWallet` (its `id` is the `sellerWalletId` for escrow creation), or `EXPIRED` if `expiresAt` passed unsigned. Never carries the link.",
        "parameters": [
          {
            "name": "verificationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SellerWalletVerificationDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "seller-wallets"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/seller-wallets": {
      "get": {
        "operationId": "SellerWalletsController_list",
        "x-required-scope": "escrows:read",
        "summary": "List seller wallets",
        "description": "Wallets your sellers have verified in this environment, newest first; filter by `sellerReference`. A seller who verifies a second wallet has two entries — neither changes the seller of an escrow that already exists.",
        "parameters": [
          {
            "name": "sellerReference",
            "required": false,
            "in": "query",
            "description": "Only wallets verified for this seller reference.",
            "schema": {
              "example": "seller_812",
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Page size, 1-100.",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "example": 20,
              "type": "number"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "Opaque pagination cursor from a previous response's `nextCursor`. Omit for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SellerWalletListResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "seller-wallets"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/seller-wallets/{sellerWalletId}": {
      "get": {
        "operationId": "SellerWalletsController_getWallet",
        "x-required-scope": "escrows:read",
        "summary": "Get seller wallet",
        "description": "One verified seller wallet.",
        "parameters": [
          {
            "name": "sellerWalletId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SellerWalletDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "seller-wallets"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/transactions/by-hash/{hash}": {
      "get": {
        "operationId": "TransactionsController_getByHash",
        "x-required-scope": "escrows:read",
        "summary": "Get transaction by hash",
        "description": "Retrieves a transaction by its on-chain hash, scoped to the caller's organization — a hash is public data, but whether this platform has a record of it is not. Returns `statusHistory` (every transition with its timestamp), which distinguishes \"pending for four seconds\" from \"pending for four hours\".",
        "parameters": [
          {
            "name": "hash",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "transactions"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/transactions/{transactionId}": {
      "get": {
        "operationId": "TransactionsController_getById",
        "x-required-scope": "escrows:read",
        "summary": "Get transaction",
        "description": "Retrieves a transaction by its platform id (the id returned by a `*-transactions` registration call). Returns `statusHistory` — every transition with its timestamp.",
        "parameters": [
          {
            "name": "transactionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "transactions"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/escrows/{escrowId}/disputes": {
      "post": {
        "operationId": "DisputesController_open",
        "x-required-scope": "disputes:write",
        "summary": "Open dispute",
        "description": "Opens a dispute on an escrow, authorized as \"a party\" — the caller's API key organization, no operator concept involved. Prerequisite: the escrow must be FUNDED. Deciding the dispute (release or refund) is NOT available on this API-key surface — it requires a session-authenticated organization owner or operator: see `POST /v1/dashboard/disputes/{disputeId}/decide`.",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenDisputeDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The opened dispute.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisputeResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "disputes"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/disputes/{disputeId}": {
      "get": {
        "operationId": "DisputesController_get",
        "x-required-scope": "disputes:read",
        "summary": "Get dispute",
        "description": "Retrieves one dispute by id, scoped to the caller's organization.",
        "parameters": [
          {
            "name": "disputeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisputeResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "disputes"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/disputes/{disputeId}/evidence": {
      "post": {
        "operationId": "DisputesController_addEvidence",
        "x-required-scope": "disputes:write",
        "summary": "Add dispute evidence",
        "description": "Attaches an evidence descriptor (links, document names, notes) to an open dispute. Prerequisite: the dispute must still be open (not yet resolved).",
        "parameters": [
          {
            "name": "disputeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddDisputeEvidenceDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The dispute, with the evidence recorded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisputeResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "disputes"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/webhook-endpoints": {
      "post": {
        "operationId": "WebhookEndpointsController_create",
        "x-required-scope": "webhooks:write",
        "summary": "Create webhook endpoint",
        "description": "Registers a destination URL and subscribes it to one or more event types. The response's `secret` is present ONLY on this creation response and can never be retrieved again — store it immediately, it is what signs `Escrow-Signature` on every delivery. The destination is checked for SSRF safety at registration time.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookEndpointDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The endpoint, with its signing secret — shown only this once.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "get": {
        "operationId": "WebhookEndpointsController_list",
        "x-required-scope": "webhooks:read",
        "summary": "List webhook endpoints",
        "description": "Lists webhook endpoints registered by the calling organization. Never re-exposes the signing secret.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointListResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/webhook-endpoints/{id}": {
      "get": {
        "operationId": "WebhookEndpointsController_get",
        "x-required-scope": "webhooks:read",
        "summary": "Get webhook endpoint",
        "description": "Retrieves one webhook endpoint by id, including consecutive-failure and auto-disablement status when reported.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "operationId": "WebhookEndpointsController_update",
        "x-required-scope": "webhooks:write",
        "summary": "Update webhook endpoint",
        "description": "Partially updates a webhook endpoint's URL, subscribed events, enabled flag or label. Only fields present in the body are changed. Re-checks a new URL for SSRF safety.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookEndpointDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "delete": {
        "operationId": "WebhookEndpointsController_remove",
        "x-required-scope": "webhooks:write",
        "summary": "Delete webhook endpoint",
        "description": "Permanently removes a webhook endpoint. Previously delivered events and their delivery history are retained.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted. No response body."
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/webhook-endpoints/{id}/test": {
      "post": {
        "operationId": "WebhookEndpointsController_sendTest",
        "x-required-scope": "webhooks:write",
        "summary": "Send a test event",
        "description": "Sends a signed synthetic `webhook.test` event to this endpoint only and returns the delivery result: `status` `SUCCEEDED` for a 2xx, otherwise `FAILED` with `responseStatus` or `errorMessage`. The event's `data` is `{ \"test\": true, \"endpointId\", \"message\" }` — handlers should verify the signature, answer 2xx and do nothing else. Never retried; never fanned out by subscription; changes no escrow and does not change the endpoint's failure count, last success or status, so it also works on a disabled endpoint. Recorded like any other event (`GET /v1/webhook-events`). Costs 10 against the rate limit.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The test was sent; status says whether your endpoint accepted it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookTestResultDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/webhook-events": {
      "get": {
        "operationId": "WebhookEventsController_list",
        "x-required-scope": "webhooks:read",
        "summary": "List webhook events",
        "description": "Lists the immutable webhook events recorded for the calling organization (not delivery attempts — see `deliveries` for those). Filterable by type, cursor-paginated.",
        "parameters": [
          {
            "name": "type",
            "required": false,
            "in": "query",
            "description": "Filter by event type.",
            "schema": {
              "enum": [
                "escrow.created",
                "escrow.funded",
                "escrow.released",
                "escrow.refunded",
                "escrow.disputed",
                "escrow.resolved",
                "escrow.cancelled",
                "escrow.expired",
                "escrow.group.completed",
                "escrow.paid",
                "escrow.payment_refunded",
                "subscription.created",
                "subscription.charged",
                "subscription.payment_failed",
                "subscription.cancelled",
                "subscription.charge_refunded",
                "transaction.failed",
                "seller_wallet.verified",
                "webhook.test"
              ],
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "Opaque pagination cursor from a previous response. Omit for the first page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Page size, 1-100.",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "example": 20,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEventListResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/webhook-events/{id}": {
      "get": {
        "operationId": "WebhookEventsController_get",
        "x-required-scope": "webhooks:read",
        "summary": "Get webhook event",
        "description": "Retrieves one webhook event by id.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEventResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/webhook-events/{id}/replay": {
      "post": {
        "operationId": "WebhookEventsController_replay",
        "x-required-scope": "webhooks:write",
        "summary": "Replay webhook event",
        "description": "Redelivers an already-recorded event to every currently subscribed endpoint. The redelivered payload is the original event, unchanged — a replay resends, it never regenerates. The resulting delivery is marked `isReplay: true` to distinguish it from the original attempt.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "The original, unchanged event, queued for redelivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEventResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/webhook-events/{id}/deliveries": {
      "get": {
        "operationId": "WebhookEventsController_deliveries",
        "x-required-scope": "webhooks:read",
        "summary": "List delivery attempts of a webhook event",
        "description": "Lists every delivery attempt of one event to every subscribed endpoint, including retries and replays, with per-attempt HTTP status and a bounded response-body preview.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Every delivery attempt, including retries and replays.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WebhookDeliveryResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/api-keys": {
      "post": {
        "operationId": "ApiKeysController_create",
        "summary": "Create API key",
        "description": "Session-authenticated only — an API key cannot create another API key, so the first key for an organization must always come from the dashboard. The plaintext secret (`esc_test_<prefix>_<secret>` or `esc_live_...`) is returned ONCE in this response and can never be retrieved again; afterwards only the prefix is shown. A `live` key requires the signed-in member's email to be verified.",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "api-keys"
        ]
      },
      "get": {
        "operationId": "ApiKeysController_list",
        "summary": "List API keys",
        "description": "Lists API keys for the calling organization. Only the masked prefix is shown — the secret is never retrievable after creation.",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "api-keys"
        ]
      }
    },
    "/v1/api-keys/{id}": {
      "delete": {
        "operationId": "ApiKeysController_revoke",
        "summary": "Revoke API key",
        "description": "Revokes an API key immediately. Its usage history survives; requests already in flight using it may still complete.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "api-keys"
        ]
      }
    },
    "/v1/staff/auth/sign-in": {
      "post": {
        "operationId": "StaffController_signIn",
        "summary": "Staff sign in",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffSignInDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/auth/sign-in/mfa": {
      "post": {
        "operationId": "StaffController_signInWithMfa",
        "summary": "Complete staff sign-in with a second factor",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MfaChallengeDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/auth/sign-out": {
      "post": {
        "operationId": "StaffController_signOut",
        "summary": "Staff sign out",
        "parameters": [],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/auth/session": {
      "get": {
        "operationId": "StaffController_session",
        "summary": "Current staff session",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/accounts": {
      "get": {
        "operationId": "StaffController_listAccounts",
        "summary": "List staff accounts",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      },
      "post": {
        "operationId": "StaffController_provision",
        "summary": "Provision a staff account",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProvisionStaffAccountDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/accounts/{staffAccountId}/roles": {
      "patch": {
        "operationId": "StaffController_changeRoles",
        "summary": "Change a staff account's roles",
        "parameters": [
          {
            "name": "staffAccountId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeStaffRoleDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/rate-limit-overrides": {
      "get": {
        "operationId": "RateLimitOverridesController_list",
        "summary": "List active rate-limit overrides",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      },
      "post": {
        "operationId": "RateLimitOverridesController_set",
        "summary": "Set (or replace) an organization rate-limit override",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetRateLimitOverrideDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/rate-limit-overrides/{organizationId}": {
      "delete": {
        "operationId": "RateLimitOverridesController_revoke",
        "summary": "Revoke an organization rate-limit override",
        "parameters": [
          {
            "name": "organizationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/overview": {
      "get": {
        "operationId": "StaffOverviewController_overview",
        "summary": "Platform-wide staff overview",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/escrows": {
      "get": {
        "operationId": "StaffEscrowsController_search",
        "summary": "Search escrows across every organization, one page at a time",
        "parameters": [
          {
            "name": "q",
            "required": false,
            "in": "query",
            "description": "Search: escrow id prefix (with or without `esc_`, any case), order-reference prefix (as written), or an exact wallet address. At least 4 characters.",
            "schema": {
              "maxLength": 200,
              "example": "esc_01J8ZQ",
              "type": "string"
            }
          },
          {
            "name": "createdFrom",
            "required": false,
            "in": "query",
            "description": "Created on or after this UTC day (YYYY-MM-DD).",
            "schema": {
              "example": "2026-10-01",
              "type": "string"
            }
          },
          {
            "name": "createdTo",
            "required": false,
            "in": "query",
            "description": "Created on or before this UTC day (YYYY-MM-DD), inclusive.",
            "schema": {
              "example": "2026-10-31",
              "type": "string"
            }
          },
          {
            "name": "amountMin",
            "required": false,
            "in": "query",
            "description": "Minimum amount, inclusive, in atomic units as a decimal string (never a float).",
            "schema": {
              "example": "1000000",
              "type": "string"
            }
          },
          {
            "name": "amountMax",
            "required": false,
            "in": "query",
            "description": "Maximum amount, inclusive, in atomic units as a decimal string (never a float).",
            "schema": {
              "example": "50000000",
              "type": "string"
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Filter by escrow status.",
            "schema": {
              "example": "FUNDED",
              "enum": [
                "CREATED",
                "AWAITING_APPROVAL",
                "AWAITING_FUNDING",
                "FUNDING_SUBMITTED",
                "FUNDED",
                "RELEASE_SUBMITTED",
                "RELEASED",
                "REFUND_SUBMITTED",
                "REFUNDED",
                "DISPUTED",
                "RESOLUTION_SUBMITTED",
                "RESOLVED",
                "CANCELLED",
                "EXPIRED",
                "PAID",
                "RECONCILIATION_REQUIRED"
              ],
              "type": "string"
            }
          },
          {
            "name": "settlementMode",
            "required": false,
            "in": "query",
            "description": "Filter by settlement mode (ADR-040).",
            "schema": {
              "$ref": "#/components/schemas/SettlementMode"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "Opaque pagination cursor from a previous response's `nextCursor`. Omit for the first page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Page size, 1-100.",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "example": 20,
              "type": "number"
            }
          },
          {
            "name": "organizationId",
            "required": false,
            "in": "query",
            "description": "Narrow to one merchant organization.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/escrows/{escrowId}": {
      "get": {
        "operationId": "StaffEscrowsController_detail",
        "summary": "Full investigation view of one escrow",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/disputes": {
      "get": {
        "operationId": "StaffDisputesController_list",
        "summary": "List prepared dispute resolutions across every organization",
        "parameters": [
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Filter by dispute status.",
            "schema": {
              "enum": [
                "CREATED",
                "UNDER_REVIEW",
                "RESOLUTION_PREPARED",
                "RESOLVED",
                "CANCELLED"
              ],
              "type": "string"
            }
          },
          {
            "name": "q",
            "required": false,
            "in": "query",
            "description": "Search by dispute id prefix or escrow id prefix, at least 4 characters. Case-insensitive; the `dsp_` / `esc_` prefix is optional.",
            "schema": {
              "maxLength": 200,
              "example": "dsp_01J8ZQ",
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "Opaque pagination cursor from a previous response. Omit for the first page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Page size, 1-100.",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "example": 20,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/disputes/{disputeId}": {
      "get": {
        "operationId": "StaffDisputesController_detail",
        "summary": "Full investigation view of one dispute",
        "parameters": [
          {
            "name": "disputeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/disputes/{disputeId}/decide": {
      "post": {
        "operationId": "StaffDisputesController_decide",
        "summary": "Decide a dispute (STAFF_ADMIN)",
        "description": "Records the staff decision and returns the unsigned `resolveDispute` transaction prepared for the multisig holding DISPUTE_RESOLVER_ROLE; the backend never signs or submits it. Merchants cannot decide their own disputes (ADR-039).",
        "parameters": [
          {
            "name": "disputeId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveDisputeIntentDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/merchants": {
      "get": {
        "operationId": "StaffMerchantsController_list",
        "summary": "List merchants with activity and status",
        "parameters": [
          {
            "name": "q",
            "required": false,
            "in": "query",
            "description": "Merchant name prefix, case-insensitive.",
            "schema": {
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "Opaque pagination cursor from a previous response. Omit for the first page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "description": "Page size, 1-100.",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "default": 25,
              "example": 25,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/merchants/{organizationId}": {
      "get": {
        "operationId": "StaffMerchantsController_detail",
        "summary": "Full support view of one merchant",
        "parameters": [
          {
            "name": "organizationId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/escrows/{escrowId}/reconcile": {
      "post": {
        "operationId": "StaffReconciliationController_reconcile",
        "summary": "Re-trigger reconciliation for a flagged escrow",
        "parameters": [
          {
            "name": "escrowId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffReconcileEscrowDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/webhook-events/{eventId}/retry": {
      "post": {
        "operationId": "StaffWebhookEventsController_retry",
        "summary": "Retry a failed webhook event",
        "parameters": [
          {
            "name": "eventId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffRetryWebhookEventDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/webhook-events/dlq": {
      "get": {
        "operationId": "StaffWebhookEventsController_listDlq",
        "summary": "List dead-letter queue depths",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/webhook-events/dlq/{queueName}/peek": {
      "get": {
        "operationId": "StaffWebhookEventsController_peekDlq",
        "summary": "Peek dead-letter queue messages without consuming them",
        "parameters": [
          {
            "name": "queueName",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/deletion-requests": {
      "post": {
        "operationId": "StaffDeletionRequestsController_create",
        "summary": "Request removal of an organization's personal data",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDeletionRequestDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      },
      "get": {
        "operationId": "StaffDeletionRequestsController_list",
        "summary": "List deletion requests",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/deletion-requests/{requestId}": {
      "get": {
        "operationId": "StaffDeletionRequestsController_get",
        "summary": "Read one deletion request",
        "parameters": [
          {
            "name": "requestId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/blog/posts": {
      "get": {
        "operationId": "BlogController_list",
        "summary": "List published blog posts",
        "description": "No credential required. Published posts only, newest first publication first, paginated. `locale` picks the language; a post with no published translation in it is listed in English (each item names the `locale` it is in).",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "pageSize",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "maximum": 50,
              "default": 12,
              "type": "number"
            }
          },
          {
            "name": "locale",
            "required": false,
            "in": "query",
            "schema": {
              "default": "en",
              "enum": [
                "en",
                "es",
                "zh-Hans",
                "hi",
                "ar",
                "pt",
                "fr",
                "ru",
                "de",
                "ja",
                "uk",
                "tr"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlogPostPageDto"
                }
              }
            }
          }
        },
        "tags": [
          "blog"
        ]
      }
    },
    "/v1/blog/posts/{slug}": {
      "get": {
        "operationId": "BlogController_get",
        "summary": "Get a published blog post",
        "description": "No credential required. `locale` picks the language; when the post has no published translation in it, the English text is served and `locale` in the answer says so. `alternates` lists every published translation for `hreflang` links. Images in `body` are referenced as `image:<id>` and resolved through `images`.",
        "parameters": [
          {
            "name": "slug",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "required": false,
            "in": "query",
            "schema": {
              "default": "en",
              "enum": [
                "en",
                "es",
                "zh-Hans",
                "hi",
                "ar",
                "pt",
                "fr",
                "ru",
                "de",
                "ja",
                "uk",
                "tr"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The published post, or `{ redirectTo }` naming the current address of a post renamed after publication.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/BlogPostPublicDto"
                    },
                    {
                      "$ref": "#/components/schemas/BlogPostRedirectDto"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request` / `resource_not_found`: no published post at this address. A draft, an unpublished post and an address that never existed answer identically.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "blog"
        ]
      }
    },
    "/v1/staff/blog/posts": {
      "get": {
        "operationId": "StaffBlogController_list",
        "summary": "List blog posts in any status",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "pageSize",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "maximum": 50,
              "default": 12,
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      },
      "post": {
        "operationId": "StaffBlogController_create",
        "summary": "Create a blog post draft, in English unless `locale` says otherwise (STAFF_ADMIN)",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBlogPostDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/blog/posts/{postId}": {
      "get": {
        "operationId": "StaffBlogController_get",
        "summary": "Get a blog post in any status",
        "parameters": [
          {
            "name": "postId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      },
      "delete": {
        "operationId": "StaffBlogController_delete",
        "summary": "Delete a blog post and all its translations permanently, based on the post version (STAFF_ADMIN)",
        "parameters": [
          {
            "name": "postId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/blog/slugs/preview": {
      "get": {
        "operationId": "StaffBlogController_previewSlug",
        "summary": "Propose a free address for a post title, in a language",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/blog/posts/{postId}/translations/{locale}": {
      "post": {
        "operationId": "StaffBlogController_createTranslation",
        "summary": "Add a draft translation to a blog post (STAFF_ADMIN)",
        "parameters": [
          {
            "name": "postId",
            "required": true,
            "in": "path",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "name": "locale",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "en",
                "es",
                "zh-Hans",
                "hi",
                "ar",
                "pt",
                "fr",
                "ru",
                "de",
                "ja",
                "uk",
                "tr"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBlogTranslationDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      },
      "patch": {
        "operationId": "StaffBlogController_update",
        "summary": "Edit one translation of a blog post, based on the version read (STAFF_ADMIN)",
        "parameters": [
          {
            "name": "postId",
            "required": true,
            "in": "path",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "name": "locale",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "en",
                "es",
                "zh-Hans",
                "hi",
                "ar",
                "pt",
                "fr",
                "ru",
                "de",
                "ja",
                "uk",
                "tr"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateBlogTranslationDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      },
      "delete": {
        "operationId": "StaffBlogController_deleteTranslation",
        "summary": "Delete one translation of a blog post, based on its version (STAFF_ADMIN)",
        "parameters": [
          {
            "name": "postId",
            "required": true,
            "in": "path",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "name": "locale",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "en",
                "es",
                "zh-Hans",
                "hi",
                "ar",
                "pt",
                "fr",
                "ru",
                "de",
                "ja",
                "uk",
                "tr"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/blog/posts/{postId}/translations/{locale}/publish": {
      "post": {
        "operationId": "StaffBlogController_publish",
        "summary": "Publish one translation of a blog post (STAFF_ADMIN)",
        "parameters": [
          {
            "name": "postId",
            "required": true,
            "in": "path",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "name": "locale",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "en",
                "es",
                "zh-Hans",
                "hi",
                "ar",
                "pt",
                "fr",
                "ru",
                "de",
                "ja",
                "uk",
                "tr"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlogPostVersionDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/blog/posts/{postId}/translations/{locale}/unpublish": {
      "post": {
        "operationId": "StaffBlogController_unpublish",
        "summary": "Unpublish one translation, keeping its address and date (STAFF_ADMIN)",
        "parameters": [
          {
            "name": "postId",
            "required": true,
            "in": "path",
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "name": "locale",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "en",
                "es",
                "zh-Hans",
                "hi",
                "ar",
                "pt",
                "fr",
                "ru",
                "de",
                "ja",
                "uk",
                "tr"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlogPostVersionDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/blog/images": {
      "post": {
        "operationId": "StaffBlogController_uploadImage",
        "summary": "Upload a blog image: JPEG, PNG, WebP or GIF, at most 10 MB (STAFF_ADMIN)",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/staff/blog/images/{imageId}": {
      "get": {
        "operationId": "StaffBlogController_getImage",
        "summary": "Get an uploaded blog image",
        "parameters": [
          {
            "name": "imageId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "staff"
        ]
      }
    },
    "/v1/plans": {
      "post": {
        "operationId": "PlansController_create",
        "x-required-scope": "subscriptions:write",
        "summary": "Create plan",
        "description": "Creates a recurring-billing plan: `amount` atomic units of `token` every `interval` (`DAILY` only on local and sandbox deployments), with an optional free trial of 0-90 days. 422 `validation_failed` with `details.reason`: `subscriptions_unavailable_on_network`, `unsupported_token`, `unsupported_interval`, `trial_out_of_range`. Supports `Idempotency-Key` (optional; 8-255 characters when sent).",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePlanDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created plan, with its reusable subscribe link id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "plans"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "get": {
        "operationId": "PlansController_list",
        "x-required-scope": "subscriptions:read",
        "summary": "List plans",
        "description": "Lists the calling organization's plans, newest first. Filterable by `status`. Cursor-paginated.",
        "parameters": [
          {
            "name": "status",
            "required": false,
            "in": "query",
            "schema": {
              "enum": [
                "ACTIVE",
                "ARCHIVED"
              ],
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "type": "number"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of plans, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanListResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "plans"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/plans/{planId}": {
      "get": {
        "operationId": "PlansController_get",
        "x-required-scope": "subscriptions:read",
        "summary": "Get plan",
        "description": "Retrieves one plan by id. Another organization's plan answers 404.",
        "parameters": [
          {
            "name": "planId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "plans"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      },
      "patch": {
        "operationId": "PlansController_update",
        "x-required-scope": "subscriptions:write",
        "summary": "Update plan",
        "description": "Changes `name`, `amount`, `interval` or `trialDays`. The change applies to new sessions only; existing subscriptions keep the terms their buyers signed. Send the plan's `version` as `If-Match`: a stale version is 409 `conflict`. An archived plan is 409 `invalid_state` with `details.reason` `plan_archived`.",
        "parameters": [
          {
            "name": "planId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "if-match",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "The plan `version` being edited.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePlanDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "plans"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/plans/{planId}/archive": {
      "post": {
        "operationId": "PlansController_archive",
        "x-required-scope": "subscriptions:write",
        "summary": "Archive plan",
        "description": "Stops new subscriptions to the plan (its link and open checkouts refuse with `plan_archived`). Existing subscriptions keep running. Idempotent.",
        "parameters": [
          {
            "name": "planId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The archived plan.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "plans"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/subscriptions": {
      "get": {
        "operationId": "SubscriptionsController_list",
        "x-required-scope": "subscriptions:read",
        "summary": "List subscriptions",
        "description": "Lists the calling organization's subscriptions, newest first. Filterable by `status`, `planId`, `customerReference`, `buyerWallet` and a UTC creation range. Cursor-paginated.",
        "parameters": [
          {
            "name": "status",
            "required": false,
            "in": "query",
            "schema": {
              "enum": [
                "PENDING",
                "SUBMITTED",
                "TRIALING",
                "ACTIVE",
                "PAST_DUE",
                "CANCELLED",
                "RECONCILIATION_REQUIRED"
              ],
              "type": "string"
            }
          },
          {
            "name": "planId",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerReference",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "buyerWallet",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "createdFrom",
            "required": false,
            "in": "query",
            "description": "Created on or after (ISO-8601, UTC).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "createdTo",
            "required": false,
            "in": "query",
            "description": "Created before (ISO-8601, UTC).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "type": "number"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of subscriptions, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionListResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "subscriptions"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/subscriptions/{id}": {
      "get": {
        "operationId": "SubscriptionsController_get",
        "x-required-scope": "subscriptions:read",
        "summary": "Get subscription",
        "description": "Retrieves one subscription with its signed terms, billing anchor, next charge and how many periods the buyer's approval still covers. Another organization's subscription answers 404.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "subscriptions"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/subscriptions/{id}/charges": {
      "get": {
        "operationId": "SubscriptionsController_charges",
        "x-required-scope": "subscriptions:read",
        "summary": "List subscription charges",
        "description": "The subscription's confirmed charges, failed keeper attempts and confirmed refunds, chronological. A charge a chain reorganization removed stays listed with state REORGED.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionChargesResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "subscriptions"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/subscriptions/{id}/cancel": {
      "post": {
        "operationId": "SubscriptionsController_cancel",
        "x-required-scope": "subscriptions:write",
        "summary": "Cancel subscription",
        "description": "Asks for the subscription to be cancelled. Returns 202, NOT 200: the platform signs a short-lived cancel authorization and its keeper submits it, and the subscription becomes CANCELLED (`cancelReason` MERCHANT) only when the `SubscriptionCancelled` log is confirmed — poll `GET /v1/subscriptions/{id}` or subscribe to the `subscription.cancelled` webhook. On a retired contract version the response has `path` `seller_wallet` and a `call` to send from your own seller wallet. Cancelling an ended subscription is 409 `invalid_state` with `details.reason` `subscription_not_active`.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted — not yet cancelled. The status is unchanged until the cancellation is confirmed on chain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionCancelAcceptedDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "subscriptions"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/subscription-checkouts": {
      "post": {
        "operationId": "SubscriptionCheckoutsController_create",
        "x-required-scope": "subscriptions:write",
        "summary": "Create subscription checkout",
        "description": "Mints a hosted subscribe session for a plan and returns its `url` and `expiresAt`. `customerReference` is echoed on every read and webhook; `successUrl` must be a return URL configured for your organization (422 `success_url_not_allowed`); `sellerWalletId` selects a verified seller wallet. An archived plan is 409 `invalid_state` with `plan_archived`. Supports `Idempotency-Key`.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSubscriptionCheckoutDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The hosted checkout URL to send the buyer to.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionCheckoutResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "subscriptions"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/subscription-summary": {
      "get": {
        "operationId": "SubscriptionSummaryController_summary",
        "x-required-scope": "subscriptions:read",
        "summary": "Subscription summary",
        "description": "Active subscription count, collections due in the next 30 days (count and atomic-unit amount) and failed charge attempts in the last 30 days.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionSummaryDto"
                }
              }
            }
          },
          "401": {
            "description": "`authentication_error`: missing, malformed, revoked or wrong-environment API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "`authorization_error`: `insufficient_scope` when the API key lacks the scope this operation requires (its `x-required-scope`, also named in `details.requiredScope`); otherwise an internal service refused the action for your organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "`invalid_request`: no such resource in your organization. Another organization's id answers the same.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "409": {
            "description": "`invalid_request`: the resource is in the wrong state, or an idempotency key was reused with a different body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "`invalid_request`: validation failed; `details` names the fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limit_error`: slow down; see `Retry-After`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          },
          "503": {
            "description": "`api_error`: a dependency is unavailable. Safe to retry with the same idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "subscriptions"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    },
    "/v1/dashboard/plans": {
      "post": {
        "operationId": "DashboardSubscriptionsController_createPlan",
        "summary": "Create a plan",
        "description": "Session-authenticated equivalent of `POST /v1/plans`. Requires OWNER or ADMIN. Same body, validation, errors and response.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePlanDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      },
      "get": {
        "operationId": "DashboardSubscriptionsController_listPlans",
        "summary": "List plans",
        "description": "Session-authenticated equivalent of `GET /v1/plans`. Any member may read.",
        "parameters": [
          {
            "name": "status",
            "required": false,
            "in": "query",
            "schema": {
              "enum": [
                "ACTIVE",
                "ARCHIVED"
              ],
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "type": "number"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanListResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/plans/{planId}": {
      "get": {
        "operationId": "DashboardSubscriptionsController_getPlan",
        "summary": "Get a plan",
        "description": "Session-authenticated equivalent of `GET /v1/plans/{planId}`.",
        "parameters": [
          {
            "name": "planId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      },
      "patch": {
        "operationId": "DashboardSubscriptionsController_updatePlan",
        "summary": "Update a plan",
        "description": "Session-authenticated equivalent of `PATCH /v1/plans/{planId}`. Requires OWNER or ADMIN. Applies to new sessions only.",
        "parameters": [
          {
            "name": "planId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "if-match",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "The plan `version` being edited.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePlanDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/plans/{planId}/archive": {
      "post": {
        "operationId": "DashboardSubscriptionsController_archivePlan",
        "summary": "Archive a plan",
        "description": "Session-authenticated equivalent of `POST /v1/plans/{planId}/archive`. Requires OWNER or ADMIN. Idempotent.",
        "parameters": [
          {
            "name": "planId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/subscription-checkouts": {
      "post": {
        "operationId": "DashboardSubscriptionsController_createCheckout",
        "summary": "Create a subscription checkout",
        "description": "Session-authenticated equivalent of `POST /v1/subscription-checkouts`. Requires OWNER or ADMIN.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSubscriptionCheckoutDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionCheckoutResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/subscriptions": {
      "get": {
        "operationId": "DashboardSubscriptionsController_listSubscriptions",
        "summary": "List subscriptions",
        "description": "Session-authenticated equivalent of `GET /v1/subscriptions`. Any member may read.",
        "parameters": [
          {
            "name": "status",
            "required": false,
            "in": "query",
            "schema": {
              "enum": [
                "PENDING",
                "SUBMITTED",
                "TRIALING",
                "ACTIVE",
                "PAST_DUE",
                "CANCELLED",
                "RECONCILIATION_REQUIRED"
              ],
              "type": "string"
            }
          },
          {
            "name": "planId",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerReference",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "buyerWallet",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "createdFrom",
            "required": false,
            "in": "query",
            "description": "Created on or after (ISO-8601, UTC).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "createdTo",
            "required": false,
            "in": "query",
            "description": "Created before (ISO-8601, UTC).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "type": "number"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionListResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/subscriptions/{id}": {
      "get": {
        "operationId": "DashboardSubscriptionsController_getSubscription",
        "summary": "Get a subscription",
        "description": "Session-authenticated equivalent of `GET /v1/subscriptions/{id}`.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/subscriptions/{id}/charges": {
      "get": {
        "operationId": "DashboardSubscriptionsController_charges",
        "summary": "List a subscription's charges",
        "description": "Session-authenticated equivalent of `GET /v1/subscriptions/{id}/charges`.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionChargesResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/subscriptions/{id}/cancel": {
      "post": {
        "operationId": "DashboardSubscriptionsController_cancel",
        "summary": "Cancel a subscription",
        "description": "Session-authenticated equivalent of `POST /v1/subscriptions/{id}/cancel`. Requires OWNER or ADMIN. Returns 202 with the status unchanged until the cancellation is confirmed on chain.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionCancelAcceptedDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/dashboard/subscription-summary": {
      "get": {
        "operationId": "DashboardSubscriptionsController_summary",
        "summary": "Subscription summary",
        "description": "Session-authenticated equivalent of `GET /v1/subscription-summary`.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionSummaryDto"
                }
              }
            }
          }
        },
        "tags": [
          "dashboard"
        ]
      }
    },
    "/v1/subscribe/{sessionId}": {
      "get": {
        "operationId": "SubscribeController_get",
        "summary": "Get a hosted subscribe session",
        "description": "No credential required — the session id is the capability. Returns the merchant name, the plan's terms, when the first charge happens and the session expiry; also the polling endpoint for the subscription the session created. Send `wallet` to learn whether that wallet already has an active subscription to this plan (`existingSubscriptionId`), for the duplicate warning. An unknown session answers a generic 404.",
        "parameters": [
          {
            "name": "sessionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "wallet",
            "required": false,
            "in": "query",
            "description": "Buyer wallet; when given, the response flags an existing active subscription to this plan.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscribeSessionResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "subscribe"
        ]
      }
    },
    "/v1/subscribe/{sessionId}/intent": {
      "post": {
        "operationId": "SubscribeController_intent",
        "summary": "Prepare subscription transactions",
        "description": "No credential required. Returns the platform-signed `SubscriptionTerms` embedded in the calls the buyer's wallet sends, in order: `approve(0)` where the token requires it, `approve(currentAllowance + periods × amount)` and `subscribe(terms, signature)`. `periods` is at least 1 and never unlimited. Creates the subscription as PENDING; nothing is true until the chain confirms it. 422 `validation_failed`: `session_expired`, `plan_archived`, `seller_is_buyer`, `insufficient_balance` (a plan without a trial, checked at preparation).",
        "parameters": [
          {
            "name": "sessionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubscribeIntentDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscribeIntentResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "subscribe"
        ]
      }
    },
    "/v1/subscribe/{sessionId}/transactions": {
      "post": {
        "operationId": "SubscribeController_transactions",
        "summary": "Register subscribe transaction",
        "description": "No credential required. Registers the hash of the `subscribe` transaction the buyer's wallet broadcast. Returns 202, NOT 200: a hash is a claim, verified against the chain; the subscription becomes ACTIVE only when the `SubscriptionCreated` log is confirmed.",
        "parameters": [
          {
            "name": "sessionId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubscribeTransactionHintDto"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted for verification — not a confirmed subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscribeSessionResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "subscribe"
        ]
      }
    },
    "/v1/plan-links/{linkId}": {
      "get": {
        "operationId": "PlanLinksController_resolve",
        "summary": "Resolve a plan link",
        "description": "No credential required — the link id is the capability. Mints a new hosted subscribe session for the plan the link belongs to (the link is reusable; each visit gets its own session). An unknown link answers a generic 404; an archived plan answers 409 `invalid_state` with `plan_archived`.",
        "parameters": [
          {
            "name": "linkId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A fresh subscribe session for the plan.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscribeSessionResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "subscribe"
        ]
      }
    },
    "/v1/subscriptions/{id}/cancel-intent": {
      "post": {
        "operationId": "SubscriptionIntentsController_cancelIntent",
        "summary": "Prepare cancel transaction",
        "description": "No credential required. Returns unsigned `cancel(id)` calldata for the wallet to send. Refused (422 `validation_failed`, `wallet_not_a_party`) unless `wallet` is the subscription's buyer or recorded seller. Changes nothing: the subscription is cancelled only when the log is confirmed on chain.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubscriptionWalletIntentDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionCallsResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "subscribe"
        ]
      }
    },
    "/v1/subscriptions/{id}/reapprove-intent": {
      "post": {
        "operationId": "SubscriptionIntentsController_reapproveIntent",
        "summary": "Prepare re-approval transaction",
        "description": "No credential required. Returns unsigned `approve(...)` calldata (preceded by `approve(0)` where the token requires it) that adds `periods` × amount to the buyer's current allowance, for the buyer's wallet to send. Refused unless `wallet` is the subscription's buyer. Changes nothing.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReapproveIntentDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionCallsResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "subscribe"
        ]
      }
    },
    "/v1/subscriptions/{id}/charges/{periodIndex}/refund-intent": {
      "post": {
        "operationId": "SubscriptionIntentsController_refundIntent",
        "summary": "Prepare charge refund transaction",
        "description": "No credential required. Returns an `approve(subscriptions, amount)` where the seller's allowance is short, then `refundCharge(id, periodIndex, amount)`, for the seller's wallet to send. Refused unless `wallet` is the recorded seller and `amount` is at most the charge's gross minus what was already refunded. Changes nothing: a refund is recorded only when its log is confirmed on chain.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "periodIndex",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChargeRefundIntentDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionCallsResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "subscribe"
        ]
      }
    },
    "/v1/buyer/sessions/nonce": {
      "post": {
        "operationId": "BuyerSessionsController_nonce",
        "summary": "Start a buyer sign-in",
        "description": "No credential required. Returns the exact EIP-4361 message for `address` to sign, rendered by the platform, and when it expires (minutes). The nonce is single-use.",
        "parameters": [
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BuyerNonceRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuyerNonceResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "buyer"
        ]
      }
    },
    "/v1/buyer/sessions": {
      "post": {
        "operationId": "BuyerSessionsController_create",
        "summary": "Sign in as a buyer",
        "description": "No credential required — the signature is the proof. Verifies the signed message and sets the buyer read token as an httpOnly cookie (30 minutes); the body reports only the wallet and the expiry. The token is read-only and accepted on `/v1/buyer/*` only. 422 `validation_failed` with `details.reason`: `invalid_message`, `nonce_used`, `nonce_expired`, `signature_mismatch`.",
        "parameters": [
          {
            "name": "x-request-id",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BuyerSessionRequestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuyerSessionResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "buyer"
        ]
      }
    },
    "/v1/buyer/subscriptions": {
      "get": {
        "operationId": "BuyerSubscriptionsController_list",
        "summary": "List my subscriptions",
        "description": "Buyer token only (an API key or dashboard session is refused). The signed-in wallet's subscriptions across merchants, newest first: merchant, plan, terms, status, next charge, the reason and next retry while Past due, and how many periods the approval still covers.",
        "parameters": [
          {
            "name": "limit",
            "required": false,
            "in": "query",
            "schema": {
              "minimum": 1,
              "maximum": 100,
              "type": "number"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuyerSubscriptionListResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "buyer"
        ]
      }
    },
    "/v1/buyer/subscriptions/{id}/charges": {
      "get": {
        "operationId": "BuyerSubscriptionsController_charges",
        "summary": "List my subscription's charges",
        "description": "Buyer token only. The charges, failed attempts and refunds of one of the signed-in wallet's own subscriptions. Another wallet's subscription answers 404, the same as an unknown id.",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionChargesResponseDto"
                }
              }
            }
          }
        },
        "tags": [
          "buyer"
        ]
      }
    },
    "/v1/health": {
      "get": {
        "operationId": "HealthController_health",
        "summary": "Overall health",
        "description": "Combined health summary. No credential required; excluded from rate limiting.",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "health"
        ]
      }
    },
    "/v1/health/liveness": {
      "get": {
        "operationId": "HealthController_liveness",
        "summary": "Liveness probe",
        "description": "Reports whether the process is running and the event loop responds. Does not check any dependency.",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "health"
        ]
      }
    },
    "/v1/health/readiness": {
      "get": {
        "operationId": "HealthController_readiness",
        "summary": "Readiness probe",
        "description": "NOT IMPLEMENTED as a real dependency check: this route always reports ok and does not currently probe its database, Redis, or any other dependency, despite its name. Do not rely on it to detect a downstream outage.",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "health"
        ]
      }
    }
  },
  "info": {
    "title": "API Gateway",
    "description": "Single public REST entry point (/v1): API-key auth, validation, correlation ids, idempotency, rate-limit abstraction, routing to internal services.",
    "version": "0.1.0",
    "contact": {}
  },
  "tags": [],
  "servers": [],
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "API key",
        "type": "http",
        "description": "Secret API key: esc_test_<prefix>_<secret>. Server-side only; never send it from a browser."
      }
    },
    "schemas": {
      "SignUpDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Email address for the new account.",
            "maxLength": 320,
            "example": "founder@example.com"
          },
          "password": {
            "type": "string",
            "description": "Account password. Policy is enforced by AuthService; this bound is a transport-level guard only.",
            "minLength": 1,
            "maxLength": 256
          },
          "organizationName": {
            "type": "string",
            "description": "Organization name. Defaults to a name derived from the email address when omitted.",
            "maxLength": 200
          }
        },
        "required": [
          "email",
          "password"
        ]
      },
      "SignInDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Account email address.",
            "maxLength": 320,
            "example": "founder@example.com"
          },
          "password": {
            "type": "string",
            "description": "Account password.",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "required": [
          "email",
          "password"
        ]
      },
      "MfaChallengeDto": {
        "type": "object",
        "properties": {
          "challengeToken": {
            "type": "string",
            "description": "The challengeToken returned by the sign-in response.",
            "maxLength": 200
          },
          "code": {
            "type": "string",
            "description": "Either a 6-digit TOTP code or a recovery code, tried in that order.",
            "minLength": 6,
            "maxLength": 64,
            "example": "123456"
          }
        },
        "required": [
          "challengeToken",
          "code"
        ]
      },
      "VerifyEmailDto": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "The verification token from the emailed link.",
            "maxLength": 200
          }
        },
        "required": [
          "token"
        ]
      },
      "RequestPasswordResetDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Account email address. The response is identical whether or not the address has an account.",
            "maxLength": 320
          }
        },
        "required": [
          "email"
        ]
      },
      "ResetPasswordDto": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "The reset token from the emailed link.",
            "maxLength": 200
          },
          "newPassword": {
            "type": "string",
            "description": "The new password.",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "required": [
          "token",
          "newPassword"
        ]
      },
      "ChangePasswordDto": {
        "type": "object",
        "properties": {
          "currentPassword": {
            "type": "string",
            "description": "The current password, required to authorize the change.",
            "minLength": 1,
            "maxLength": 256
          },
          "newPassword": {
            "type": "string",
            "description": "The new password.",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "required": [
          "currentPassword",
          "newPassword"
        ]
      },
      "AcceptInvitationDto": {
        "type": "object",
        "properties": {
          "password": {
            "type": "string",
            "description": "Required only when the invited email address has no existing account; ignored otherwise.",
            "minLength": 1,
            "maxLength": 256
          }
        }
      },
      "SettlementMode": {
        "type": "string",
        "description": "ESCROW holds the payment until release; INSTANT pays the seller at payment and ends in PAID.",
        "enum": [
          "ESCROW",
          "INSTANT"
        ]
      },
      "PaymentTotalsDto": {
        "type": "object",
        "properties": {
          "paid": {
            "type": "number",
            "description": "RELEASED, PAID or RESOLVED.",
            "example": 12
          },
          "inProgress": {
            "type": "number",
            "description": "CREATED, AWAITING_APPROVAL, AWAITING_FUNDING, FUNDING_SUBMITTED, FUNDED, RELEASE_SUBMITTED, DISPUTED, RESOLUTION_SUBMITTED or RECONCILIATION_REQUIRED.",
            "example": 4
          },
          "failed": {
            "type": "number",
            "description": "CANCELLED or EXPIRED.",
            "example": 2
          },
          "refunded": {
            "type": "number",
            "description": "REFUND_SUBMITTED or REFUNDED.",
            "example": 1
          },
          "total": {
            "type": "number",
            "description": "Sum of the four buckets.",
            "example": 19
          }
        },
        "required": [
          "paid",
          "inProgress",
          "failed",
          "refunded",
          "total"
        ]
      },
      "PaymentDailyDto": {
        "type": "object",
        "properties": {
          "paid": {
            "type": "number",
            "description": "RELEASED, PAID or RESOLVED.",
            "example": 12
          },
          "inProgress": {
            "type": "number",
            "description": "CREATED, AWAITING_APPROVAL, AWAITING_FUNDING, FUNDING_SUBMITTED, FUNDED, RELEASE_SUBMITTED, DISPUTED, RESOLUTION_SUBMITTED or RECONCILIATION_REQUIRED.",
            "example": 4
          },
          "failed": {
            "type": "number",
            "description": "CANCELLED or EXPIRED.",
            "example": 2
          },
          "refunded": {
            "type": "number",
            "description": "REFUND_SUBMITTED or REFUNDED.",
            "example": 1
          },
          "date": {
            "type": "string",
            "description": "The UTC day, `YYYY-MM-DD`, attributed by the escrow's creation time.",
            "example": "2026-10-24"
          }
        },
        "required": [
          "paid",
          "inProgress",
          "failed",
          "refunded",
          "date"
        ]
      },
      "PaymentVolumeDto": {
        "type": "object",
        "properties": {
          "tokenSymbol": {
            "type": "string",
            "description": "Token symbol.",
            "example": "USDC"
          },
          "tokenAddress": {
            "type": "string",
            "description": "Token contract address.",
            "example": "0x036CbD53842c5426634e7929541eC2318f3dCF7e"
          },
          "tokenDecimals": {
            "type": "number",
            "description": "Token decimals, for formatting the atomic amount.",
            "example": 6
          },
          "amount": {
            "type": "string",
            "description": "Exact sum of the amounts of the paid escrows, in atomic units (a decimal integer string). Gross: a partial refund of an instant order is not subtracted.",
            "example": "125000000"
          }
        },
        "required": [
          "tokenSymbol",
          "tokenAddress",
          "tokenDecimals",
          "amount"
        ]
      },
      "PaymentAnalyticsDto": {
        "type": "object",
        "properties": {
          "windowDays": {
            "type": "number",
            "description": "Window length in days.",
            "example": 30
          },
          "from": {
            "type": "string",
            "description": "Start of the window: 00:00 UTC of its first day.",
            "example": "2026-09-25T00:00:00.000Z"
          },
          "to": {
            "type": "string",
            "description": "When the aggregate was computed (the end of the window).",
            "example": "2026-10-24T09:15:00.000Z"
          },
          "totals": {
            "$ref": "#/components/schemas/PaymentTotalsDto"
          },
          "paymentLinks": {
            "type": "number",
            "description": "Escrows created through the dashboard payment-link form (`POST /v1/dashboard/escrows`) in the window.",
            "example": 5
          },
          "daily": {
            "description": "One entry per UTC day of the window, oldest first, zero-filled.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentDailyDto"
            }
          },
          "volume": {
            "description": "Settled volume per token; empty when nothing was paid.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaymentVolumeDto"
            }
          }
        },
        "required": [
          "windowDays",
          "from",
          "to",
          "totals",
          "paymentLinks",
          "daily",
          "volume"
        ]
      },
      "CreateEscrowDto": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "string",
            "description": "Amount in atomic units as a decimal string (never a float/number). USDC has 6 decimals, so 1 USDC is \"1000000\".",
            "example": "1000000"
          },
          "currency": {
            "type": "string",
            "description": "Token symbol. MVP accepts USDC only.",
            "example": "USDC"
          },
          "buyerWallet": {
            "type": "string",
            "description": "Optional. Omit to let the buyer pay from any wallet; the wallet that funds becomes the buyer.",
            "example": "0xAbC1230000000000000000000000000000dEf9"
          },
          "sellerWallet": {
            "type": "string",
            "description": "Seller wallet address — receives the escrowed funds when the escrow is released. Give this or `sellerWalletId`, not both.",
            "example": "0x9fE0000000000000000000000000000000AbC1"
          },
          "sellerWalletId": {
            "type": "string",
            "description": "Id of a verified seller wallet (`swal_…`, from `POST /v1/seller-wallet-verifications`). The seller is the address the seller proved they control. Give this or `sellerWallet`, not both.",
            "example": "swal_01K6Z3M8Q4R2T7V9W1X3Y5Z7A9"
          },
          "externalReference": {
            "type": "string",
            "description": "Merchant-side reference (e.g. an order id), unique per organization.",
            "example": "order_4471",
            "maxLength": 128
          },
          "description": {
            "type": "string",
            "description": "What the buyer is paying for. Plain text, shown on the hosted checkout. Must not be blank.",
            "example": "Logo design, order 4471",
            "maxLength": 500
          },
          "successUrl": {
            "type": "string",
            "description": "Where the buyer may return after paying. Absolute URL, no username or password; https for a live key, http or https for a test key. Offered on the hosted success page as a link carrying only `escrow_id`. Arriving at it is not proof of payment. Visible to anyone holding the checkout link.",
            "example": "https://shop.example/orders/4471/paid",
            "maxLength": 2048
          },
          "cancelUrl": {
            "type": "string",
            "description": "Where the buyer may return without paying. Same rules as `successUrl`. Visible to anyone holding the checkout link.",
            "example": "https://shop.example/orders/4471",
            "maxLength": 2048
          },
          "expiresAt": {
            "type": "string",
            "description": "When the buyer may refund a funded escrow themselves (ADR-014), RFC 3339 UTC. Also bounds funding.",
            "example": "2026-09-10T00:00:00.000Z"
          },
          "fundingDeadline": {
            "type": "string",
            "description": "When an unfunded escrow expires. Defaults to expiresAt. Must be ≤ expiresAt.",
            "example": "2026-09-03T00:00:00.000Z"
          },
          "settlementMode": {
            "example": "ESCROW",
            "$ref": "#/components/schemas/SettlementMode"
          },
          "metadata": {
            "type": "object",
            "description": "Arbitrary merchant metadata as string keys and values. Echoed back on every read of the escrow.",
            "example": {
              "orderId": "4471"
            }
          }
        },
        "required": [
          "amount",
          "currency"
        ]
      },
      "EscrowStatus": {
        "type": "string",
        "enum": [
          "CREATED",
          "AWAITING_APPROVAL",
          "AWAITING_FUNDING",
          "FUNDING_SUBMITTED",
          "FUNDED",
          "RELEASE_SUBMITTED",
          "RELEASED",
          "REFUND_SUBMITTED",
          "REFUNDED",
          "DISPUTED",
          "RESOLUTION_SUBMITTED",
          "RESOLVED",
          "CANCELLED",
          "EXPIRED",
          "PAID",
          "RECONCILIATION_REQUIRED"
        ]
      },
      "TokenDto": {
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string",
            "example": "USDC"
          },
          "address": {
            "type": "string",
            "description": "Token contract address.",
            "example": "0x036CbD53842c5426634e7929541eC2318f3dCF7e"
          },
          "decimals": {
            "type": "number",
            "description": "Decimals of the atomic unit; 6 for USDC.",
            "example": 6
          }
        },
        "required": [
          "symbol",
          "address",
          "decimals"
        ]
      },
      "EscrowPartyDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "BUYER",
              "SELLER"
            ]
          },
          "walletAddress": {
            "type": "string",
            "example": "0xAbC1230000000000000000000000000000dEf9"
          }
        },
        "required": [
          "type",
          "walletAddress"
        ]
      },
      "FundingEvidenceDto": {
        "type": "object",
        "properties": {
          "transactionHash": {
            "type": "string",
            "description": "The funding transaction."
          },
          "blockNumber": {
            "type": "string",
            "description": "Block height as a decimal string.",
            "example": "12345678"
          },
          "blockHash": {
            "type": "string"
          },
          "logIndex": {
            "type": "number",
            "description": "Position of the funding event in the block; one transaction can emit several."
          },
          "confirmations": {
            "type": "number",
            "description": "Confirmations when the escrow became FUNDED."
          },
          "confirmedAt": {
            "type": "string",
            "description": "RFC 3339 UTC timestamp of the transition."
          }
        },
        "required": [
          "transactionHash",
          "blockNumber",
          "blockHash",
          "logIndex",
          "confirmations",
          "confirmedAt"
        ]
      },
      "EscrowLinksDto": {
        "type": "object",
        "properties": {
          "checkout": {
            "type": "string",
            "description": "The buyer's payment page. Equal to checkoutUrl."
          },
          "release": {
            "type": "string",
            "description": "The buyer's release page."
          },
          "sellerRefund": {
            "type": "string",
            "description": "The seller's refund page."
          },
          "buyerRefund": {
            "type": "string",
            "description": "The buyer's refund page, usable once expiresAt has passed."
          }
        },
        "required": [
          "checkout",
          "release",
          "sellerRefund",
          "buyerRefund"
        ]
      },
      "EscrowResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Public id.",
            "example": "esc_01J…"
          },
          "organizationId": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/EscrowStatus"
          },
          "settlementMode": {
            "$ref": "#/components/schemas/SettlementMode"
          },
          "refundedAmount": {
            "type": "string",
            "description": "INSTANT orders: the total the seller has refunded to the buyer, from confirmed refunds only, as an atomic-unit string. Null for ESCROW orders.",
            "nullable": true,
            "example": "25000000"
          },
          "refundState": {
            "type": "string",
            "description": "INSTANT orders: whether the seller has refunded none, part or all of the payment. Null for ESCROW orders.",
            "enum": [
              "NONE",
              "PARTIAL",
              "FULL"
            ],
            "nullable": true
          },
          "environment": {
            "type": "string",
            "description": "Inherited from the creating API key.",
            "enum": [
              "test",
              "live"
            ]
          },
          "chainId": {
            "type": "number",
            "example": 84532
          },
          "onChainId": {
            "type": "string",
            "description": "Deterministic on-chain id, knowable before the escrow exists on chain; every escrow.* event correlates on it.",
            "nullable": true
          },
          "contractAddress": {
            "type": "string",
            "nullable": true
          },
          "token": {
            "$ref": "#/components/schemas/TokenDto"
          },
          "amountAtomic": {
            "type": "string",
            "description": "Atomic-unit decimal string; 1 USDC is \"1000000\".",
            "example": "1000000"
          },
          "platformFeeAtomic": {
            "type": "string",
            "description": "Atomic-unit decimal string, snapshotted at creation.",
            "example": "10000"
          },
          "parties": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EscrowPartyDto"
            }
          },
          "externalReference": {
            "type": "string",
            "description": "Your own reference, exactly as sent.",
            "nullable": true
          },
          "sellerWalletId": {
            "type": "string",
            "description": "The verified seller wallet (`swal_…`) the seller address was taken from; null when created with a raw `sellerWallet`.",
            "nullable": true
          },
          "groupId": {
            "type": "string",
            "description": "The milestone group this escrow belongs to, or null when it was created alone.",
            "nullable": true,
            "example": null
          },
          "groupPosition": {
            "type": "integer",
            "description": "The escrow's 1-based position within its milestone group, or null when it was created alone.",
            "nullable": true,
            "example": null
          },
          "description": {
            "type": "string",
            "description": "What is being paid for, shown to the buyer.",
            "nullable": true
          },
          "successUrl": {
            "type": "string",
            "description": "Where the buyer may return after paying.",
            "nullable": true
          },
          "cancelUrl": {
            "type": "string",
            "description": "Where the buyer may return without paying.",
            "nullable": true
          },
          "metadata": {
            "type": "object",
            "description": "Your own key/value pairs, exactly as sent.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "expiresAt": {
            "type": "string",
            "description": "When the buyer may refund a funded escrow themselves. RFC 3339.",
            "nullable": true
          },
          "fundingDeadline": {
            "type": "string",
            "description": "When an unfunded escrow expires. Defaults to expiresAt. RFC 3339.",
            "nullable": true
          },
          "fundingEvidence": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/FundingEvidenceDto"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "RFC 3339 UTC timestamp."
          },
          "updatedAt": {
            "type": "string",
            "description": "RFC 3339 UTC timestamp."
          },
          "checkoutUrl": {
            "type": "string",
            "description": "Hosted checkout page for the buyer. Absent when the deployment has no checkout base URL."
          },
          "links": {
            "$ref": "#/components/schemas/EscrowLinksDto"
          }
        },
        "required": [
          "id",
          "organizationId",
          "status",
          "settlementMode",
          "refundedAmount",
          "refundState",
          "environment",
          "chainId",
          "onChainId",
          "contractAddress",
          "token",
          "amountAtomic",
          "platformFeeAtomic",
          "parties",
          "externalReference",
          "sellerWalletId",
          "groupId",
          "groupPosition",
          "description",
          "successUrl",
          "cancelUrl",
          "metadata",
          "expiresAt",
          "fundingDeadline",
          "fundingEvidence",
          "createdAt",
          "updatedAt"
        ]
      },
      "IntegrationChecklistStepId": {
        "type": "string",
        "description": "Which step this is.",
        "enum": [
          "apiKey",
          "webhookEndpoint",
          "successfulDelivery",
          "fundedEscrow"
        ]
      },
      "IntegrationChecklistStepDto": {
        "type": "object",
        "properties": {
          "id": {
            "example": "apiKey",
            "$ref": "#/components/schemas/IntegrationChecklistStepId"
          },
          "done": {
            "type": "boolean",
            "description": "Whether the step is done; null when the service that knows could not be asked (show it as not yet confirmed).",
            "nullable": true,
            "example": true
          },
          "href": {
            "type": "string",
            "description": "The dashboard page or documentation that completes the step.",
            "example": "/dashboard/developers/api-keys"
          }
        },
        "required": [
          "id",
          "done",
          "href"
        ]
      },
      "IntegrationChecklistDto": {
        "type": "object",
        "properties": {
          "steps": {
            "description": "The four steps, always in the same order.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationChecklistStepDto"
            }
          },
          "complete": {
            "type": "boolean",
            "description": "True only when every step is done.",
            "example": false
          }
        },
        "required": [
          "steps",
          "complete"
        ]
      },
      "RequestLogEntryDto": {
        "type": "object",
        "properties": {
          "occurredAt": {
            "type": "string",
            "description": "When the request started (RFC 3339).",
            "example": "2026-10-04T09:12:03.512Z"
          },
          "method": {
            "type": "string",
            "description": "HTTP method.",
            "example": "POST"
          },
          "route": {
            "type": "string",
            "description": "Matched route template; null when no route matched.",
            "nullable": true,
            "example": "/v1/escrows/:escrowId/release-intent"
          },
          "status": {
            "type": "number",
            "description": "HTTP status sent.",
            "example": 422
          },
          "latencyMs": {
            "type": "number",
            "description": "Milliseconds from request start to response sent.",
            "example": 18
          },
          "requestId": {
            "type": "string",
            "description": "The X-Request-Id; null when the caller sent one longer than 128 characters or outside [A-Za-z0-9._:-].",
            "nullable": true,
            "example": "4f6a0c2e-9d8b-4c1e-8d0b-2a7f3e9c1b55"
          },
          "apiKeyId": {
            "type": "string",
            "description": "Id of the API key that made the request.",
            "example": "key_01J9Z6Q3M4"
          },
          "environment": {
            "type": "string",
            "description": "Environment of the API key.",
            "enum": [
              "test",
              "live"
            ],
            "example": "test"
          }
        },
        "required": [
          "occurredAt",
          "method",
          "route",
          "status",
          "latencyMs",
          "requestId",
          "apiKeyId",
          "environment"
        ]
      },
      "RequestLogPageDto": {
        "type": "object",
        "properties": {
          "data": {
            "description": "Entries, newest first.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RequestLogEntryDto"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "Opaque cursor for the next page; null on the last page.",
            "nullable": true,
            "example": null
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "EscrowGroupProgressDto": {
        "type": "object",
        "properties": {
          "total": {
            "type": "number",
            "description": "Number of members.",
            "example": 3
          },
          "final": {
            "type": "number",
            "description": "Members in a final state (RELEASED, REFUNDED, RESOLVED, CANCELLED or EXPIRED).",
            "example": 1
          },
          "complete": {
            "type": "boolean",
            "description": "True when every member is in a final state.",
            "example": false
          }
        },
        "required": [
          "total",
          "final",
          "complete"
        ]
      },
      "EscrowGroupResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Public group id.",
            "example": "egrp_01J8Z3K4M5N6P7Q8R9S0T1V2W3"
          },
          "organizationId": {
            "type": "string",
            "description": "Owning organization."
          },
          "environment": {
            "type": "string",
            "enum": [
              "test",
              "live"
            ],
            "description": "Environment of the key that created it."
          },
          "externalReference": {
            "type": "string",
            "description": "Your reference for the project, exactly as sent.",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "The project description, exactly as sent.",
            "nullable": true
          },
          "metadata": {
            "type": "object",
            "description": "Your own key/value pairs, exactly as sent.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "progress": {
            "$ref": "#/components/schemas/EscrowGroupProgressDto"
          },
          "completedAt": {
            "type": "string",
            "description": "When `escrow.group.completed` was emitted, or null. Not retracted if a member is later reconciled after a reorg — read `progress` for the current state.",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "description": "RFC 3339."
          },
          "members": {
            "description": "Every member, in milestone order, each a full escrow.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EscrowResponseDto"
            }
          }
        },
        "required": [
          "id",
          "organizationId",
          "environment",
          "externalReference",
          "description",
          "metadata",
          "progress",
          "completedAt",
          "createdAt",
          "members"
        ]
      },
      "CreateWebhookEndpointDto": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "URL deliveries are POSTed to. HTTPS is strongly recommended; the destination is checked for SSRF safety at registration and delivery time.",
            "example": "https://merchant.example.com/webhooks/escrow"
          },
          "enabledEvents": {
            "type": "array",
            "description": "Event types this endpoint subscribes to. At least one is required. `webhook.test` cannot be subscribed to — send one with `POST /v1/webhook-endpoints/{id}/test`.",
            "example": [
              "escrow.funded",
              "escrow.released"
            ],
            "items": {
              "type": "string",
              "enum": [
                "escrow.created",
                "escrow.funded",
                "escrow.released",
                "escrow.refunded",
                "escrow.disputed",
                "escrow.resolved",
                "escrow.cancelled",
                "escrow.expired",
                "escrow.group.completed",
                "escrow.paid",
                "escrow.payment_refunded",
                "subscription.created",
                "subscription.charged",
                "subscription.payment_failed",
                "subscription.cancelled",
                "subscription.charge_refunded",
                "transaction.failed",
                "seller_wallet.verified"
              ]
            }
          },
          "description": {
            "type": "string",
            "description": "Optional human-readable label for this endpoint.",
            "maxLength": 200,
            "example": "Production order sync"
          }
        },
        "required": [
          "url",
          "enabledEvents"
        ]
      },
      "UpdateWebhookEndpointDto": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "New destination URL. Re-checked for SSRF safety.",
            "example": "https://merchant.example.com/webhooks/escrow"
          },
          "enabledEvents": {
            "type": "array",
            "description": "Replace the full set of subscribed event types. `webhook.test` cannot be subscribed to.",
            "items": {
              "type": "string",
              "enum": [
                "escrow.created",
                "escrow.funded",
                "escrow.released",
                "escrow.refunded",
                "escrow.disputed",
                "escrow.resolved",
                "escrow.cancelled",
                "escrow.expired",
                "escrow.group.completed",
                "escrow.paid",
                "escrow.payment_refunded",
                "subscription.created",
                "subscription.charged",
                "subscription.payment_failed",
                "subscription.cancelled",
                "subscription.charge_refunded",
                "transaction.failed",
                "seller_wallet.verified"
              ]
            }
          },
          "enabled": {
            "type": "boolean",
            "description": "Disable without deleting — deliveries pause but the endpoint and its history are retained."
          },
          "description": {
            "type": "string",
            "description": "Replace the human-readable label.",
            "maxLength": 200
          }
        }
      },
      "AddDisputeEvidenceDto": {
        "type": "object",
        "properties": {
          "evidenceHash": {
            "type": "string",
            "description": "keccak256 anchor of the off-chain evidence bundle (0x-prefixed 32-byte hex), if evidence is content-addressed.",
            "example": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcd"
          },
          "description": {
            "type": "object",
            "description": "Descriptive evidence metadata: links, document names, notes, as string keys and values.",
            "example": {
              "photoUrl": "https://example.com/evidence/1.jpg",
              "note": "Item arrived damaged"
            }
          }
        },
        "required": [
          "description"
        ]
      },
      "InviteMemberDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Email address to invite.",
            "maxLength": 320,
            "example": "new-member@example.com"
          },
          "role": {
            "type": "string",
            "description": "Role the invitation grants once accepted.",
            "enum": [
              "OWNER",
              "ADMIN",
              "DEVELOPER",
              "VIEWER"
            ]
          }
        },
        "required": [
          "email",
          "role"
        ]
      },
      "ChangeRoleDto": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "description": "New role for the member.",
            "enum": [
              "OWNER",
              "ADMIN",
              "DEVELOPER",
              "VIEWER"
            ]
          },
          "reason": {
            "type": "string",
            "description": "Free-text reason, recorded on the audit trail.",
            "maxLength": 500
          }
        },
        "required": [
          "role"
        ]
      },
      "ConfirmMfaDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "The current 6-digit TOTP code, or a recovery code for disable.",
            "minLength": 6,
            "maxLength": 64,
            "example": "123456"
          }
        },
        "required": [
          "code"
        ]
      },
      "BrandSettingsDto": {
        "type": "object",
        "properties": {
          "displayName": {
            "type": "string",
            "nullable": true,
            "maxLength": 60,
            "example": "Acme Tools"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "maxLength": 280,
            "example": "Hand tools since 1984"
          },
          "logoUrl": {
            "type": "string",
            "nullable": true,
            "description": "Public address of the stored logo, or null."
          },
          "logoUploadEnabled": {
            "type": "boolean",
            "description": "False when the operator configured no object storage; the dashboard then shows no upload control."
          },
          "version": {
            "type": "number",
            "description": "Increases on every write; send it back as `expectedVersion` to detect a concurrent edit.",
            "example": 3
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "displayName",
          "description",
          "logoUrl",
          "logoUploadEnabled",
          "version",
          "updatedAt"
        ]
      },
      "UpdateBrandDto": {
        "type": "object",
        "properties": {
          "displayName": {
            "type": "string",
            "nullable": true,
            "maxLength": 60
          },
          "description": {
            "type": "string",
            "nullable": true,
            "maxLength": 280
          },
          "expectedVersion": {
            "type": "number",
            "description": "Refuse the write with 409 `brand_version_conflict` if the profile has changed since this version."
          }
        }
      },
      "EmbedOriginDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "origin": {
            "type": "string",
            "example": "https://shop.example.com",
            "description": "Canonical web origin: scheme, host and optional port only."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "origin",
          "createdAt"
        ]
      },
      "EmbedOriginListDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmbedOriginDto"
            }
          },
          "max": {
            "type": "number",
            "example": 10
          }
        },
        "required": [
          "items",
          "max"
        ]
      },
      "AddEmbedOriginDto": {
        "type": "object",
        "properties": {
          "origin": {
            "type": "string",
            "example": "https://shop.example.com",
            "maxLength": 253
          }
        },
        "required": [
          "origin"
        ]
      },
      "EmbedOriginCheckDto": {
        "type": "object",
        "properties": {
          "allowed": {
            "type": "boolean"
          }
        },
        "required": [
          "allowed"
        ]
      },
      "FundingIntentDto": {
        "type": "object",
        "properties": {
          "buyerWallet": {
            "type": "string",
            "description": "The wallet that will fund the escrow. Required while the escrow has no buyer; for a bound escrow it must match the bound buyer unless the buyer was only provisionally bound at checkout and nothing has been submitted yet.",
            "example": "0xAbC1230000000000000000000000000000dEf9"
          }
        }
      },
      "RegisterTransactionDto": {
        "type": "object",
        "properties": {
          "transactionHash": {
            "type": "string",
            "description": "The 0x-prefixed 32-byte transaction hash the user's wallet broadcast. Untrusted input — verified against the chain on nine properties before any state changes; never taken on faith.",
            "example": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcd"
          },
          "chainId": {
            "type": "number",
            "description": "Chain id the transaction was sent on; must match the escrow's own chain.",
            "example": 8453
          }
        },
        "required": [
          "transactionHash",
          "chainId"
        ]
      },
      "SettlementIntentDto": {
        "type": "object",
        "properties": {}
      },
      "PaymentRefundIntentDto": {
        "type": "object",
        "properties": {
          "wallet": {
            "type": "string",
            "description": "The seller wallet that will sign — the only wallet the contract accepts a refund from.",
            "example": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC"
          },
          "amount": {
            "type": "string",
            "description": "Atomic units to return to the buyer, as a decimal string. Positive, and no more than the paid amount minus what is already refunded.",
            "example": "25000000"
          }
        },
        "required": [
          "wallet",
          "amount"
        ]
      },
      "CheckoutOpenDisputeDto": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "description": "Why the dispute is being opened.",
            "maxLength": 200,
            "example": "Item not received"
          },
          "evidence": {
            "type": "object",
            "description": "Free-form evidence descriptors (links, document names, notes) as string keys and values.",
            "example": {
              "trackingUrl": "https://carrier.example/track/123"
            }
          },
          "party": {
            "type": "string",
            "description": "Which party is opening the dispute",
            "enum": [
              "BUYER",
              "SELLER"
            ]
          }
        },
        "required": [
          "reason"
        ]
      },
      "WalletVerificationLookupRequestDto": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "The token from the link fragment. Sent in the body so it never appears in a path or a log."
          },
          "address": {
            "type": "string",
            "description": "The connected wallet. When given, the response carries the exact message to sign.",
            "example": "0x90F79bf6EB2c4f870365E785982E1f101E93b906"
          }
        },
        "required": [
          "token"
        ]
      },
      "SellerWalletVerificationStatus": {
        "type": "string",
        "description": "PENDING until the seller signs; VERIFIED after; EXPIRED once `expiresAt` passes unsigned.",
        "enum": [
          "PENDING",
          "VERIFIED",
          "EXPIRED"
        ]
      },
      "WalletVerificationLookupDto": {
        "type": "object",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/SellerWalletVerificationStatus"
          },
          "organizationName": {
            "type": "string",
            "description": "Who asked for the proof.",
            "example": "Acme Market"
          },
          "sellerReference": {
            "type": "string",
            "example": "seller_812"
          },
          "domain": {
            "type": "string",
            "description": "EIP-4361 domain: the host this page is served from.",
            "example": "escrow.example"
          },
          "uri": {
            "type": "string",
            "description": "EIP-4361 URI.",
            "example": "https://escrow.example/verify-wallet"
          },
          "chainId": {
            "type": "number",
            "example": 31337
          },
          "nonce": {
            "type": "string",
            "description": "EIP-4361 nonce.",
            "example": "k3J9a8Qm2Lx7Vb4N"
          },
          "issuedAt": {
            "type": "string",
            "example": "2026-10-02T12:00:00.000Z"
          },
          "expiresAt": {
            "type": "string",
            "example": "2026-10-05T12:00:00.000Z"
          },
          "returnUrl": {
            "type": "string",
            "description": "The merchant's page the seller returns to, and the only origin the page posts its outcome to (ADR-037); null when none.",
            "nullable": true,
            "example": "https://marketplace.example/settings/payouts"
          },
          "message": {
            "type": "string",
            "description": "The exact text to sign; present only when `address` was sent and the link is PENDING."
          }
        },
        "required": [
          "status",
          "organizationName",
          "sellerReference",
          "domain",
          "uri",
          "chainId",
          "nonce",
          "issuedAt",
          "expiresAt",
          "returnUrl"
        ]
      },
      "WalletVerificationConfirmRequestDto": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "The token from the link fragment."
          },
          "address": {
            "type": "string",
            "description": "The wallet that signed.",
            "example": "0x90F79bf6EB2c4f870365E785982E1f101E93b906"
          },
          "signature": {
            "type": "string",
            "description": "65-byte personal_sign signature, 0x-prefixed hex."
          }
        },
        "required": [
          "token",
          "address",
          "signature"
        ]
      },
      "WalletVerificationConfirmDto": {
        "type": "object",
        "properties": {
          "status": {
            "example": "VERIFIED",
            "$ref": "#/components/schemas/SellerWalletVerificationStatus"
          },
          "address": {
            "type": "string",
            "description": "The verified address, EIP-55 checksummed.",
            "example": "0x90F79bf6EB2c4f870365E785982E1f101E93b906"
          }
        },
        "required": [
          "status",
          "address"
        ]
      },
      "ApiErrorBodyDto": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Coarse family: invalid_request, authentication_error, authorization_error, rate_limit_error, api_error.",
            "example": "invalid_request"
          },
          "code": {
            "type": "string",
            "description": "Specific, stable error code. See errors.md.",
            "example": "validation_failed"
          },
          "message": {
            "type": "string",
            "description": "Human-readable, safe-to-display message."
          },
          "requestId": {
            "type": "string",
            "description": "Echo of X-Request-Id, to quote in support requests."
          },
          "details": {
            "type": "object",
            "description": "Structured context. Never secrets, never stack traces.",
            "additionalProperties": true
          }
        },
        "required": [
          "type",
          "code",
          "message",
          "requestId"
        ]
      },
      "ApiErrorResponseDto": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ApiErrorBodyDto"
          }
        },
        "required": [
          "error"
        ]
      },
      "ExpectedRecipientDto": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string"
          },
          "amountAtomic": {
            "type": "string",
            "description": "Atomic-unit decimal string.",
            "example": "990000"
          }
        },
        "required": [
          "address",
          "amountAtomic"
        ]
      },
      "EscrowListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EscrowResponseDto"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "Cursor for the next page; null on the last page.",
            "nullable": true
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "TransactionRequestDto": {
        "type": "object",
        "properties": {
          "chainId": {
            "type": "number",
            "description": "Chain the transaction must be sent on.",
            "example": 84532
          },
          "to": {
            "type": "string",
            "description": "Contract to call.",
            "example": "0x5FbDB2315678afecb367f032d93F642f64180aa3"
          },
          "data": {
            "type": "string",
            "description": "ABI-encoded calldata.",
            "example": "0x095ea7b3…"
          },
          "value": {
            "type": "string",
            "description": "Native value in wei as a decimal string; \"0\" for USDC flows.",
            "example": "0"
          },
          "gas": {
            "type": "string",
            "description": "Gas limit hint as a decimal string; wallets may override."
          }
        },
        "required": [
          "chainId",
          "to",
          "data",
          "value"
        ]
      },
      "EscrowIntentResponseDto": {
        "type": "object",
        "properties": {
          "escrowId": {
            "type": "string"
          },
          "transactions": {
            "description": "Transactions to sign, in order.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransactionRequestDto"
            }
          },
          "status": {
            "$ref": "#/components/schemas/EscrowStatus"
          },
          "expiresAt": {
            "type": "string",
            "description": "When the embedded authorization expires. RFC 3339."
          },
          "operationId": {
            "type": "string",
            "description": "The settlement operation recorded at REQUESTED; the escrow itself did not move."
          },
          "expectedRecipients": {
            "type": "object",
            "description": "Who this settlement pays, keyed by role (seller, feeRecipient, buyer). Absent on funding intents.",
            "additionalProperties": {
              "$ref": "#/components/schemas/ExpectedRecipientDto"
            }
          }
        },
        "required": [
          "escrowId",
          "transactions",
          "status"
        ]
      },
      "TransactionPurpose": {
        "type": "string",
        "enum": [
          "APPROVAL",
          "FUNDING",
          "RELEASE",
          "REFUND",
          "DISPUTE_RESOLUTION"
        ]
      },
      "BlockchainTransactionStatus": {
        "type": "string",
        "enum": [
          "REGISTERED",
          "PENDING",
          "CONFIRMED",
          "FAILED",
          "DROPPED",
          "REPLACED",
          "REORGED"
        ]
      },
      "TransactionStatusHistoryDto": {
        "type": "object",
        "properties": {
          "fromStatus": {
            "type": "string",
            "description": "Null on the first entry.",
            "enum": [
              "REGISTERED",
              "PENDING",
              "CONFIRMED",
              "FAILED",
              "DROPPED",
              "REPLACED",
              "REORGED"
            ],
            "nullable": true
          },
          "toStatus": {
            "$ref": "#/components/schemas/BlockchainTransactionStatus"
          },
          "reason": {
            "type": "string",
            "description": "What caused the transition. Never payload content.",
            "nullable": true
          },
          "at": {
            "type": "string",
            "description": "RFC 3339 UTC timestamp."
          }
        },
        "required": [
          "fromStatus",
          "toStatus",
          "reason",
          "at"
        ]
      },
      "RegisteredFundingTransactionDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Public id.",
            "example": "txn_01J…"
          },
          "organizationId": {
            "type": "string"
          },
          "escrowId": {
            "type": "string"
          },
          "chainId": {
            "type": "number",
            "example": 84532
          },
          "hash": {
            "type": "string"
          },
          "fromAddress": {
            "type": "string",
            "nullable": true
          },
          "toAddress": {
            "type": "string",
            "nullable": true
          },
          "purpose": {
            "$ref": "#/components/schemas/TransactionPurpose"
          },
          "status": {
            "$ref": "#/components/schemas/BlockchainTransactionStatus"
          },
          "confirmations": {
            "type": "number"
          },
          "requiredConfirmations": {
            "type": "number"
          },
          "blockNumber": {
            "type": "string",
            "description": "Block height as a decimal string.",
            "nullable": true
          },
          "blockHash": {
            "type": "string",
            "nullable": true
          },
          "failureCode": {
            "type": "string",
            "description": "Machine-readable reason for FAILED, DROPPED, REPLACED or REORGED.",
            "nullable": true
          },
          "failureReason": {
            "type": "string",
            "description": "What failed and where. Never payload content.",
            "nullable": true
          },
          "statusHistory": {
            "description": "Every transition, oldest first.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransactionStatusHistoryDto"
            }
          },
          "replacedBy": {
            "type": "string",
            "description": "The hash that superseded this transaction.",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "description": "RFC 3339 UTC timestamp."
          },
          "updatedAt": {
            "type": "string",
            "description": "RFC 3339 UTC timestamp."
          },
          "escrowStatus": {
            "type": "string",
            "description": "The escrow's status, unchanged by this call."
          }
        },
        "required": [
          "id",
          "organizationId",
          "escrowId",
          "chainId",
          "hash",
          "fromAddress",
          "toAddress",
          "purpose",
          "status",
          "confirmations",
          "requiredConfirmations",
          "blockNumber",
          "blockHash",
          "failureCode",
          "failureReason",
          "statusHistory",
          "replacedBy",
          "createdAt",
          "updatedAt",
          "escrowStatus"
        ]
      },
      "InstantRefundDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Public id.",
            "example": "rfnd_01J…"
          },
          "amountAtomic": {
            "type": "string",
            "description": "This refund, atomic units.",
            "example": "25000000"
          },
          "totalRefundedAtomic": {
            "type": "string",
            "description": "The contract's running total after this refund, atomic units.",
            "example": "25000000"
          },
          "transactionHash": {
            "type": "string",
            "description": "The refund transaction on chain."
          },
          "status": {
            "type": "string",
            "description": "CONFIRMED, or REORGED when a chain reorganization removed it (then it no longer counts).",
            "enum": [
              "CONFIRMED",
              "REORGED"
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "When the platform recorded it (RFC 3339)."
          }
        },
        "required": [
          "id",
          "amountAtomic",
          "totalRefundedAtomic",
          "transactionHash",
          "status",
          "createdAt"
        ]
      },
      "CancelEscrowDto": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "description": "Free-text reason for the cancellation, for audit/support purposes.",
            "maxLength": 500
          }
        }
      },
      "CreateEscrowGroupDto": {
        "type": "object",
        "properties": {
          "externalReference": {
            "type": "string",
            "description": "Your reference for the whole project (e.g. a job id), unique per organization.",
            "example": "project-981",
            "maxLength": 128
          },
          "description": {
            "type": "string",
            "description": "What the project is. Plain text, for your own reads; buyers see each member's own description.",
            "example": "Website redesign",
            "maxLength": 500
          },
          "metadata": {
            "type": "object",
            "description": "Arbitrary metadata as string keys and values, with the same limits as an escrow's. Echoed on reads and in `escrow.group.completed`.",
            "example": {
              "projectId": "981"
            }
          },
          "members": {
            "description": "The milestones, in order: 2-20 members, each exactly a `POST /v1/escrows` body with the same rules and defaults. Each member gets its own fee, computed from its own amount.",
            "minItems": 2,
            "maxItems": 20,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateEscrowDto"
            }
          }
        },
        "required": [
          "members"
        ]
      },
      "CreateSellerWalletVerificationDto": {
        "type": "object",
        "properties": {
          "sellerReference": {
            "type": "string",
            "description": "Your reference for the seller (e.g. their account id), 1-128 characters. It is shown to the seller on the verification page, so do not put personal data in it.",
            "example": "seller_812",
            "maxLength": 128
          },
          "returnUrl": {
            "type": "string",
            "description": "Your page the seller comes back to, absolute, at most 2048 characters, no username or password; https for a live key, http or https for a test key. When `/embed/v1.js` opens the link in a popup, the page tells this origin `verified` or `cancelled`; otherwise it is offered to the seller as a link. Not part of the signed message, and shown to whoever holds the link.",
            "example": "https://marketplace.example/settings/payouts",
            "maxLength": 2048
          }
        },
        "required": [
          "sellerReference"
        ]
      },
      "SellerWalletDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Verified wallet id. Pass it as `sellerWalletId` when creating an escrow.",
            "example": "swal_01K6Z3M8Q4R2T7V9W1X3Y5Z7A9"
          },
          "address": {
            "type": "string",
            "description": "The proven address, EIP-55 checksummed.",
            "example": "0x90F79bf6EB2c4f870365E785982E1f101E93b906"
          },
          "chainId": {
            "type": "number",
            "description": "Chain the challenge named.",
            "example": 31337
          },
          "sellerReference": {
            "type": "string",
            "description": "The seller reference the wallet was verified for.",
            "example": "seller_812"
          },
          "verifiedAt": {
            "type": "string",
            "description": "When ownership was last proven (RFC 3339 UTC).",
            "example": "2026-10-02T12:04:11.000Z"
          }
        },
        "required": [
          "id",
          "address",
          "chainId",
          "sellerReference",
          "verifiedAt"
        ]
      },
      "SellerWalletVerificationDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Verification id.",
            "example": "swv_01K6Z3M8Q4R2T7V9W1X3Y5Z7A9"
          },
          "sellerReference": {
            "type": "string",
            "description": "The seller reference the link was requested for.",
            "example": "seller_812"
          },
          "status": {
            "$ref": "#/components/schemas/SellerWalletVerificationStatus"
          },
          "url": {
            "type": "string",
            "description": "The link to send the seller. Returned only by the create call: the token in it is not stored and cannot be shown again.",
            "example": "https://escrow.example/verify-wallet#token=Q2hhbGxlbmdl"
          },
          "returnUrl": {
            "type": "string",
            "description": "The `returnUrl` the link was created with; null when none.",
            "nullable": true,
            "example": "https://marketplace.example/settings/payouts"
          },
          "expiresAt": {
            "type": "string",
            "description": "When the link stops working (RFC 3339 UTC).",
            "example": "2026-10-05T12:00:00.000Z"
          },
          "createdAt": {
            "type": "string",
            "description": "When the link was created (RFC 3339 UTC).",
            "example": "2026-10-02T12:00:00.000Z"
          },
          "verifiedAt": {
            "type": "string",
            "description": "When the seller signed; null until then.",
            "nullable": true,
            "example": null
          },
          "sellerWallet": {
            "description": "The verified wallet; null until the seller signs.",
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/SellerWalletDto"
              }
            ]
          }
        },
        "required": [
          "id",
          "sellerReference",
          "status",
          "returnUrl",
          "expiresAt",
          "createdAt",
          "verifiedAt",
          "sellerWallet"
        ]
      },
      "SellerWalletListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SellerWalletDto"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "Cursor for the next page; null on the last page.",
            "nullable": true
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "TransactionResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Public id.",
            "example": "txn_01J…"
          },
          "organizationId": {
            "type": "string"
          },
          "escrowId": {
            "type": "string"
          },
          "chainId": {
            "type": "number",
            "example": 84532
          },
          "hash": {
            "type": "string"
          },
          "fromAddress": {
            "type": "string",
            "nullable": true
          },
          "toAddress": {
            "type": "string",
            "nullable": true
          },
          "purpose": {
            "$ref": "#/components/schemas/TransactionPurpose"
          },
          "status": {
            "$ref": "#/components/schemas/BlockchainTransactionStatus"
          },
          "confirmations": {
            "type": "number"
          },
          "requiredConfirmations": {
            "type": "number"
          },
          "blockNumber": {
            "type": "string",
            "description": "Block height as a decimal string.",
            "nullable": true
          },
          "blockHash": {
            "type": "string",
            "nullable": true
          },
          "failureCode": {
            "type": "string",
            "description": "Machine-readable reason for FAILED, DROPPED, REPLACED or REORGED.",
            "nullable": true
          },
          "failureReason": {
            "type": "string",
            "description": "What failed and where. Never payload content.",
            "nullable": true
          },
          "statusHistory": {
            "description": "Every transition, oldest first.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransactionStatusHistoryDto"
            }
          },
          "replacedBy": {
            "type": "string",
            "description": "The hash that superseded this transaction.",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "description": "RFC 3339 UTC timestamp."
          },
          "updatedAt": {
            "type": "string",
            "description": "RFC 3339 UTC timestamp."
          }
        },
        "required": [
          "id",
          "organizationId",
          "escrowId",
          "chainId",
          "hash",
          "fromAddress",
          "toAddress",
          "purpose",
          "status",
          "confirmations",
          "requiredConfirmations",
          "blockNumber",
          "blockHash",
          "failureCode",
          "failureReason",
          "statusHistory",
          "replacedBy",
          "createdAt",
          "updatedAt"
        ]
      },
      "OpenDisputeDto": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "description": "Why the dispute is being opened.",
            "maxLength": 200,
            "example": "Item not received"
          },
          "evidence": {
            "type": "object",
            "description": "Free-form evidence descriptors (links, document names, notes) as string keys and values.",
            "example": {
              "trackingUrl": "https://carrier.example/track/123"
            }
          }
        },
        "required": [
          "reason"
        ]
      },
      "DisputeStatus": {
        "type": "string",
        "enum": [
          "CREATED",
          "UNDER_REVIEW",
          "RESOLUTION_PREPARED",
          "RESOLVED",
          "CANCELLED"
        ]
      },
      "DisputeResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Public id.",
            "example": "dsp_01J…"
          },
          "escrowId": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/DisputeStatus"
          },
          "reason": {
            "type": "string"
          },
          "evidenceHash": {
            "type": "string",
            "nullable": true
          },
          "openedBy": {
            "type": "string",
            "description": "Who opened the dispute."
          },
          "createdAt": {
            "type": "string",
            "description": "RFC 3339 UTC timestamp."
          },
          "updatedAt": {
            "type": "string",
            "description": "RFC 3339 UTC timestamp."
          }
        },
        "required": [
          "id",
          "escrowId",
          "organizationId",
          "status",
          "reason",
          "evidenceHash",
          "openedBy",
          "createdAt",
          "updatedAt"
        ]
      },
      "WebhookEventType": {
        "type": "string",
        "enum": [
          "escrow.created",
          "escrow.funded",
          "escrow.released",
          "escrow.refunded",
          "escrow.disputed",
          "escrow.resolved",
          "escrow.cancelled",
          "escrow.expired",
          "escrow.group.completed",
          "escrow.paid",
          "escrow.payment_refunded",
          "subscription.created",
          "subscription.charged",
          "subscription.payment_failed",
          "subscription.cancelled",
          "subscription.charge_refunded",
          "transaction.failed",
          "seller_wallet.verified",
          "webhook.test"
        ]
      },
      "WebhookEndpointResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Public id.",
            "example": "whe_01J…"
          },
          "organizationId": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "example": "https://merchant.example/webhooks/escrow"
          },
          "enabledEvents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEventType"
            }
          },
          "enabled": {
            "type": "boolean",
            "description": "The merchant's own on/off switch."
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "secret": {
            "type": "string",
            "description": "Signing secret. Present ONLY in the creation response; never retrievable again."
          },
          "consecutiveFailures": {
            "type": "number",
            "description": "Consecutive failed deliveries. Absent means not reported, never healthy."
          },
          "lastSuccessAt": {
            "type": "string",
            "nullable": true
          },
          "lastFailureAt": {
            "type": "string",
            "nullable": true
          },
          "disabledAt": {
            "type": "string",
            "description": "When the platform disabled the endpoint after repeated failures.",
            "nullable": true
          },
          "disabledReason": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "description": "RFC 3339 UTC timestamp."
          },
          "updatedAt": {
            "type": "string",
            "description": "RFC 3339 UTC timestamp."
          }
        },
        "required": [
          "id",
          "organizationId",
          "url",
          "enabledEvents",
          "enabled",
          "description",
          "createdAt",
          "updatedAt"
        ]
      },
      "WebhookEndpointListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEndpointResponseDto"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "Cursor for the next page; null on the last page.",
            "nullable": true
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "WebhookTestResultDto": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string",
            "description": "The recorded webhook.test event, listed like any other event."
          },
          "deliveryId": {
            "type": "string",
            "description": "The single delivery row."
          },
          "status": {
            "type": "string",
            "description": "SUCCEEDED for a 2xx, otherwise FAILED. Never retried.",
            "enum": [
              "SUCCEEDED",
              "FAILED"
            ]
          },
          "responseStatus": {
            "type": "integer",
            "nullable": true
          },
          "responseBodyPreview": {
            "type": "string",
            "nullable": true
          },
          "durationMs": {
            "type": "integer",
            "nullable": true
          },
          "errorMessage": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "eventId",
          "deliveryId",
          "status",
          "responseStatus",
          "responseBodyPreview",
          "durationMs",
          "errorMessage"
        ]
      },
      "WebhookEventResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Public event id.",
            "example": "evt_01J…"
          },
          "type": {
            "$ref": "#/components/schemas/WebhookEventType"
          },
          "apiVersion": {
            "type": "string",
            "example": "2026-07-01"
          },
          "organizationId": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "description": "The event data, exactly as delivered. Shape depends on type.",
            "additionalProperties": true
          },
          "createdAt": {
            "type": "string",
            "description": "RFC 3339 UTC timestamp."
          }
        },
        "required": [
          "id",
          "type",
          "apiVersion",
          "organizationId",
          "data",
          "createdAt"
        ]
      },
      "WebhookEventListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEventResponseDto"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "Cursor for the next page; null on the last page.",
            "nullable": true
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "WebhookDeliveryResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "eventId": {
            "type": "string"
          },
          "endpointId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "SUCCEEDED",
              "RETRYING",
              "FAILED"
            ]
          },
          "attempt": {
            "type": "number"
          },
          "responseStatus": {
            "type": "integer",
            "description": "HTTP status your endpoint returned; null when unreachable.",
            "nullable": true
          },
          "responseBodyPreview": {
            "type": "string",
            "description": "Bounded excerpt of the response body.",
            "nullable": true
          },
          "errorMessage": {
            "type": "string",
            "description": "Why there was no HTTP response.",
            "nullable": true
          },
          "isReplay": {
            "type": "boolean",
            "description": "True when this delivery came from a replay."
          },
          "deliveredAt": {
            "type": "string",
            "nullable": true
          },
          "nextRetryAt": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id",
          "eventId",
          "endpointId",
          "status",
          "attempt",
          "responseStatus",
          "responseBodyPreview",
          "errorMessage",
          "isReplay",
          "deliveredAt",
          "nextRetryAt"
        ]
      },
      "CreateApiKeyDto": {
        "type": "object",
        "properties": {
          "environment": {
            "type": "string",
            "description": "Environment the key operates in. Test and live keys are fully separated — a test key can never touch live data or vice versa.",
            "enum": [
              "test",
              "live"
            ],
            "example": "test"
          },
          "name": {
            "type": "string",
            "description": "Human-readable label for this key.",
            "maxLength": 200,
            "example": "CI pipeline"
          },
          "scopes": {
            "type": "array",
            "description": "Requested scopes. Every API-key operation requires one (its `x-required-scope`); a key without it is refused with 403 `insufficient_scope`. `write` does not include `read`. Defaults to read-only (`escrows:read`, `disputes:read`, `webhooks:read`) when omitted. Cannot be changed after creation.",
            "example": [
              "escrows:read",
              "escrows:write"
            ],
            "items": {
              "type": "string",
              "enum": [
                "escrows:read",
                "escrows:write",
                "disputes:read",
                "disputes:write",
                "webhooks:read",
                "webhooks:write",
                "subscriptions:read",
                "subscriptions:write"
              ]
            }
          }
        },
        "required": [
          "environment"
        ]
      },
      "StaffSignInDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Staff account email address.",
            "maxLength": 320
          },
          "password": {
            "type": "string",
            "description": "Staff account password.",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "required": [
          "email",
          "password"
        ]
      },
      "ProvisionStaffAccountDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "Email address of the new staff account.",
            "maxLength": 320,
            "example": "staff@platform.example"
          },
          "displayName": {
            "type": "string",
            "description": "Human-readable display name.",
            "maxLength": 200
          }
        },
        "required": [
          "email"
        ]
      },
      "ChangeStaffRoleDto": {
        "type": "object",
        "properties": {
          "roles": {
            "type": "array",
            "description": "Replace the full set of roles held by this staff account.",
            "items": {
              "type": "string",
              "enum": [
                "STAFF_VIEWER",
                "STAFF_ADMIN"
              ]
            }
          },
          "reason": {
            "type": "string",
            "description": "Free-text reason, stored for audit.",
            "maxLength": 500
          }
        },
        "required": [
          "roles"
        ]
      },
      "SetRateLimitOverrideDto": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string",
            "description": "Organization the override applies to."
          },
          "requestsPerWindowOverride": {
            "type": "number",
            "description": "Replaces the default sustained-rate parameter (bucket refill per minute).",
            "minimum": 1,
            "maximum": 1000000
          },
          "burstAllowanceOverride": {
            "type": "number",
            "description": "Replaces the default bucket capacity (burst allowance).",
            "minimum": 1,
            "maximum": 1000000
          },
          "reason": {
            "type": "string",
            "description": "Reason for the override. Every change is recorded with actor and reason.",
            "minLength": 1,
            "maxLength": 500
          }
        },
        "required": [
          "organizationId",
          "requestsPerWindowOverride",
          "burstAllowanceOverride",
          "reason"
        ]
      },
      "ResolveDisputeIntentDto": {
        "type": "object",
        "properties": {
          "resolution": {
            "type": "string",
            "description": "The resolution outcome: full release to the seller or full refund to the buyer. A split outcome, or any amount field, is refused with 422 — it needs a new contract deployment (BL-02). To pay in stages, use milestone groups.",
            "enum": [
              "REFUND_BUYER",
              "RELEASE_SELLER"
            ],
            "example": "RELEASE_SELLER"
          },
          "resolutionNote": {
            "type": "string",
            "description": "Operator rationale for the decision, stored for audit.",
            "maxLength": 2000,
            "example": "Evidence supports the buyer's claim; releasing refund."
          }
        },
        "required": [
          "resolution",
          "resolutionNote"
        ]
      },
      "StaffReconcileEscrowDto": {
        "type": "object",
        "properties": {}
      },
      "StaffRetryWebhookEventDto": {
        "type": "object",
        "properties": {}
      },
      "CreateDeletionRequestDto": {
        "type": "object",
        "properties": {}
      },
      "ResolvedImageDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "src": {
            "type": "string",
            "description": "The largest variant.",
            "example": "https://media.example.com/blog/…/1600.webp"
          },
          "srcset": {
            "type": "string",
            "description": "Every variant as `<url> <width>w`."
          },
          "width": {
            "type": "number",
            "example": 1600
          },
          "height": {
            "type": "number",
            "example": 900
          },
          "alt": {
            "type": "string",
            "description": "Alternative text, when the post supplies it."
          }
        },
        "required": [
          "id",
          "src",
          "srcset",
          "width",
          "height"
        ]
      },
      "BlogPostAlternateDto": {
        "type": "object",
        "properties": {
          "locale": {
            "type": "string",
            "enum": [
              "en",
              "es",
              "zh-Hans",
              "hi",
              "ar",
              "pt",
              "fr",
              "ru",
              "de",
              "ja",
              "uk",
              "tr"
            ]
          },
          "slug": {
            "type": "string",
            "example": "por-que-escrow-on-chain"
          }
        },
        "required": [
          "locale",
          "slug"
        ]
      },
      "BlogPostPublicDto": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "example": "why-escrow-on-chain"
          },
          "locale": {
            "type": "string",
            "enum": [
              "en",
              "es",
              "zh-Hans",
              "hi",
              "ar",
              "pt",
              "fr",
              "ru",
              "de",
              "ja",
              "uk",
              "tr"
            ],
            "description": "The language of this text. It differs from the requested `locale` when English was served as the fallback.",
            "example": "en"
          },
          "title": {
            "type": "string",
            "example": "Why escrow belongs on-chain"
          },
          "summary": {
            "type": "string",
            "example": "Funds held by a contract, not a company."
          },
          "authorDisplayName": {
            "type": "string",
            "example": "Dima"
          },
          "firstPublishedAt": {
            "type": "string",
            "example": "2026-10-20T09:00:00.000Z"
          },
          "contentUpdatedAt": {
            "type": "string",
            "description": "When the post was last edited after its first publication; null when never.",
            "nullable": true,
            "example": null
          },
          "coverImage": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/ResolvedImageDto"
              }
            ]
          },
          "body": {
            "type": "string",
            "description": "Markdown. Images are referenced as `image:<id>` and resolved through `images`."
          },
          "alternates": {
            "description": "Every published translation of this post, English first, for `hreflang` links.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BlogPostAlternateDto"
            }
          },
          "images": {
            "type": "object",
            "description": "Every image the body references, by id.",
            "additionalProperties": {
              "$ref": "#/components/schemas/ResolvedImageDto"
            }
          }
        },
        "required": [
          "slug",
          "locale",
          "title",
          "summary",
          "authorDisplayName",
          "firstPublishedAt",
          "contentUpdatedAt",
          "coverImage",
          "body",
          "alternates",
          "images"
        ]
      },
      "BlogPostRedirectDto": {
        "type": "object",
        "properties": {
          "redirectTo": {
            "type": "string",
            "description": "The current address of the post.",
            "example": "why-escrow-on-chain"
          }
        },
        "required": [
          "redirectTo"
        ]
      },
      "BlogPostSummaryDto": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "example": "why-escrow-on-chain"
          },
          "locale": {
            "type": "string",
            "enum": [
              "en",
              "es",
              "zh-Hans",
              "hi",
              "ar",
              "pt",
              "fr",
              "ru",
              "de",
              "ja",
              "uk",
              "tr"
            ],
            "description": "The language of this text. It differs from the requested `locale` when English was served as the fallback.",
            "example": "en"
          },
          "title": {
            "type": "string",
            "example": "Why escrow belongs on-chain"
          },
          "summary": {
            "type": "string",
            "example": "Funds held by a contract, not a company."
          },
          "authorDisplayName": {
            "type": "string",
            "example": "Dima"
          },
          "firstPublishedAt": {
            "type": "string",
            "example": "2026-10-20T09:00:00.000Z"
          },
          "contentUpdatedAt": {
            "type": "string",
            "description": "When the post was last edited after its first publication; null when never.",
            "nullable": true,
            "example": null
          },
          "coverImage": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/ResolvedImageDto"
              }
            ]
          }
        },
        "required": [
          "slug",
          "locale",
          "title",
          "summary",
          "authorDisplayName",
          "firstPublishedAt",
          "contentUpdatedAt",
          "coverImage"
        ]
      },
      "BlogPostPageDto": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BlogPostSummaryDto"
            }
          },
          "page": {
            "type": "number",
            "example": 1
          },
          "pageSize": {
            "type": "number",
            "example": 12
          },
          "total": {
            "type": "number",
            "example": 3
          }
        },
        "required": [
          "items",
          "page",
          "pageSize",
          "total"
        ]
      },
      "CreateBlogPostDto": {
        "type": "object",
        "properties": {}
      },
      "CreateBlogTranslationDto": {
        "type": "object",
        "properties": {}
      },
      "UpdateBlogTranslationDto": {
        "type": "object",
        "properties": {}
      },
      "BlogPostVersionDto": {
        "type": "object",
        "properties": {}
      },
      "CreatePlanDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Pro monthly",
            "maxLength": 120
          },
          "amount": {
            "type": "string",
            "description": "Atomic units per period, as a decimal string.",
            "example": "20000000"
          },
          "token": {
            "type": "string",
            "description": "Token symbol, e.g. USDC.",
            "example": "USDC"
          },
          "interval": {
            "type": "string",
            "enum": [
              "DAILY",
              "WEEKLY",
              "MONTHLY",
              "YEARLY"
            ],
            "example": "MONTHLY"
          },
          "trialDays": {
            "type": "number",
            "description": "Free trial in days, 0-90.",
            "example": 14,
            "minimum": 0,
            "maximum": 90
          },
          "chainId": {
            "type": "number",
            "description": "Chain id; defaults to the deployment chain.",
            "example": 84532
          }
        },
        "required": [
          "name",
          "amount",
          "token",
          "interval"
        ]
      },
      "PlanResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "pln_01J9Z8"
          },
          "name": {
            "type": "string"
          },
          "amount": {
            "type": "string",
            "example": "20000000"
          },
          "token": {
            "type": "string",
            "example": "USDC"
          },
          "interval": {
            "type": "string",
            "enum": [
              "DAILY",
              "WEEKLY",
              "MONTHLY",
              "YEARLY"
            ]
          },
          "trialDays": {
            "type": "number",
            "example": 0
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "ARCHIVED"
            ]
          },
          "chainId": {
            "type": "number",
            "example": 84532
          },
          "linkId": {
            "type": "string",
            "description": "Identifier of the reusable subscribe link (FR-013)."
          },
          "version": {
            "type": "number",
            "description": "Optimistic-lock version; send it as If-Match on edits.",
            "example": 1
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "amount",
          "token",
          "interval",
          "trialDays",
          "status",
          "chainId",
          "linkId",
          "version",
          "createdAt"
        ]
      },
      "PlanListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlanResponseDto"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "Cursor for the next page; null on the last page.",
            "nullable": true
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "UpdatePlanDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 120
          },
          "amount": {
            "type": "string",
            "description": "Atomic units per period.",
            "example": "25000000"
          },
          "interval": {
            "type": "string",
            "enum": [
              "DAILY",
              "WEEKLY",
              "MONTHLY",
              "YEARLY"
            ]
          },
          "trialDays": {
            "type": "number",
            "minimum": 0,
            "maximum": 90
          }
        }
      },
      "SubscriptionResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "sub_01J9Z9"
          },
          "planId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "SUBMITTED",
              "TRIALING",
              "ACTIVE",
              "PAST_DUE",
              "CANCELLED",
              "RECONCILIATION_REQUIRED"
            ]
          },
          "customerReference": {
            "type": "object"
          },
          "buyerWallet": {
            "type": "string"
          },
          "sellerWallet": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "amount": {
            "type": "string",
            "example": "20000000"
          },
          "feeBps": {
            "type": "number",
            "example": 100
          },
          "interval": {
            "type": "string",
            "enum": [
              "DAILY",
              "WEEKLY",
              "MONTHLY",
              "YEARLY"
            ]
          },
          "trialEnd": {
            "type": "object"
          },
          "graceSeconds": {
            "type": "number",
            "example": 604800
          },
          "anchor": {
            "type": "string"
          },
          "nextChargeAt": {
            "type": "object"
          },
          "paidThrough": {
            "type": "object"
          },
          "approvalPeriodsCovered": {
            "type": "object",
            "description": "Periods the buyer's allowance still covers across their subscriptions (a projection)."
          },
          "cancelReason": {
            "type": "string",
            "enum": [
              "BUYER",
              "MERCHANT",
              "NON_PAYMENT"
            ]
          },
          "cancelledAt": {
            "type": "object"
          },
          "chainId": {
            "type": "number",
            "example": 84532
          },
          "contractAddress": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "planId",
          "status",
          "buyerWallet",
          "sellerWallet",
          "token",
          "amount",
          "feeBps",
          "interval",
          "graceSeconds",
          "anchor",
          "chainId",
          "contractAddress",
          "createdAt"
        ]
      },
      "SubscriptionListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubscriptionResponseDto"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "Cursor for the next page; null on the last page.",
            "nullable": true
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      },
      "SubscriptionChargeDto": {
        "type": "object",
        "properties": {
          "periodIndex": {
            "type": "number",
            "example": 0
          },
          "periodStart": {
            "type": "string"
          },
          "periodEnd": {
            "type": "string"
          },
          "gross": {
            "type": "string",
            "example": "20000000"
          },
          "fee": {
            "type": "string",
            "example": "200000"
          },
          "net": {
            "type": "string",
            "example": "19800000"
          },
          "txHash": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "CONFIRMED",
              "REORGED"
            ]
          }
        },
        "required": [
          "periodIndex",
          "periodStart",
          "periodEnd",
          "gross",
          "fee",
          "net",
          "txHash",
          "state"
        ]
      },
      "SubscriptionChargeAttemptDto": {
        "type": "object",
        "properties": {
          "periodIndex": {
            "type": "number"
          },
          "attemptNumber": {
            "type": "number",
            "example": 1
          },
          "reason": {
            "type": "string",
            "enum": [
              "INSUFFICIENT_BALANCE",
              "INSUFFICIENT_ALLOWANCE",
              "TRANSFER_REJECTED",
              "CONTRACT_PAUSED"
            ]
          },
          "nextRetryAt": {
            "type": "object"
          },
          "final": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "periodIndex",
          "attemptNumber",
          "reason",
          "final",
          "createdAt"
        ]
      },
      "SubscriptionChargeRefundDto": {
        "type": "object",
        "properties": {
          "periodIndex": {
            "type": "number"
          },
          "amount": {
            "type": "string",
            "example": "5000000"
          },
          "totalRefunded": {
            "type": "string",
            "example": "5000000"
          },
          "txHash": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "CONFIRMED",
              "REORGED"
            ]
          }
        },
        "required": [
          "periodIndex",
          "amount",
          "totalRefunded",
          "txHash",
          "state"
        ]
      },
      "SubscriptionChargesResponseDto": {
        "type": "object",
        "properties": {
          "charges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubscriptionChargeDto"
            }
          },
          "attempts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubscriptionChargeAttemptDto"
            }
          },
          "refunds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubscriptionChargeRefundDto"
            }
          }
        },
        "required": [
          "charges",
          "attempts",
          "refunds"
        ]
      },
      "SubscriptionCancelAcceptedDto": {
        "type": "object",
        "properties": {
          "subscription": {
            "$ref": "#/components/schemas/SubscriptionResponseDto"
          },
          "path": {
            "type": "string",
            "description": "`keeper` when the platform submits a signed authorization; `seller_wallet` on a retired contract version, where the merchant cancels from their own wallet.",
            "enum": [
              "keeper",
              "seller_wallet"
            ]
          },
          "call": {
            "description": "Present for the `seller_wallet` path.",
            "allOf": [
              {
                "$ref": "#/components/schemas/TransactionRequestDto"
              }
            ]
          }
        },
        "required": [
          "subscription",
          "path"
        ]
      },
      "CreateSubscriptionCheckoutDto": {
        "type": "object",
        "properties": {
          "planId": {
            "type": "string",
            "example": "pln_01J9Z8"
          },
          "customerReference": {
            "type": "string",
            "description": "Your own customer reference, echoed on every read and webhook.",
            "maxLength": 255
          },
          "successUrl": {
            "type": "string",
            "description": "Where the buyer may continue to; must match a configured return URL."
          },
          "sellerWalletId": {
            "type": "string",
            "description": "A verified seller wallet to be paid; defaults to the organization default."
          }
        },
        "required": [
          "planId"
        ]
      },
      "SubscriptionCheckoutResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "description": "Hosted checkout URL to send the buyer to."
          },
          "expiresAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "url",
          "expiresAt"
        ]
      },
      "SubscriptionSummaryDto": {
        "type": "object",
        "properties": {
          "activeCount": {
            "type": "number",
            "example": 42
          },
          "upcomingCollectionsAmount": {
            "type": "string",
            "description": "Atomic units due in the next 30 days.",
            "example": "840000000"
          },
          "upcomingCollectionsCount": {
            "type": "number",
            "example": 40
          },
          "failedChargesLast30Days": {
            "type": "number",
            "description": "Failed attempts in the last 30 days.",
            "example": 3
          }
        },
        "required": [
          "activeCount",
          "upcomingCollectionsAmount",
          "upcomingCollectionsCount",
          "failedChargesLast30Days"
        ]
      },
      "SubscribeSessionResponseDto": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "merchantName": {
            "type": "string",
            "description": "Merchant display name shown in the authorization statement."
          },
          "plan": {
            "$ref": "#/components/schemas/PlanResponseDto"
          },
          "feeBps": {
            "type": "number",
            "description": "Fee in basis points, snapshotted at session creation.",
            "example": 100
          },
          "graceSeconds": {
            "type": "number",
            "description": "Grace window in seconds, snapshotted into the signed terms.",
            "example": 604800
          },
          "firstChargeAt": {
            "type": "string",
            "description": "When the first charge happens: now, or the end of the trial."
          },
          "expiresAt": {
            "type": "string"
          },
          "contractAddress": {
            "type": "string",
            "description": "Contract the buyer approves and subscribes on."
          },
          "existingSubscriptionId": {
            "type": "object",
            "description": "Set when a `wallet` query is given and it already has an active subscription to this plan."
          },
          "subscriptionId": {
            "type": "object",
            "description": "Present after the buyer starts: the subscription this session created."
          },
          "status": {
            "type": "object"
          },
          "nextChargeAt": {
            "type": "object",
            "description": "When the next charge happens (ISO 8601). Present once the subscription is ACTIVE or TRIALING."
          },
          "successUrl": {
            "type": "object"
          }
        },
        "required": [
          "sessionId",
          "merchantName",
          "plan",
          "feeBps",
          "graceSeconds",
          "firstChargeAt",
          "expiresAt",
          "contractAddress"
        ]
      },
      "SubscribeIntentDto": {
        "type": "object",
        "properties": {
          "wallet": {
            "type": "string",
            "description": "The buyer wallet."
          },
          "periods": {
            "type": "number",
            "description": "Periods the approval covers, at least 1. The approval adds to the current allowance and is never unlimited.",
            "example": 12,
            "minimum": 1,
            "maximum": 120
          }
        },
        "required": [
          "wallet",
          "periods"
        ]
      },
      "SubscribeIntentResponseDto": {
        "type": "object",
        "properties": {
          "subscriptionId": {
            "type": "string"
          },
          "onChainId": {
            "type": "string",
            "description": "bytes32 id used on chain."
          },
          "approvalTotal": {
            "type": "string",
            "description": "Atomic units the approval will total after the new approve.",
            "example": "240000000"
          },
          "calls": {
            "description": "approve(0) when the token needs it, approve, then subscribe.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransactionRequestDto"
            }
          }
        },
        "required": [
          "subscriptionId",
          "onChainId",
          "approvalTotal",
          "calls"
        ]
      },
      "SubscribeTransactionHintDto": {
        "type": "object",
        "properties": {
          "txHash": {
            "type": "string",
            "example": "0xabababababababababababababababababababababababababababababababab"
          }
        },
        "required": [
          "txHash"
        ]
      },
      "SubscriptionWalletIntentDto": {
        "type": "object",
        "properties": {
          "wallet": {
            "type": "string"
          }
        },
        "required": [
          "wallet"
        ]
      },
      "SubscriptionCallsResponseDto": {
        "type": "object",
        "properties": {
          "calls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransactionRequestDto"
            }
          }
        },
        "required": [
          "calls"
        ]
      },
      "ReapproveIntentDto": {
        "type": "object",
        "properties": {
          "wallet": {
            "type": "string"
          },
          "periods": {
            "type": "number",
            "minimum": 1,
            "maximum": 120,
            "example": 12
          }
        },
        "required": [
          "wallet",
          "periods"
        ]
      },
      "ChargeRefundIntentDto": {
        "type": "object",
        "properties": {
          "wallet": {
            "type": "string"
          },
          "amount": {
            "type": "string",
            "description": "Atomic units to return, at most the period's gross minus what is already refunded.",
            "example": "5000000"
          }
        },
        "required": [
          "wallet",
          "amount"
        ]
      },
      "BuyerNonceRequestDto": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string"
          }
        },
        "required": [
          "address"
        ]
      },
      "BuyerNonceResponseDto": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          }
        },
        "required": [
          "message",
          "expiresAt"
        ]
      },
      "BuyerSessionRequestDto": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "signature": {
            "type": "string"
          }
        },
        "required": [
          "message",
          "signature"
        ]
      },
      "BuyerSessionResponseDto": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          }
        },
        "required": [
          "address",
          "expiresAt"
        ]
      },
      "BuyerSubscriptionDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "merchantName": {
            "type": "string",
            "description": "Merchant display name."
          },
          "planName": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "SUBMITTED",
              "TRIALING",
              "ACTIVE",
              "PAST_DUE",
              "CANCELLED",
              "RECONCILIATION_REQUIRED"
            ]
          },
          "amount": {
            "type": "string",
            "example": "20000000"
          },
          "token": {
            "type": "string"
          },
          "interval": {
            "type": "string",
            "enum": [
              "DAILY",
              "WEEKLY",
              "MONTHLY",
              "YEARLY"
            ]
          },
          "nextChargeAt": {
            "type": "object"
          },
          "paidThrough": {
            "type": "object"
          },
          "pastDueReason": {
            "type": "string",
            "enum": [
              "INSUFFICIENT_BALANCE",
              "INSUFFICIENT_ALLOWANCE",
              "TRANSFER_REJECTED",
              "CONTRACT_PAUSED"
            ],
            "description": "Latest failed attempt while Past due."
          },
          "nextRetryAt": {
            "type": "object",
            "description": "When the platform will try again while Past due."
          },
          "approvalPeriodsCovered": {
            "type": "object"
          },
          "contractAddress": {
            "type": "string"
          },
          "chainId": {
            "type": "number"
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "merchantName",
          "planName",
          "status",
          "amount",
          "token",
          "interval",
          "contractAddress",
          "chainId",
          "createdAt"
        ]
      },
      "BuyerSubscriptionListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BuyerSubscriptionDto"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "Cursor for the next page; null on the last page.",
            "nullable": true
          }
        },
        "required": [
          "data",
          "nextCursor"
        ]
      }
    }
  }
}
