{
  "openapi": "3.1.0",
  "info": {
    "title": "OpenSteward",
    "version": "1.0.0",
    "license": {
      "name": "Elastic-2.0",
      "url": "https://github.com/open-steward/opensteward/blob/main/LICENSE"
    },
    "contact": {
      "name": "OpenSteward",
      "url": "https://github.com/open-steward/opensteward"
    },
    "description": "Self-hosted integration aggregator. One REST API across nine verticals:\naccounting, CRM, e-commerce, logistics, payments, docsign, projects,\ncustomer-support, and inventory platforms.\n\n## Null semantics\n\nThis API is an **aggregation boundary**: it normalises data from many upstream platforms but doesn't own most of the content. To preserve full information, **`null`, key-omitted, and a value (including `\"\"` or `0`) are three distinct facts**:\n\n- **Key omitted** — upstream did not supply this field. The adapter mapped no equivalent value.\n- **`null`** — upstream explicitly returned null / cleared / not reported.\n- **Value** (`\"\"`, `0`, or any other) — upstream supplied exactly that value.\n\nAdapters never coerce missing → `0` or `0` → `null`. If a canonical field is absent from a response, the upstream platform did not provide an equivalent value. The verbatim upstream payload is preserved on every top-level canonical resource — under `raw` for payments, docsign, projects, customer-support and inventory, and under `metadata` for accounting, CRM, ecommerce and logistics — so the original platform representation is recoverable. **Two verticals are opt-in.** On payments and accounting the payload is withheld unless the operator enables `data_store.raw_payload.payments` / `data_store.raw_payload.accounting`, because across those adapters it declares bank account numbers, IBANs and card numbers the canonical schema deliberately does not expose. Card security codes are never returned, on any setting. Monetary amounts are integer minor units (e.g. cents) — never floats — and follow the same three-state rule (`null` = not reported, `0` = reported as zero, key-omitted = no equivalent).\n\nStatus, type, and category enums always include an explicit `\"unknown\"` member for upstream values the adapter could not map onto the normalized set — they are surfaced rather than silently dropped.\n\n## Authentication — three schemes\n\nThe spec exposes **three security schemes** (`ApiKeyAuth`, `OAuth2Bearer` and `AdminSecret`). The first two are interchangeable developer credentials for `/v1/*`; the third is the operator path. Pick by what you are.\n\n### 1. `ApiKeyAuth` — Bearer dev key (`/v1/*`, `/connect/*`)\n\nTenant-scoped developer key minted from `Admin → API keys → Mint key` in the admin UI, or the `mint-api-key` CLI. Send as:\n\n```\nAuthorization: Bearer osk_<tenant>_<random>\n```\n\nEach key carries a list of scopes. Vertical access uses a **two-axis model**: `vertical:<v>` (or `vertical:read`) for the *touch* axis, and `vertical:write` as a separate gate for any non-GET on `/v1/{vertical}/*`. The default mint preset (the recommended \"Safe default\" radio) checks every scope **except** `vertical:write`, so a freshly minted key reads everywhere but cannot push writes back to upstream platforms — important for self-hosted operators who carry regulatory liability for what gets written upstream. See [/guides/dev-api.md §3](https://docs.opensteward.dev/dev-api/#3-scopes) for the full scope table, examples, and a 403 response shape.\n\nEvery `/v1/*` resource request additionally requires `connection_id` (UUID) as a query parameter. The connection row carries its own `vertical`, `platform`, and OAuth credentials.\n\nConnections are created by completing the OAuth flow at `/auth/{vertical}/{platform}/connect` (admin-tooling) or by sending an end-user a hosted Connect Link from `POST /v1/customers/{id}/connect-links`.\n\n### 2. `OAuth2Bearer` — OIDC bearer token (`/v1/*`)\n\nAn alternative to the static key on exactly the same routes, for deployments whose service accounts already live in an identity provider. The operator registers an issuer (Keycloak, Auth0, Okta and Entra ID ship as presets; any issuer with an OpenID discovery document works), and a developer presents a token from it:\n\n```\nAuthorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6…\n```\n\nOpenSteward is only a resource server here: it verifies against the issuer's published public keys and never mints a token or holds a client secret. The token resolves to the **same scope vocabulary** as a dev key, so every scope rule above applies unchanged — a route needing `vertical:write` needs it identically.\n\nOff by default. A JWT sent to a deployment that has not enabled it answers `403 OAUTH_DISABLED`; an `osk_` key sent to a deployment where the operator has turned keys off answers `403 API_KEYS_DISABLED`. Verification failures all answer `401 UNAUTHENTICATED` with one body, so the response cannot be used to enumerate the operator's service accounts.\n\n### 3. `AdminSecret` — `X-Admin-Secret` header (`/admin/*`, `DELETE /auth/.../{connectionId}`)\n\nOperator-only secret used for **bootstrap and inter-service auth**. Set via the `ADMIN_SECRET` env var on the integration-server. Routes that take it: platform enable/disable/config (`/admin/platforms/*`), cross-tenant connection inspection (`/admin/connections*`), single-connection revoke under `/auth/{vertical}/{platform}/{connectionId}` (DELETE), and the operator sync-jobs surface (`/admin/sync-jobs*`).\n\nSend as `X-Admin-Secret: <value>`. **Never give this to an external integrator** — it spans every tenant and bypasses the scope system. Day-2 operator actions on `/v1/connections*` should already be done with a tenant-scoped Bearer dev key (`connections:write` scope).\n\n> Why a separate scheme rather than a \"super scope\" on a dev key? Bootstrap. The very first API call to a fresh deployment happens before any user, JWT, or developer key exists; `ADMIN_SECRET` is the single env-var that makes the integration-server reachable from admin-api during boot."
  },
  "servers": [
    {
      "url": "{scheme}://{host}:{port}/{version}",
      "description": "OpenSteward deployment",
      "variables": {
        "scheme": {
          "default": "http",
          "enum": [
            "http",
            "https"
          ],
          "description": "HTTP scheme — http for local dev, https for deployed."
        },
        "host": {
          "default": "localhost",
          "enum": [
            "localhost"
          ],
          "description": "Hostname of the deployment (no port)."
        },
        "port": {
          "default": "3010",
          "enum": [
            "3010"
          ],
          "description": "Port as a string. Use \"443\" for https, \"80\" for http."
        },
        "version": {
          "default": "v1",
          "enum": [
            "v1"
          ],
          "description": "URL-path API version. New entries land here when /v2/* ships."
        }
      }
    },
    {
      "url": "{scheme}://{host}:{port}/test/{version}",
      "description": "OpenSteward sandbox (test mode) — synthetic data, no upstream calls",
      "variables": {
        "scheme": {
          "default": "http",
          "enum": [
            "http",
            "https"
          ],
          "description": "HTTP scheme — http for local dev, https for deployed."
        },
        "host": {
          "default": "localhost",
          "enum": [
            "localhost"
          ],
          "description": "Hostname of the deployment (no port)."
        },
        "port": {
          "default": "3010",
          "enum": [
            "3010"
          ],
          "description": "Port as a string. Use \"443\" for https, \"80\" for http."
        },
        "version": {
          "default": "v1",
          "enum": [
            "v1"
          ],
          "description": "URL-path API version. New entries land here when /v2/* ships."
        }
      }
    }
  ],
  "paths": {
    "/accounting/organizations": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "Get organisation",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingOrganization"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listOrganizations"
      }
    },
    "/accounting/invoices": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "List invoices",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AccountingInvoice"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "xero",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listInvoices"
      },
      "post": {
        "tags": [
          "Accounting"
        ],
        "summary": "Create invoice",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountingInvoice"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingInvoice"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1accounting~1invoices~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "ReplaceById": {
                "operationRef": "#/paths/~1v1~1accounting~1invoices~1{id}/put",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Replace this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1v1~1accounting~1invoices~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "createInvoice"
      }
    },
    "/accounting/invoices/{id}": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "Get invoice",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingInvoice"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                },
                "examples": {
                  "paid": {
                    "summary": "Paid in full — balance zero",
                    "value": {
                      "data": {
                        "id": "inv_1042",
                        "type": "INVOICE",
                        "invoiceNumber": "INV-1042",
                        "contactId": "cus_4Qm2Xa9Lr",
                        "currency": "USD",
                        "totalAmount": 125000,
                        "taxAmount": 10000,
                        "discountAmount": 0,
                        "reference": "PO-ACME-2026",
                        "notes": "Thank you for your business, Acme Industries.",
                        "url": "https://app.acme.example/invoices/INV-1042",
                        "postedAt": "2026-02-01T00:00:00Z",
                        "createdAt": "2026-01-15T09:30:00Z",
                        "updatedAt": "2026-02-01T14:20:00Z",
                        "status": "PAID",
                        "paidAmount": 125000,
                        "balanceAmount": 0,
                        "refundAmount": 0,
                        "dueAt": "2026-03-03T00:00:00Z",
                        "paidAt": "2026-02-20T00:00:00Z"
                      },
                      "meta": {
                        "platform": "xero",
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  },
                  "overdue": {
                    "summary": "Overdue — unpaid past the due date",
                    "value": {
                      "data": {
                        "id": "inv_1042",
                        "type": "INVOICE",
                        "invoiceNumber": "INV-1042",
                        "contactId": "cus_4Qm2Xa9Lr",
                        "currency": "USD",
                        "totalAmount": 125000,
                        "taxAmount": 10000,
                        "discountAmount": 0,
                        "reference": "PO-ACME-2026",
                        "notes": "Thank you for your business, Acme Industries.",
                        "url": "https://app.acme.example/invoices/INV-1042",
                        "postedAt": "2026-02-01T00:00:00Z",
                        "createdAt": "2026-01-15T09:30:00Z",
                        "updatedAt": "2026-02-01T14:20:00Z",
                        "status": "OVERDUE",
                        "paidAmount": 0,
                        "balanceAmount": 125000,
                        "refundAmount": 0,
                        "dueAt": "2026-03-03T00:00:00Z"
                      },
                      "meta": {
                        "platform": "xero",
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  },
                  "draft": {
                    "summary": "Draft — not yet issued to the customer",
                    "value": {
                      "data": {
                        "id": "inv_1042",
                        "type": "INVOICE",
                        "invoiceNumber": "INV-1042",
                        "contactId": "cus_4Qm2Xa9Lr",
                        "currency": "USD",
                        "totalAmount": 125000,
                        "taxAmount": 10000,
                        "discountAmount": 0,
                        "reference": "PO-ACME-2026",
                        "notes": "Thank you for your business, Acme Industries.",
                        "url": "https://app.acme.example/invoices/INV-1042",
                        "postedAt": "2026-02-01T00:00:00Z",
                        "createdAt": "2026-01-15T09:30:00Z",
                        "updatedAt": "2026-02-01T14:20:00Z",
                        "status": "DRAFT",
                        "paidAmount": 0,
                        "balanceAmount": 125000,
                        "refundAmount": 0
                      },
                      "meta": {
                        "platform": "xero",
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getInvoiceById"
      },
      "put": {
        "tags": [
          "Accounting"
        ],
        "summary": "Update invoice",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountingInvoice"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingInvoice"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "updateInvoice"
      },
      "delete": {
        "tags": [
          "Accounting"
        ],
        "summary": "Delete invoice",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted — no body",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "deleteInvoice"
      }
    },
    "/accounting/bills": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "List bills",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AccountingBill"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "xero",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listBills"
      },
      "post": {
        "tags": [
          "Accounting"
        ],
        "summary": "Create bill",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountingBill"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingBill"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1accounting~1bills~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "ReplaceById": {
                "operationRef": "#/paths/~1v1~1accounting~1bills~1{id}/put",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Replace this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1v1~1accounting~1bills~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "createBill"
      }
    },
    "/accounting/bills/{id}": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "Get bill",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingBill"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getBillById"
      },
      "put": {
        "tags": [
          "Accounting"
        ],
        "summary": "Update bill",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountingBill"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingBill"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "updateBill"
      },
      "delete": {
        "tags": [
          "Accounting"
        ],
        "summary": "Delete bill",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted — no body",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "deleteBill"
      }
    },
    "/accounting/contacts": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "List contacts",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AccountingContact"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "xero",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listContacts"
      },
      "post": {
        "tags": [
          "Accounting"
        ],
        "summary": "Create contact",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountingContact"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingContact"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1accounting~1contacts~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "ReplaceById": {
                "operationRef": "#/paths/~1v1~1accounting~1contacts~1{id}/put",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Replace this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1v1~1accounting~1contacts~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "createContact"
      }
    },
    "/accounting/contacts/{id}": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "Get contact",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingContact"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getContactById"
      },
      "put": {
        "tags": [
          "Accounting"
        ],
        "summary": "Update contact",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountingContact"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingContact"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "updateContact"
      },
      "delete": {
        "tags": [
          "Accounting"
        ],
        "summary": "Delete contact",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted — no body",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "deleteContact"
      }
    },
    "/accounting/accounts": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "List accounts",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AccountingAccount"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "xero",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listAccounts"
      }
    },
    "/accounting/accounts/{id}": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "Get account",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingAccount"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getAccountById"
      }
    },
    "/accounting/journals": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "List journals",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AccountingJournal"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "xero",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listJournals"
      },
      "post": {
        "tags": [
          "Accounting"
        ],
        "summary": "Create journal",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountingJournal"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingJournal"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1accounting~1journals~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "createJournal"
      }
    },
    "/accounting/journals/{id}": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "Get journal",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingJournal"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getJournalById"
      }
    },
    "/accounting/transactions": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "List transactions",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AccountingTransaction"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "xero",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listTransactions"
      }
    },
    "/accounting/transactions/{id}": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "Get transaction",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingTransaction"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getTransactionById"
      }
    },
    "/accounting/taxrates": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "List tax rates",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AccountingTaxRate"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "xero",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listTaxrates"
      }
    },
    "/accounting/taxrates/{id}": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "Get tax rate",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingTaxRate"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getTaxrateById"
      }
    },
    "/accounting/expenses": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "List expenses",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AccountingExpense"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "xero",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listExpenses"
      },
      "post": {
        "tags": [
          "Accounting"
        ],
        "summary": "Create expense",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountingExpense"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingExpense"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1accounting~1expenses~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "createExpense"
      }
    },
    "/accounting/expenses/{id}": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "Get expense",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingExpense"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getExpenseById"
      }
    },
    "/accounting/creditmemos": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "List credit memos",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AccountingCreditMemo"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "xero",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listCreditmemos"
      },
      "post": {
        "tags": [
          "Accounting"
        ],
        "summary": "Create credit memo",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountingCreditMemo"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingCreditMemo"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1accounting~1creditmemos~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "createCreditmemo"
      }
    },
    "/accounting/quotes": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "List quotes",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AccountingQuote"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "xero",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listQuotes"
      }
    },
    "/accounting/quotes/{id}": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "Get quote",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingQuote"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getQuoteById"
      }
    },
    "/accounting/creditmemos/{id}": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "Get credit memo",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingCreditMemo"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getCreditmemoById"
      }
    },
    "/accounting/orders": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "List orders",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AccountingOrder"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "xero",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listOrders"
      },
      "post": {
        "tags": [
          "Accounting"
        ],
        "summary": "Create order",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountingOrder"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingOrder"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1accounting~1orders~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "createOrder"
      }
    },
    "/accounting/orders/{id}": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "Get order",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingOrder"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getOrderById"
      }
    },
    "/accounting/salesorders": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "List sales orders",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AccountingSalesOrder"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "xero",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listSalesorders"
      },
      "post": {
        "tags": [
          "Accounting"
        ],
        "summary": "Create sales order",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountingSalesOrder"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingSalesOrder"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1accounting~1salesorders~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "createSalesorder"
      }
    },
    "/accounting/salesorders/{id}": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "Get sales order",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingSalesOrder"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getSalesorderById"
      }
    },
    "/accounting/purchaseorders": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "List purchase orders",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AccountingPurchaseOrder"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "xero",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listPurchaseorders"
      },
      "post": {
        "tags": [
          "Accounting"
        ],
        "summary": "Create purchase order",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountingPurchaseOrder"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingPurchaseOrder"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1accounting~1purchaseorders~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "createPurchaseorder"
      }
    },
    "/accounting/purchaseorders/{id}": {
      "get": {
        "tags": [
          "Accounting"
        ],
        "summary": "Get purchase order",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AccountingPurchaseOrder"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getPurchaseorderById"
      }
    },
    "/health": {
      "get": {
        "tags": [
          "Platform"
        ],
        "summary": "Service health",
        "description": "Returns service status, the registered verticals, and the total enabled-adapter count.",
        "security": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "verticals",
                    "adapters",
                    "timestamp"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    },
                    "verticals": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "adapters": {
                      "type": "integer"
                    },
                    "timestamp": {
                      "$ref": "#/components/schemas/ISO8601"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/crm/contacts": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "List contacts",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CRMContact"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "hubspot",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listContacts"
      },
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Create contact",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CRMContact"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CRMContact"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1crm~1contacts~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "UpdateById": {
                "operationRef": "#/paths/~1v1~1crm~1contacts~1{id}/patch",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Update this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1v1~1crm~1contacts~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "createContact"
      }
    },
    "/crm/contacts/{id}": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Get contact",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CRMContact"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getContactById"
      },
      "patch": {
        "tags": [
          "CRM"
        ],
        "summary": "Update contact",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CRMContact"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CRMContact"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "updateContact"
      },
      "delete": {
        "tags": [
          "CRM"
        ],
        "summary": "Delete contact",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted — no body",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "deleteContact"
      }
    },
    "/crm/companies": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "List companies",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CRMCompany"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "hubspot",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listCompanies"
      },
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Create company",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CRMCompany"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CRMCompany"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1crm~1companies~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "UpdateById": {
                "operationRef": "#/paths/~1v1~1crm~1companies~1{id}/patch",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Update this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1v1~1crm~1companies~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "createCompany"
      }
    },
    "/crm/companies/{id}": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Get company",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CRMCompany"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getCompanyById"
      },
      "patch": {
        "tags": [
          "CRM"
        ],
        "summary": "Update company",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CRMCompany"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CRMCompany"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "updateCompany"
      },
      "delete": {
        "tags": [
          "CRM"
        ],
        "summary": "Delete company",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted — no body",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "deleteCompany"
      }
    },
    "/crm/deals": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "List deals",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CRMDeal"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "hubspot",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listDeals"
      },
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Create deal",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CRMDeal"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CRMDeal"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1crm~1deals~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "UpdateById": {
                "operationRef": "#/paths/~1v1~1crm~1deals~1{id}/patch",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Update this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1v1~1crm~1deals~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "createDeal"
      }
    },
    "/crm/deals/{id}": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Get deal",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CRMDeal"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getDealById"
      },
      "patch": {
        "tags": [
          "CRM"
        ],
        "summary": "Update deal",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CRMDeal"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CRMDeal"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "updateDeal"
      },
      "delete": {
        "tags": [
          "CRM"
        ],
        "summary": "Delete deal",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted — no body",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "deleteDeal"
      }
    },
    "/crm/pipelines": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "List pipelines",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CRMPipeline"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "hubspot",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listPipelines"
      }
    },
    "/crm/pipelines/{id}": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Get pipeline",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CRMPipeline"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getPipelineById"
      }
    },
    "/crm/activities": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "List activities",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CRMActivity"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "hubspot",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listActivities"
      },
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Create activity",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CRMActivity"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CRMActivity"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1crm~1activities~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "UpdateById": {
                "operationRef": "#/paths/~1v1~1crm~1activities~1{id}/patch",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Update this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1v1~1crm~1activities~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "createActivity"
      }
    },
    "/crm/activities/{id}": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Get activity",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CRMActivity"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getActivityById"
      },
      "patch": {
        "tags": [
          "CRM"
        ],
        "summary": "Update activity",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CRMActivity"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CRMActivity"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "updateActivity"
      },
      "delete": {
        "tags": [
          "CRM"
        ],
        "summary": "Delete activity",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted — no body",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "deleteActivity"
      }
    },
    "/crm/notes": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "List notes",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CRMNote"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "hubspot",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listNotes"
      },
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Create note",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CRMNote"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CRMNote"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1crm~1notes~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "UpdateById": {
                "operationRef": "#/paths/~1v1~1crm~1notes~1{id}/patch",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Update this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1v1~1crm~1notes~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "createNote"
      }
    },
    "/crm/notes/{id}": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Get note",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IsLiveParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CRMNote"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getNoteById"
      },
      "patch": {
        "tags": [
          "CRM"
        ],
        "summary": "Update note",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CRMNote"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CRMNote"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "updateNote"
      },
      "delete": {
        "tags": [
          "CRM"
        ],
        "summary": "Delete note",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted — no body",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "deleteNote"
      }
    },
    "/ecommerce/products": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "listProducts",
        "summary": "List products",
        "description": "Returns all products visible to the authenticated connection. Supports incremental sync via `updated_after` and platform-native pagination (cursor or offset).",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EcommerceProductSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "post": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "createProduct",
        "summary": "Create product",
        "description": "Creates a new product on the target platform. Not all platforms expose product creation — returns `501` for unsupported adapters.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcommerceProductSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceProductSchema"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1ecommerce~1products~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "UpdateById": {
                "operationRef": "#/paths/~1v1~1ecommerce~1products~1{id}/patch",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Update this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1v1~1ecommerce~1products~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/products/{id}": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "getProductById",
        "summary": "Get product",
        "description": "Fetches a single product by its platform-specific ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceProductSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "patch": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "updateProduct",
        "summary": "Update product",
        "description": "Partially updates a product. Only fields present in the request body are modified. Returns `501` for adapters without write support.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcommerceProductSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceProductSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "delete": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "deleteProduct",
        "summary": "Delete product",
        "description": "Deletes a product by ID. Many platforms soft-delete or archive instead of hard-deleting; consult the adapter docs for semantics.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted — no body",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/variants": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "listVariants",
        "summary": "List product variants",
        "description": "Returns variants across all products. Some platforms nest variants inside products — for those adapters this endpoint lists variants lazily and returns `501` if unsupported.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EcommerceProductVariantSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "post": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "createVariant",
        "summary": "Create product variant",
        "description": "Creates a new variant on an existing product. The request body must include the parent `productId`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcommerceProductVariantSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceProductVariantSchema"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1ecommerce~1variants~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "UpdateById": {
                "operationRef": "#/paths/~1v1~1ecommerce~1variants~1{id}/patch",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Update this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1v1~1ecommerce~1variants~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/variants/{id}": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "getVariantById",
        "summary": "Get variant",
        "description": "Fetches a single product variant by its platform-specific ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceProductVariantSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "patch": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "updateVariant",
        "summary": "Update product variant",
        "description": "Partially updates a variant. Only fields present in the body are modified.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcommerceProductVariantSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceProductVariantSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "delete": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "deleteVariant",
        "summary": "Delete product variant",
        "description": "Deletes a variant by ID. Some platforms reject deleting the last variant of a product.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted — no body",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/collections": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "listCollections",
        "summary": "List collections",
        "description": "Returns all collections (also known as categories or taxonomies on some platforms).",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EcommerceCollectionSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "post": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "createCollection",
        "summary": "Create collection",
        "description": "Creates a new collection. Returns `501` for adapters without write support.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcommerceCollectionSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceCollectionSchema"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1ecommerce~1collections~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "UpdateById": {
                "operationRef": "#/paths/~1v1~1ecommerce~1collections~1{id}/patch",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Update this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1v1~1ecommerce~1collections~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/collections/{id}": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "getCollectionById",
        "summary": "Get collection",
        "description": "Fetches a single collection by ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceCollectionSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "patch": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "updateCollection",
        "summary": "Update collection",
        "description": "Partially updates a collection.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcommerceCollectionSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceCollectionSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "delete": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "deleteCollection",
        "summary": "Delete collection",
        "description": "Deletes a collection by ID. Product memberships are typically removed but the products themselves are preserved.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted — no body",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/locations": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "listLocations",
        "summary": "List locations",
        "description": "Returns all inventory locations / warehouses configured on the platform. Single-location platforms return a single synthetic entry.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EcommerceLocationSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/locations/{id}": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "getLocationById",
        "summary": "Get location",
        "description": "Fetches a single location by ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceLocationSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/inventory_levels": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "listInventoryLevels",
        "summary": "List inventory levels",
        "description": "Returns per-variant / per-location inventory quantities. Filter with `variantId` or `locationId` query parameters when supported by the adapter.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EcommerceInventoryLevelSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/inventory_levels/{id}": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "getInventoryLevelById",
        "summary": "Get inventory level",
        "description": "Fetches a single inventory level. The `id` is typically a composite of `variantId:locationId` for platforms without first-class inventory IDs.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceInventoryLevelSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/inventory_levels/adjust": {
      "post": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "adjustInventoryLevel",
        "summary": "Adjust inventory level",
        "description": "Applies a signed delta to the current available quantity for a given variant at a given location. Positive delta adds stock, negative subtracts. Returns `501` for read-only adapters.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcommerceInventoryAdjustRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Adjusted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceInventoryLevelSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/inventory_levels/set": {
      "post": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "setInventoryLevel",
        "summary": "Set inventory level",
        "description": "Sets the absolute available quantity for a given variant at a given location. Prefer `/adjust` where possible to avoid race conditions between multiple writers.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcommerceInventorySetRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Set",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceInventoryLevelSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/customers": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "listCustomers",
        "summary": "List customers",
        "description": "Returns customers visible to the authenticated connection. Supports incremental sync via `updated_after`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EcommerceCustomerSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "post": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "createCustomer",
        "summary": "Create customer",
        "description": "Creates a new customer record. Adapters that do not expose customer creation return `501`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcommerceCustomerSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceCustomerSchema"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1ecommerce~1customers~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "UpdateById": {
                "operationRef": "#/paths/~1v1~1ecommerce~1customers~1{id}/patch",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Update this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1v1~1ecommerce~1customers~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/customers/{id}": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "getCustomerById",
        "summary": "Get customer",
        "description": "Fetches a single customer by ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceCustomerSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "patch": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "updateCustomer",
        "summary": "Update customer",
        "description": "Partially updates a customer record.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcommerceCustomerSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceCustomerSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "delete": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "deleteCustomer",
        "summary": "Delete customer",
        "description": "Deletes a customer by ID. Many platforms anonymise rather than hard-delete for compliance reasons.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted — no body",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/orders": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "listOrders",
        "summary": "List orders",
        "description": "Returns all orders (historical + open). Use `updated_after` for efficient incremental sync.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EcommerceOrderSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "post": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "createOrder",
        "summary": "Create order",
        "description": "Creates a new draft or confirmed order. Most headless platforms support this; storefront-only platforms return `501`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcommerceOrderSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceOrderSchema"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1ecommerce~1orders~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "UpdateById": {
                "operationRef": "#/paths/~1v1~1ecommerce~1orders~1{id}/patch",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Update this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/orders/{id}": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "getOrderById",
        "summary": "Get order",
        "description": "Fetches a single order including line items, fulfillments, and refunds.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceOrderSchema"
                    }
                  }
                },
                "examples": {
                  "fulfilled": {
                    "summary": "Fulfilled — paid and shipped",
                    "value": {
                      "data": {
                        "id": "ord_1042",
                        "orderNumber": "#1042",
                        "name": "#1042",
                        "customerId": "cus_4Qm2Xa9Lr",
                        "email": "jane.doe@acme.example",
                        "phone": "+14155550123",
                        "currency": "USD",
                        "subtotalPrice": {
                          "amount": 7999,
                          "currency": "USD"
                        },
                        "totalTax": {
                          "amount": 700,
                          "currency": "USD"
                        },
                        "totalDiscounts": {
                          "amount": 800,
                          "currency": "USD"
                        },
                        "totalShipping": {
                          "amount": 0,
                          "currency": "USD"
                        },
                        "totalPrice": {
                          "amount": 7899,
                          "currency": "USD"
                        },
                        "financialStatus": "PAID",
                        "lineItems": [
                          {
                            "id": "li_1",
                            "productId": "prod_wk2026",
                            "variantId": "var_wk2026_blk",
                            "title": "Wireless Keyboard",
                            "quantity": 1,
                            "price": {
                              "amount": 7999,
                              "currency": "USD"
                            },
                            "sku": "WK-2026",
                            "fulfillableQuantity": 0,
                            "fulfillmentStatus": "FULFILLED",
                            "metadata": {
                              "lineItemPlatformId": "gid://shopify/LineItem/li_1"
                            }
                          }
                        ],
                        "transactionIds": [
                          "txn_1042"
                        ],
                        "discountCodes": [
                          "ACME10"
                        ],
                        "tags": [
                          "Ecommerce"
                        ],
                        "createdAt": "2026-01-15T09:30:00Z",
                        "updatedAt": "2026-02-01T14:20:00Z",
                        "processedAt": "2026-01-15T09:30:00Z",
                        "metadata": {
                          "orderPlatformId": "gid://shopify/Order/ord_1042"
                        },
                        "fulfillmentStatus": "FULFILLED",
                        "fulfillmentIds": [
                          "ful_1042"
                        ],
                        "refundIds": [],
                        "cancelledAt": null,
                        "cancelReason": null
                      }
                    }
                  },
                  "cancelled": {
                    "summary": "Cancelled — refunded and restocked",
                    "value": {
                      "data": {
                        "id": "ord_1042",
                        "orderNumber": "#1042",
                        "name": "#1042",
                        "customerId": "cus_4Qm2Xa9Lr",
                        "email": "jane.doe@acme.example",
                        "phone": "+14155550123",
                        "currency": "USD",
                        "subtotalPrice": {
                          "amount": 7999,
                          "currency": "USD"
                        },
                        "totalTax": {
                          "amount": 700,
                          "currency": "USD"
                        },
                        "totalDiscounts": {
                          "amount": 800,
                          "currency": "USD"
                        },
                        "totalShipping": {
                          "amount": 0,
                          "currency": "USD"
                        },
                        "totalPrice": {
                          "amount": 7899,
                          "currency": "USD"
                        },
                        "financialStatus": "REFUNDED",
                        "lineItems": [
                          {
                            "id": "li_1",
                            "productId": "prod_wk2026",
                            "variantId": "var_wk2026_blk",
                            "title": "Wireless Keyboard",
                            "quantity": 1,
                            "price": {
                              "amount": 7999,
                              "currency": "USD"
                            },
                            "sku": "WK-2026",
                            "fulfillableQuantity": 0,
                            "fulfillmentStatus": "FULFILLED",
                            "metadata": {
                              "lineItemPlatformId": "gid://shopify/LineItem/li_1"
                            }
                          }
                        ],
                        "transactionIds": [
                          "txn_1042"
                        ],
                        "discountCodes": [
                          "ACME10"
                        ],
                        "tags": [
                          "Ecommerce"
                        ],
                        "createdAt": "2026-01-15T09:30:00Z",
                        "updatedAt": "2026-02-01T14:20:00Z",
                        "processedAt": "2026-01-15T09:30:00Z",
                        "metadata": {
                          "orderPlatformId": "gid://shopify/Order/ord_1042"
                        },
                        "fulfillmentStatus": "RESTOCKED",
                        "fulfillmentIds": [],
                        "refundIds": [
                          "ref_1042"
                        ],
                        "cancelledAt": "2026-02-01T14:20:00Z",
                        "cancelReason": "customer"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "patch": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "updateOrder",
        "summary": "Update order",
        "description": "Partially updates an order. Many platforms restrict which fields are mutable after payment or fulfillment.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcommerceOrderSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceOrderSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/orders/{id}/cancel": {
      "post": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "cancelOrder",
        "summary": "Cancel order",
        "description": "Cancels an order. Some platforms reject cancellation of partially fulfilled orders; consult the adapter docs.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcommerceOrderCancelRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceOrderSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/fulfillments": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "listFulfillments",
        "summary": "List fulfillments",
        "description": "Returns fulfillments across orders. Some adapters expose fulfillments only via their parent order — those return `501` on this endpoint.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EcommerceFulfillmentSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "post": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "createFulfillment",
        "summary": "Create fulfillment",
        "description": "Creates a fulfillment for an existing order. The request body must include the parent `orderId` and the line items being fulfilled.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcommerceFulfillmentSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceFulfillmentSchema"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1ecommerce~1fulfillments~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "UpdateById": {
                "operationRef": "#/paths/~1v1~1ecommerce~1fulfillments~1{id}/patch",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Update this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/fulfillments/{id}": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "getFulfillmentById",
        "summary": "Get fulfillment",
        "description": "Fetches a single fulfillment by ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceFulfillmentSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "patch": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "updateFulfillment",
        "summary": "Update fulfillment",
        "description": "Partially updates a fulfillment — typically used to attach or update tracking information.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcommerceFulfillmentSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceFulfillmentSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/fulfillments/{id}/cancel": {
      "post": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "cancelFulfillment",
        "summary": "Cancel fulfillment",
        "description": "Cancels a fulfillment. Many platforms only allow cancellation of fulfillments that have not yet shipped.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceFulfillmentSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/refunds": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "listRefunds",
        "summary": "List refunds",
        "description": "Returns refunds across orders. Supports incremental sync via `updated_after`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EcommerceRefundSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "post": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "createRefund",
        "summary": "Create refund",
        "description": "Creates a refund against an order. The request body must include the parent `orderId` and the refunded line items / amount.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcommerceRefundSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceRefundSchema"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1ecommerce~1refunds~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/refunds/{id}": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "getRefundById",
        "summary": "Get refund",
        "description": "Fetches a single refund by ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceRefundSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/transactions": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "listTransactions",
        "summary": "List transactions",
        "description": "Returns payment transactions (authorisations, captures, voids, refunds) across orders.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EcommerceTransactionSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "post": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "createTransaction",
        "summary": "Create transaction",
        "description": "Records a new transaction against an order (e.g. a manual capture or external payment). Not all platforms expose this — returns `501` otherwise.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcommerceTransactionSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceTransactionSchema"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1ecommerce~1transactions~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/transactions/{id}": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "getTransactionById",
        "summary": "Get transaction",
        "description": "Fetches a single transaction by ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceTransactionSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/discounts": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "listDiscounts",
        "summary": "List discounts",
        "description": "Returns all discount codes and automatic discounts configured on the platform.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EcommerceDiscountSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "post": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "createDiscount",
        "summary": "Create discount",
        "description": "Creates a new discount. Returns `501` for adapters without write support.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcommerceDiscountSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceDiscountSchema"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1ecommerce~1discounts~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "UpdateById": {
                "operationRef": "#/paths/~1v1~1ecommerce~1discounts~1{id}/patch",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Update this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1v1~1ecommerce~1discounts~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/ecommerce/discounts/{id}": {
      "get": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "getDiscountById",
        "summary": "Get discount",
        "description": "Fetches a single discount by ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceDiscountSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "patch": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "updateDiscount",
        "summary": "Update discount",
        "description": "Partially updates a discount.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EcommerceDiscountSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/EcommerceDiscountSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "delete": {
        "tags": [
          "Ecommerce"
        ],
        "operationId": "deleteDiscount",
        "summary": "Delete discount",
        "description": "Deletes a discount by ID. Historical usage on existing orders is preserved.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted — no body",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/logistics/shipments": {
      "get": {
        "tags": [
          "Logistics"
        ],
        "summary": "List shipments",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LogisticsShipment"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "shippo",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listShipments"
      },
      "post": {
        "tags": [
          "Logistics"
        ],
        "summary": "Create a shipment",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LogisticsShipment"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LogisticsShipment"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1logistics~1shipments~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1v1~1logistics~1shipments~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "createShipment"
      }
    },
    "/logistics/shipments/{id}": {
      "get": {
        "tags": [
          "Logistics"
        ],
        "summary": "Get a shipment",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LogisticsShipment"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                },
                "examples": {
                  "in_transit": {
                    "summary": "In transit — picked up, not yet delivered",
                    "value": {
                      "data": {
                        "id": "shp_1042",
                        "trackingNumber": "1Z999AA10123456784",
                        "carrierId": "ups",
                        "serviceCode": "ups_ground",
                        "warehouseId": "wh_sfo1",
                        "labelUrl": "https://labels.acme.example/shp_1042.pdf",
                        "cost": {
                          "amount": 1200,
                          "currency": "USD"
                        },
                        "reference": "ORD-1042",
                        "notes": "Leave at front desk.",
                        "mode": "parcel",
                        "estimatedDeliveryAt": "2026-02-01T14:20:00Z",
                        "createdAt": "2026-01-15T09:30:00Z",
                        "updatedAt": "2026-02-01T14:20:00Z",
                        "status": "IN_TRANSIT"
                      },
                      "meta": {
                        "platform": "shippo",
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  },
                  "delivered": {
                    "summary": "Delivered — actual delivery recorded",
                    "value": {
                      "data": {
                        "id": "shp_1042",
                        "trackingNumber": "1Z999AA10123456784",
                        "carrierId": "ups",
                        "serviceCode": "ups_ground",
                        "warehouseId": "wh_sfo1",
                        "labelUrl": "https://labels.acme.example/shp_1042.pdf",
                        "cost": {
                          "amount": 1200,
                          "currency": "USD"
                        },
                        "reference": "ORD-1042",
                        "notes": "Leave at front desk.",
                        "mode": "parcel",
                        "estimatedDeliveryAt": "2026-02-01T14:20:00Z",
                        "createdAt": "2026-01-15T09:30:00Z",
                        "updatedAt": "2026-02-01T14:20:00Z",
                        "status": "DELIVERED",
                        "actualDeliveryAt": "2026-02-01T14:20:00Z"
                      },
                      "meta": {
                        "platform": "shippo",
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getShipmentById"
      },
      "delete": {
        "tags": [
          "Logistics"
        ],
        "summary": "Cancel a shipment",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted — no body",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "deleteShipment"
      }
    },
    "/logistics/orders": {
      "get": {
        "tags": [
          "Logistics"
        ],
        "summary": "List orders",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LogisticsOrder"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "shippo",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listOrders"
      },
      "post": {
        "tags": [
          "Logistics"
        ],
        "summary": "Create an order",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LogisticsOrder"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LogisticsOrder"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1logistics~1orders~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "UpdateById": {
                "operationRef": "#/paths/~1v1~1logistics~1orders~1{id}/patch",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Update this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1v1~1logistics~1orders~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "createOrder"
      }
    },
    "/logistics/orders/{id}": {
      "get": {
        "tags": [
          "Logistics"
        ],
        "summary": "Get an order",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LogisticsOrder"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getOrderById"
      },
      "patch": {
        "tags": [
          "Logistics"
        ],
        "summary": "Update an order",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LogisticsOrder"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LogisticsOrder"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "updateOrder"
      },
      "delete": {
        "tags": [
          "Logistics"
        ],
        "summary": "Cancel an order",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted — no body",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "deleteOrder"
      }
    },
    "/logistics/carriers": {
      "get": {
        "tags": [
          "Logistics"
        ],
        "summary": "List carriers",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LogisticsCarrier"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "shippo",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listCarriers"
      }
    },
    "/logistics/carriers/{id}": {
      "get": {
        "tags": [
          "Logistics"
        ],
        "summary": "Get a carrier",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LogisticsCarrier"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getCarrierById"
      }
    },
    "/logistics/warehouses": {
      "get": {
        "tags": [
          "Logistics"
        ],
        "summary": "List warehouses",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LogisticsWarehouse"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "shippo",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listWarehouses"
      }
    },
    "/logistics/warehouses/{id}": {
      "get": {
        "tags": [
          "Logistics"
        ],
        "summary": "Get a warehouse",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LogisticsWarehouse"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getWarehouseById"
      }
    },
    "/logistics/tracking-events": {
      "get": {
        "tags": [
          "Logistics"
        ],
        "summary": "List tracking events",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          },
          {
            "name": "tracking_number",
            "in": "query",
            "description": "Filter by tracking number.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LogisticsTrackingEvent"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "shippo",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listTrackingEvents"
      }
    },
    "/logistics/tracking-events/{trackingNumber}": {
      "get": {
        "tags": [
          "Logistics"
        ],
        "summary": "Get tracking events by tracking number",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "trackingNumber",
            "in": "path",
            "required": true,
            "description": "Carrier tracking number.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LogisticsTrackingEvent"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getTrackingEventById"
      }
    },
    "/logistics/rates": {
      "post": {
        "tags": [
          "Logistics"
        ],
        "summary": "Get shipping rate quotes",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "originAddress",
                  "destinationAddress",
                  "packages"
                ],
                "properties": {
                  "originAddress": {
                    "type": "object",
                    "description": "Origin address",
                    "additionalProperties": true
                  },
                  "destinationAddress": {
                    "type": "object",
                    "description": "Destination address",
                    "additionalProperties": true
                  },
                  "packages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "serviceCodes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rate quotes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LogisticsRate"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "quoteRates"
      }
    },
    "/logistics/labels": {
      "get": {
        "tags": [
          "Logistics"
        ],
        "summary": "List labels",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LogisticsLabel"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "shippo",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listLabels"
      },
      "post": {
        "tags": [
          "Logistics"
        ],
        "summary": "Purchase a shipping label",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LogisticsLabel"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LogisticsLabel"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1logistics~1labels~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1v1~1logistics~1labels~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "createLabel"
      }
    },
    "/logistics/labels/{id}": {
      "get": {
        "tags": [
          "Logistics"
        ],
        "summary": "Get a label",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LogisticsLabel"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getLabelById"
      },
      "delete": {
        "tags": [
          "Logistics"
        ],
        "summary": "Void a label",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted — no body",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "deleteLabel"
      }
    },
    "/logistics/manifests": {
      "get": {
        "tags": [
          "Logistics"
        ],
        "summary": "List manifests",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LogisticsManifest"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "shippo",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listManifests"
      },
      "post": {
        "tags": [
          "Logistics"
        ],
        "summary": "Create a manifest",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LogisticsManifest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LogisticsManifest"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1logistics~1manifests~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "createManifest"
      }
    },
    "/logistics/manifests/{id}": {
      "get": {
        "tags": [
          "Logistics"
        ],
        "summary": "Get a manifest",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LogisticsManifest"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getManifestById"
      }
    },
    "/logistics/pickups": {
      "get": {
        "tags": [
          "Logistics"
        ],
        "summary": "List pickups",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LogisticsPickup"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ListMeta"
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": [],
                      "meta": {
                        "platform": "shippo",
                        "totalCount": 0,
                        "page": 1,
                        "limit": 50,
                        "hasMore": false,
                        "fetchedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "listPickups",
        "description": "Only platforms that expose a pickup collection (EasyPost, AfterShip) implement this; carriers that schedule by confirmation number alone answer 501."
      },
      "post": {
        "tags": [
          "Logistics"
        ],
        "operationId": "createPickup",
        "summary": "Schedule a pickup",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "address",
                  "readyAt"
                ],
                "description": "Platform-specific keys (account numbers, `carrierCode`, `serviceCode`, …) pass through to the adapter.",
                "properties": {
                  "address": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "description": "Recipient or sender contact name.",
                        "example": "Jane Doe",
                        "type": "string"
                      },
                      "company": {
                        "description": "Company name.",
                        "example": "Acme Industries",
                        "type": "string"
                      },
                      "street1": {
                        "description": "Street address, line 1.",
                        "example": "2500 Market Street",
                        "type": "string"
                      },
                      "street2": {
                        "description": "Street address, line 2 (unit, suite).",
                        "example": "Suite 300",
                        "type": "string"
                      },
                      "city": {
                        "description": "City or locality.",
                        "example": "San Francisco",
                        "type": "string"
                      },
                      "state": {
                        "description": "State, province, or region.",
                        "example": "CA",
                        "type": "string"
                      },
                      "postalCode": {
                        "description": "ZIP or postal code.",
                        "example": "94114",
                        "type": "string"
                      },
                      "country": {
                        "$ref": "#/components/schemas/ISO3166",
                        "example": "US"
                      },
                      "phone": {
                        "example": "+14155550123",
                        "type": "string"
                      },
                      "email": {
                        "example": "jane.doe@acme.example",
                        "type": "string",
                        "format": "email",
                        "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                      }
                    },
                    "additionalProperties": false,
                    "description": "Where the carrier collects."
                  },
                  "readyAt": {
                    "$ref": "#/components/schemas/ISO8601",
                    "description": "Earliest time the packages are ready for collection.",
                    "example": "2026-01-15T09:30:00Z"
                  },
                  "closeAt": {
                    "$ref": "#/components/schemas/ISO8601",
                    "description": "Latest time the carrier may still collect — the close of the pickup window.",
                    "example": "2026-01-15T17:00:00Z"
                  },
                  "carrierId": {
                    "type": "string",
                    "description": "Carrier to dispatch, on platforms that front several.",
                    "example": "ups"
                  },
                  "shipmentIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Shipments (or labels / transactions) the pickup covers.",
                    "example": [
                      "shp_8f3a2b9c4d"
                    ]
                  },
                  "packages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "example": "pkg_1042",
                          "type": "string"
                        },
                        "trackingNumber": {
                          "description": "Carrier-issued tracking number.",
                          "example": "1Z999AA10123456784",
                          "type": "string"
                        },
                        "weight": {
                          "type": "object",
                          "properties": {
                            "value": {
                              "type": "number",
                              "minimum": 0,
                              "description": "Weight value, non-negative.",
                              "example": 1.2
                            },
                            "unit": {
                              "type": "string",
                              "enum": [
                                "oz",
                                "lb",
                                "g",
                                "kg"
                              ],
                              "example": "lb"
                            }
                          },
                          "required": [
                            "value",
                            "unit"
                          ],
                          "additionalProperties": false
                        },
                        "dimensions": {
                          "type": "object",
                          "properties": {
                            "length": {
                              "type": "number",
                              "minimum": 0,
                              "example": 12
                            },
                            "width": {
                              "type": "number",
                              "minimum": 0,
                              "example": 6
                            },
                            "height": {
                              "type": "number",
                              "minimum": 0,
                              "example": 2
                            },
                            "unit": {
                              "type": "string",
                              "enum": [
                                "in",
                                "cm"
                              ],
                              "example": "in"
                            }
                          },
                          "required": [
                            "length",
                            "width",
                            "height",
                            "unit"
                          ],
                          "additionalProperties": false
                        },
                        "reference": {
                          "example": "ORD-1042",
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    "description": "Packages the carrier sizes the pickup by."
                  },
                  "instructions": {
                    "type": "string",
                    "description": "Free-text note for the driver.",
                    "example": "Ring the bell at the loading dock."
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Scheduled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LogisticsPickup"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1logistics~1pickups~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/logistics/pickups/{id}": {
      "get": {
        "tags": [
          "Logistics"
        ],
        "summary": "Get a pickup",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LogisticsPickup"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        },
        "operationId": "getPickupById"
      }
    },
    "/logistics/pickups/{id}/cancel": {
      "post": {
        "tags": [
          "Logistics"
        ],
        "operationId": "cancelPickup",
        "summary": "Cancel a pickup",
        "description": "A POST action answering 200 with the pickup in its final state, not a DELETE: FedEx and DHL cannot cancel by id alone, so the request may carry a body.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Optional. Carriers that cannot cancel by id alone read their extra keys from here — FedEx `carrierCode`, `scheduledDate`, `location`; DHL `requestorName`.",
                "properties": {
                  "reason": {
                    "type": "string",
                    "description": "Why the pickup is being cancelled, where the carrier records one.",
                    "example": "Shipment not ready."
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/LogisticsPickup"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/SingleMeta"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/customers": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "listPaymentsCustomers",
        "summary": "List customers",
        "description": "Returns all gateway customer records visible to the authenticated connection.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PaymentsCustomerSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "post": {
        "tags": [
          "Payments"
        ],
        "operationId": "createPaymentsCustomer",
        "summary": "Create customer",
        "description": "Creates a new customer in the upstream gateway.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentsCustomerSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsCustomerSchema"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1payments~1customers~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "UpdateById": {
                "operationRef": "#/paths/~1v1~1payments~1customers~1{id}/patch",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Update this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1v1~1payments~1customers~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/customers/{id}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "getPaymentsCustomer",
        "summary": "Get customer",
        "description": "Fetches a single customer by ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsCustomerSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "patch": {
        "tags": [
          "Payments"
        ],
        "operationId": "updatePaymentsCustomer",
        "summary": "Update customer",
        "description": "Partially updates a customer.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentsCustomerSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsCustomerSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "delete": {
        "tags": [
          "Payments"
        ],
        "operationId": "deletePaymentsCustomer",
        "summary": "Delete customer",
        "description": "Deletes a customer. Some gateways soft-delete and retain historical charges.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted — no body",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/payment_methods": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "listPaymentMethods",
        "summary": "List payment methods",
        "description": "Returns saved payment methods (cards, bank accounts, wallets, mandates).",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PaymentsPaymentMethodSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/payment_methods/{id}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "getPaymentMethod",
        "summary": "Get payment method",
        "description": "Fetches a single payment method by ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsPaymentMethodSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "delete": {
        "tags": [
          "Payments"
        ],
        "operationId": "detachPaymentMethod",
        "summary": "Detach payment method",
        "description": "Detaches the payment method from the customer it is currently attached to.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted — no body",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/charges": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "listCharges",
        "summary": "List charges",
        "description": "Returns charge / payment intent records with their refund + dispute references.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PaymentsChargeSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "post": {
        "tags": [
          "Payments"
        ],
        "operationId": "createCharge",
        "summary": "Create charge",
        "description": "Creates a new charge. Some gateways require a separate `capture` step.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentsChargeSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsChargeSchema"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1payments~1charges~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/charges/{id}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "getCharge",
        "summary": "Get charge",
        "description": "Fetches a single charge by ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsChargeSchema"
                    }
                  }
                },
                "examples": {
                  "succeeded": {
                    "summary": "Succeeded — captured in full, nothing refunded",
                    "value": {
                      "data": {
                        "id": "ch_1042",
                        "externalId": "ch_1042",
                        "amount": 125000,
                        "currency": "USD",
                        "amountCaptured": 125000,
                        "captured": true,
                        "capturedAt": "2026-01-15T09:30:00Z",
                        "customerId": "cus_4Qm2Xa9Lr",
                        "paymentMethodId": "pm_1042",
                        "invoiceId": "inv_1042",
                        "description": "Invoice INV-1042",
                        "statementDescriptor": "ACME INV-1042",
                        "receiptUrl": "https://pay.stripe.com/receipts/ch_1042",
                        "receiptEmail": "jane.doe@acme.example",
                        "disputeIds": [],
                        "gateway": "stripe",
                        "metadata": {
                          "orderId": "ord_1042"
                        },
                        "createdAt": "2026-01-15T09:30:00Z",
                        "updatedAt": "2026-02-01T14:20:00Z",
                        "status": "succeeded",
                        "amountRefunded": 0,
                        "refundIds": []
                      }
                    }
                  },
                  "refunded": {
                    "summary": "Refunded — full amount returned to the customer",
                    "value": {
                      "data": {
                        "id": "ch_1042",
                        "externalId": "ch_1042",
                        "amount": 125000,
                        "currency": "USD",
                        "amountCaptured": 125000,
                        "captured": true,
                        "capturedAt": "2026-01-15T09:30:00Z",
                        "customerId": "cus_4Qm2Xa9Lr",
                        "paymentMethodId": "pm_1042",
                        "invoiceId": "inv_1042",
                        "description": "Invoice INV-1042",
                        "statementDescriptor": "ACME INV-1042",
                        "receiptUrl": "https://pay.stripe.com/receipts/ch_1042",
                        "receiptEmail": "jane.doe@acme.example",
                        "disputeIds": [],
                        "gateway": "stripe",
                        "metadata": {
                          "orderId": "ord_1042"
                        },
                        "createdAt": "2026-01-15T09:30:00Z",
                        "updatedAt": "2026-02-20T00:00:00Z",
                        "status": "refunded",
                        "amountRefunded": 125000,
                        "refundIds": [
                          "re_1042"
                        ]
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/charges/{id}/capture": {
      "post": {
        "tags": [
          "Payments"
        ],
        "operationId": "captureCharge",
        "summary": "Capture an uncaptured charge",
        "description": "Captures funds previously authorised. Omit `amount` to capture the full authorisation.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentsChargeCaptureRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsChargeSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/charges/{id}/cancel": {
      "post": {
        "tags": [
          "Payments"
        ],
        "operationId": "cancelCharge",
        "summary": "Cancel an uncaptured charge",
        "description": "Voids an uncaptured authorisation. Already-captured charges must be refunded instead.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsChargeSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/refunds": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "listRefunds",
        "summary": "List refunds",
        "description": "Returns refund records — partial or full — issued against charges.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PaymentsRefundSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "post": {
        "tags": [
          "Payments"
        ],
        "operationId": "createRefund",
        "summary": "Create refund",
        "description": "Issues a refund against an existing charge.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentsRefundSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsRefundSchema"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1payments~1refunds~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/refunds/{id}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "getRefund",
        "summary": "Get refund",
        "description": "Fetches a single refund by ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsRefundSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/subscriptions": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "listSubscriptions",
        "summary": "List subscriptions",
        "description": "Returns recurring-billing records with their items and dunning state.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PaymentsSubscriptionSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "post": {
        "tags": [
          "Payments"
        ],
        "operationId": "createSubscription",
        "summary": "Create subscription",
        "description": "Subscribes a customer to one or more prices/plans.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentsSubscriptionSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsSubscriptionSchema"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1payments~1subscriptions~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "UpdateById": {
                "operationRef": "#/paths/~1v1~1payments~1subscriptions~1{id}/patch",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Update this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/subscriptions/{id}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "getSubscription",
        "summary": "Get subscription",
        "description": "Fetches a single subscription by ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsSubscriptionSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "patch": {
        "tags": [
          "Payments"
        ],
        "operationId": "updateSubscription",
        "summary": "Update subscription",
        "description": "Adjusts items, payment methods, or scheduling on an active subscription.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentsSubscriptionSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsSubscriptionSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/subscriptions/{id}/cancel": {
      "post": {
        "tags": [
          "Payments"
        ],
        "operationId": "cancelSubscription",
        "summary": "Cancel subscription",
        "description": "Cancels a subscription immediately, or at the period end when `atPeriodEnd: true`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentsSubscriptionCancelRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsSubscriptionSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/invoices": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "listInvoices",
        "summary": "List invoices",
        "description": "Returns invoices including subscription-generated invoices and standalone invoices.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PaymentsInvoiceSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "post": {
        "tags": [
          "Payments"
        ],
        "operationId": "createInvoice",
        "summary": "Create invoice",
        "description": "Drafts a new invoice on the gateway.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentsInvoiceSchema"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsInvoiceSchema"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1payments~1invoices~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "UpdateById": {
                "operationRef": "#/paths/~1v1~1payments~1invoices~1{id}/patch",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Update this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/invoices/{id}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "getInvoice",
        "summary": "Get invoice",
        "description": "Fetches a single invoice by ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsInvoiceSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      },
      "patch": {
        "tags": [
          "Payments"
        ],
        "operationId": "updateInvoice",
        "summary": "Update invoice",
        "description": "Updates a draft invoice. Finalised invoices are typically immutable.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentsInvoiceSchema"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsInvoiceSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/invoices/{id}/void": {
      "post": {
        "tags": [
          "Payments"
        ],
        "operationId": "voidInvoice",
        "summary": "Void invoice",
        "description": "Marks an open invoice as void. Amount due drops to zero.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsInvoiceSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/invoices/{id}/pay": {
      "post": {
        "tags": [
          "Payments"
        ],
        "operationId": "payInvoice",
        "summary": "Pay invoice",
        "description": "Charges the invoice's default payment method.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsInvoiceSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/invoices/{id}/line_items": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "listInvoiceLineItems",
        "summary": "List invoice line items",
        "description": "Returns the line items on the given invoice.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PaymentsInvoiceLineItemSchema"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/payouts": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "listPayouts",
        "summary": "List payouts",
        "description": "Returns gateway-to-bank settlement records.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PaymentsPayoutSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/payouts/{id}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "getPayout",
        "summary": "Get payout",
        "description": "Fetches a single payout by ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsPayoutSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/disputes": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "listDisputes",
        "summary": "List disputes",
        "description": "Returns chargeback / dispute records with evidence-submission deadlines.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PaymentsDisputeSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/disputes/{id}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "getDispute",
        "summary": "Get dispute",
        "description": "Fetches a single dispute by ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsDisputeSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/disputes/{id}/evidence": {
      "post": {
        "tags": [
          "Payments"
        ],
        "operationId": "submitDisputeEvidence",
        "summary": "Submit dispute evidence",
        "description": "Uploads merchant evidence to contest a dispute.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentsDisputeEvidenceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsDisputeSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/plans": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "listPlans",
        "summary": "List plans",
        "description": "Catalog: subscription plans. Returns `501` on gateways without a Plan resource.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PaymentsPlanSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/plans/{id}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "getPlan",
        "summary": "Get plan",
        "description": "Fetches a single plan by ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsPlanSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/prices": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "listPrices",
        "summary": "List prices",
        "description": "Catalog: prices for products. Returns `501` on gateways without a Price resource.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PaymentsPriceSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/prices/{id}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "getPrice",
        "summary": "Get price",
        "description": "Fetches a single price by ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsPriceSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/products": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "listProducts",
        "summary": "List products",
        "description": "Catalog: products sold under one or more prices.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PaymentsProductSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/products/{id}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "getProduct",
        "summary": "Get product",
        "description": "Fetches a single product by ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsProductSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/balance_transactions": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "listBalanceTransactions",
        "summary": "List balance transactions",
        "description": "Returns the per-line ledger of charges, refunds, payouts, fees, and adjustments that make up the gateway balance.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PaymentsBalanceTransactionSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/payments/balance_transactions/{id}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "operationId": "getBalanceTransaction",
        "summary": "Get balance transaction",
        "description": "Fetches a single balance transaction by ID.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PaymentsBalanceTransactionSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/docsign/envelopes": {
      "get": {
        "tags": [
          "Docsign"
        ],
        "operationId": "listEnvelopes",
        "summary": "List envelopes",
        "description": "Returns signing-envelope records (subject, signer list, status, timestamps).",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DocsignEnvelopeSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/docsign/envelopes/{id}": {
      "get": {
        "tags": [
          "Docsign"
        ],
        "operationId": "getEnvelope",
        "summary": "Get envelope",
        "description": "Fetches a single envelope by id.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocsignEnvelopeSchema"
                    }
                  }
                },
                "examples": {
                  "sent": {
                    "summary": "Sent — awaiting signature",
                    "value": {
                      "data": {
                        "id": "env_1042",
                        "externalId": "env_1042",
                        "subject": "Master Services Agreement — Acme Industries",
                        "message": "Please review and sign.",
                        "senderId": "usr_olivia",
                        "senderEmail": "olivia.admin@northwind.example",
                        "senderName": "Olivia Admin",
                        "signingOrder": "sequential",
                        "signerIds": [
                          "signer_jane"
                        ],
                        "documentIds": [
                          "doc_msa"
                        ],
                        "templateId": "tmpl_msa",
                        "platform": "docusign",
                        "metadata": {
                          "account": "acme"
                        },
                        "createdAt": "2026-01-15T09:30:00Z",
                        "status": "sent",
                        "sentAt": "2026-01-15T09:30:00Z",
                        "updatedAt": "2026-01-15T09:30:00Z"
                      }
                    }
                  },
                  "completed": {
                    "summary": "Completed — all signers signed",
                    "value": {
                      "data": {
                        "id": "env_1042",
                        "externalId": "env_1042",
                        "subject": "Master Services Agreement — Acme Industries",
                        "message": "Please review and sign.",
                        "senderId": "usr_olivia",
                        "senderEmail": "olivia.admin@northwind.example",
                        "senderName": "Olivia Admin",
                        "signingOrder": "sequential",
                        "signerIds": [
                          "signer_jane"
                        ],
                        "documentIds": [
                          "doc_msa"
                        ],
                        "templateId": "tmpl_msa",
                        "platform": "docusign",
                        "metadata": {
                          "account": "acme"
                        },
                        "createdAt": "2026-01-15T09:30:00Z",
                        "status": "completed",
                        "sentAt": "2026-01-15T09:30:00Z",
                        "deliveredAt": "2026-01-15T09:30:00Z",
                        "completedAt": "2026-02-01T14:20:00Z",
                        "updatedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/docsign/envelopes/{id}/void": {
      "post": {
        "tags": [
          "Docsign"
        ],
        "operationId": "voidEnvelope",
        "summary": "Void envelope",
        "description": "Voids an open envelope. Already-completed envelopes are immutable.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocsignVoidEnvelopeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocsignEnvelopeSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/docsign/signers": {
      "get": {
        "tags": [
          "Docsign"
        ],
        "operationId": "listSigners",
        "summary": "List signers for an envelope",
        "description": "Returns signers (recipients) on the given envelope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "name": "envelope_id",
            "in": "query",
            "required": true,
            "description": "Envelope id to scope the list under. Signers, documents, and audit-trail entries are envelope-scoped on every platform.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DocsignSignerSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/docsign/signers/{id}": {
      "get": {
        "tags": [
          "Docsign"
        ],
        "operationId": "getSigner",
        "summary": "Get signer",
        "description": "Fetches a single signer by id.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocsignSignerSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/docsign/documents": {
      "get": {
        "tags": [
          "Docsign"
        ],
        "operationId": "listDocuments",
        "summary": "List documents for an envelope (metadata only)",
        "description": "Returns document metadata (filename, size, page count) for the given envelope. Document content is intentionally not exposed.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "name": "envelope_id",
            "in": "query",
            "required": true,
            "description": "Envelope id to scope the list under. Signers, documents, and audit-trail entries are envelope-scoped on every platform.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DocsignDocumentSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/docsign/documents/{id}": {
      "get": {
        "tags": [
          "Docsign"
        ],
        "operationId": "getDocument",
        "summary": "Get document (metadata only)",
        "description": "Fetches document metadata by id. Body content is not returned.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocsignDocumentSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/docsign/audit_trail_entries": {
      "get": {
        "tags": [
          "Docsign"
        ],
        "operationId": "listAuditTrailEntries",
        "summary": "List audit-trail entries for an envelope",
        "description": "Returns first-class audit-trail entries for the given envelope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "name": "envelope_id",
            "in": "query",
            "required": true,
            "description": "Envelope id to scope the list under. Signers, documents, and audit-trail entries are envelope-scoped on every platform.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DocsignAuditTrailEntrySchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/docsign/audit_trail_entries/{id}": {
      "get": {
        "tags": [
          "Docsign"
        ],
        "operationId": "getAuditTrailEntry",
        "summary": "Get audit-trail entry",
        "description": "Fetches a single audit-trail entry by id.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocsignAuditTrailEntrySchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/docsign/templates": {
      "get": {
        "tags": [
          "Docsign"
        ],
        "operationId": "listTemplates",
        "summary": "List templates",
        "description": "Returns reusable envelope templates with signer roles and document counts.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedAfterParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DocsignTemplateSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/docsign/templates/{id}": {
      "get": {
        "tags": [
          "Docsign"
        ],
        "operationId": "getTemplate",
        "summary": "Get template",
        "description": "Fetches a single template by id.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DocsignTemplateSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/projects/projects": {
      "get": {
        "tags": [
          "Projects"
        ],
        "operationId": "listProjects",
        "summary": "List projects",
        "description": "Returns projects visible to the connection.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProjectsProjectSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/projects/projects/{id}": {
      "get": {
        "tags": [
          "Projects"
        ],
        "operationId": "getProject",
        "summary": "Get project",
        "description": "Fetches a single project by id.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectsProjectSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/projects/tasks": {
      "get": {
        "tags": [
          "Projects"
        ],
        "operationId": "listTasks",
        "summary": "List tasks for a project",
        "description": "Returns tasks under the given project. Use `metadata.platformType` to distinguish platform-specific levels (epic/story/subtask/etc.).",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "name": "project_id",
            "in": "query",
            "required": true,
            "description": "Project id to scope the list under (required for tasks).",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProjectsTaskSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/projects/tasks/{id}": {
      "get": {
        "tags": [
          "Projects"
        ],
        "operationId": "getTask",
        "summary": "Get task",
        "description": "Fetches a single task by id.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectsTaskSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/projects/comments": {
      "get": {
        "tags": [
          "Projects"
        ],
        "operationId": "listComments",
        "summary": "List comments for a task",
        "description": "Returns comments under the given task.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "name": "task_id",
            "in": "query",
            "required": true,
            "description": "Task id to scope the list under (required for comments).",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProjectsCommentSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/projects/comments/{id}": {
      "get": {
        "tags": [
          "Projects"
        ],
        "operationId": "getComment",
        "summary": "Get comment",
        "description": "Fetches a single comment by id.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectsCommentSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/projects/tags": {
      "get": {
        "tags": [
          "Projects"
        ],
        "operationId": "listTags",
        "summary": "List tags for a workspace",
        "description": "Returns tags in the given workspace.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": true,
            "description": "Workspace id to scope the list under (required for tags and users).",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProjectsTagSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/projects/tags/{id}": {
      "get": {
        "tags": [
          "Projects"
        ],
        "operationId": "getTag",
        "summary": "Get tag",
        "description": "Fetches a single tag by id.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectsTagSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/projects/workspaces": {
      "get": {
        "tags": [
          "Projects"
        ],
        "operationId": "listWorkspaces",
        "summary": "List workspaces",
        "description": "Returns workspaces visible to the connection.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProjectsWorkspaceSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/projects/workspaces/{id}": {
      "get": {
        "tags": [
          "Projects"
        ],
        "operationId": "getWorkspace",
        "summary": "Get workspace",
        "description": "Fetches a single workspace by id.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectsWorkspaceSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/projects/users": {
      "get": {
        "tags": [
          "Projects"
        ],
        "operationId": "listUsers",
        "summary": "List users for a workspace",
        "description": "Returns members of the given workspace. PII-minimal (name + email).",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "name": "workspace_id",
            "in": "query",
            "required": true,
            "description": "Workspace id to scope the list under (required for tags and users).",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProjectsUserSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/projects/users/{id}": {
      "get": {
        "tags": [
          "Projects"
        ],
        "operationId": "getUser",
        "summary": "Get user",
        "description": "Fetches a single user by id.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ProjectsUserSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/customer-support/tickets": {
      "get": {
        "tags": [
          "CustomerSupport"
        ],
        "operationId": "listTickets",
        "summary": "List tickets",
        "description": "Returns tickets visible to the connection. Schema-firewall: no attachment content, no voice recordings.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CustomerSupportTicketSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/customer-support/tickets/{id}": {
      "get": {
        "tags": [
          "CustomerSupport"
        ],
        "operationId": "getTicket",
        "summary": "Get ticket",
        "description": "Fetches a single ticket by id.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerSupportTicketSchema"
                    }
                  }
                },
                "examples": {
                  "open": {
                    "summary": "Open — awaiting agent action",
                    "value": {
                      "data": {
                        "id": "tkt_1042",
                        "externalId": "tkt_1042",
                        "number": "1042",
                        "subject": "Unable to log in",
                        "priority": "high",
                        "channel": "email",
                        "requesterId": "cnt_jane",
                        "assigneeId": "usr_olivia",
                        "teamId": "team_support",
                        "tagIds": [
                          "tag_login"
                        ],
                        "platform": "zendesk",
                        "metadata": {
                          "brand": "acme"
                        },
                        "createdAt": "2026-01-15T09:30:00Z",
                        "status": "open",
                        "updatedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  },
                  "solved": {
                    "summary": "Solved — resolved with a satisfaction rating",
                    "value": {
                      "data": {
                        "id": "tkt_1042",
                        "externalId": "tkt_1042",
                        "number": "1042",
                        "subject": "Unable to log in",
                        "priority": "high",
                        "channel": "email",
                        "requesterId": "cnt_jane",
                        "assigneeId": "usr_olivia",
                        "teamId": "team_support",
                        "tagIds": [
                          "tag_login"
                        ],
                        "platform": "zendesk",
                        "metadata": {
                          "brand": "acme"
                        },
                        "createdAt": "2026-01-15T09:30:00Z",
                        "status": "resolved",
                        "satisfactionRating": 5,
                        "updatedAt": "2026-02-01T14:20:00Z",
                        "resolvedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/customer-support/messages": {
      "get": {
        "tags": [
          "CustomerSupport"
        ],
        "operationId": "listMessages",
        "summary": "List messages for a ticket",
        "description": "Returns messages under the given ticket. Body text included verbatim. Internal-note PII redaction is the operator's responsibility at consume-time.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "name": "ticket_id",
            "in": "query",
            "required": true,
            "description": "Ticket id to scope the list under (required for messages).",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CustomerSupportMessageSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/customer-support/messages/{id}": {
      "get": {
        "tags": [
          "CustomerSupport"
        ],
        "operationId": "getMessage",
        "summary": "Get message",
        "description": "Fetches a single message by id.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerSupportMessageSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/customer-support/contacts": {
      "get": {
        "tags": [
          "CustomerSupport"
        ],
        "operationId": "listContacts",
        "summary": "List contacts",
        "description": "Returns contacts. PII-minimal (name + email + phone only).",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CustomerSupportContactSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/customer-support/contacts/{id}": {
      "get": {
        "tags": [
          "CustomerSupport"
        ],
        "operationId": "getContact",
        "summary": "Get contact",
        "description": "Fetches a single contact by id.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerSupportContactSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/customer-support/users": {
      "get": {
        "tags": [
          "CustomerSupport"
        ],
        "operationId": "listUsers",
        "summary": "List agents",
        "description": "Returns support agents.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CustomerSupportUserSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/customer-support/users/{id}": {
      "get": {
        "tags": [
          "CustomerSupport"
        ],
        "operationId": "getUser",
        "summary": "Get agent",
        "description": "Fetches a single agent by id.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerSupportUserSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/customer-support/tags": {
      "get": {
        "tags": [
          "CustomerSupport"
        ],
        "operationId": "listTags",
        "summary": "List tags",
        "description": "Returns tags (ticket taxonomy).",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CustomerSupportTagSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/customer-support/tags/{id}": {
      "get": {
        "tags": [
          "CustomerSupport"
        ],
        "operationId": "getTag",
        "summary": "Get tag",
        "description": "Fetches a single tag by id.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerSupportTagSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/customer-support/teams": {
      "get": {
        "tags": [
          "CustomerSupport"
        ],
        "operationId": "listTeams",
        "summary": "List agent teams",
        "description": "Returns agent groups / teams.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CustomerSupportTeamSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/customer-support/teams/{id}": {
      "get": {
        "tags": [
          "CustomerSupport"
        ],
        "operationId": "getTeam",
        "summary": "Get team",
        "description": "Fetches a single team by id.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerSupportTeamSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/customer-support/macros": {
      "get": {
        "tags": [
          "CustomerSupport"
        ],
        "operationId": "listMacros",
        "summary": "List macros (canned responses)",
        "description": "Returns canned-response templates. Platforms without this surface return [].",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CustomerSupportMacroSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/customer-support/macros/{id}": {
      "get": {
        "tags": [
          "CustomerSupport"
        ],
        "operationId": "getMacro",
        "summary": "Get macro",
        "description": "Fetches a single macro by id.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerSupportMacroSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/inventory/products": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "operationId": "listProducts",
        "summary": "List products",
        "description": "Returns products / SKUs. Variants flat-with-parent-pointer via parentProductId. Schema-firewall: no images.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InventoryProductSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/inventory/products/{id}": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "operationId": "getProduct",
        "summary": "Get product",
        "description": "Fetches a single product by id.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InventoryProductSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/inventory/stock-levels": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "operationId": "listStockLevels",
        "summary": "List stock levels",
        "description": "Returns quantity per Product × Location. Id is synthetic <productId>:<locationId>.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InventoryStockLevelSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/inventory/stock-levels/{id}": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "operationId": "getStockLevel",
        "summary": "Get stock level",
        "description": "Fetches a single stock level.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InventoryStockLevelSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/inventory/locations": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "operationId": "listLocations",
        "summary": "List locations",
        "description": "Returns warehouses / stores / virtual locations. Hierarchy via parentLocationId.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InventoryLocationSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/inventory/locations/{id}": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "operationId": "getLocation",
        "summary": "Get location",
        "description": "Fetches a single location.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InventoryLocationSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/inventory/suppliers": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "operationId": "listSuppliers",
        "summary": "List suppliers",
        "description": "Returns vendors / sources. PII-minimal — banking details refused.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InventorySupplierSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/inventory/suppliers/{id}": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "operationId": "getSupplier",
        "summary": "Get supplier",
        "description": "Fetches a single supplier.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InventorySupplierSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/inventory/purchase-orders": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "operationId": "listPurchaseOrders",
        "summary": "List purchase orders",
        "description": "Returns inbound stock orders with nested line items.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InventoryPurchaseOrderSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/inventory/purchase-orders/{id}": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "operationId": "getPurchaseOrder",
        "summary": "Get purchase order",
        "description": "Fetches a single purchase order.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InventoryPurchaseOrderSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/inventory/stock-transfers": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "operationId": "listStockTransfers",
        "summary": "List stock transfers",
        "description": "Returns movements between Locations.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InventoryStockTransferSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/inventory/stock-transfers/{id}": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "operationId": "getStockTransfer",
        "summary": "Get stock transfer",
        "description": "Fetches a single stock transfer.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InventoryStockTransferSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/inventory/stock-adjustments": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "operationId": "listStockAdjustments",
        "summary": "List stock adjustments",
        "description": "Cycle-counts, damage write-offs, audit moves.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "$ref": "#/components/parameters/PageParam"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Not read by the server. Page with `page` and `limit`, and stop when `meta.hasMore` is false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InventoryStockAdjustmentSchema"
                      }
                    }
                  }
                },
                "examples": {
                  "empty": {
                    "summary": "No records match — empty first page",
                    "value": {
                      "data": []
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/inventory/stock-adjustments/{id}": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "operationId": "getStockAdjustment",
        "summary": "Get stock adjustment",
        "description": "Fetches a single stock adjustment.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InventoryStockAdjustmentSchema"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "501": {
            "$ref": "#/components/responses/NotImplemented"
          }
        }
      }
    },
    "/test/v1/keys": {
      "post": {
        "tags": [
          "Sandbox"
        ],
        "operationId": "sandbox.self-serve-key",
        "summary": "Mint a sandbox API key, self-serve (operator opt-in)",
        "description": "Unauthenticated, and OFF by default — answers `403 SANDBOX_SELF_SERVE_DISABLED` until the operator enables `auth.sandbox_self_serve_enabled`. When enabled, mints an `osk_test_…` key (plaintext returned once) bound to a fresh throwaway tenant: it works only on the no-egress `/test/v1/*` sandbox, expires after 7 days, and minting is IP-rate-limited (3/hour). Start with `GET /test/v1/connections` using the new key.",
        "security": [],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Optional label; defaults to \"self-serve sandbox\"."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Key minted — the plaintext appears once, here.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "tenantId": {
                          "type": "string",
                          "example": "sandbox-8f3a2b9c"
                        },
                        "plaintext": {
                          "type": "string",
                          "example": "osk_test_sandbox-8f3a2b9c_…"
                        },
                        "mode": {
                          "type": "string",
                          "enum": [
                            "test"
                          ]
                        },
                        "expiresAt": {
                          "type": "number",
                          "description": "Epoch ms — 7 days out."
                        },
                        "next": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "description": "Self-serve minting disabled (the default)",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "429": {
            "description": "Per-IP mint budget exhausted",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "503": {
            "description": "Test mode disabled",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ]
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/test/oidc/.well-known/openid-configuration": {
      "get": {
        "tags": [
          "Sandbox"
        ],
        "operationId": "sandbox.oidc-discovery",
        "summary": "Sandbox test issuer: OIDC discovery",
        "description": "Discovery document for this deployment’s own test issuer. `issuer` is `<public base>/test/oidc` — the exact string to register on /oauth-clients (preset “OpenSteward test issuer”); the “Test” button there reads `jwks_uri` from here. Unauthenticated.",
        "security": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "issuer": {
                      "type": "string",
                      "example": "http://localhost:3010/test/oidc"
                    },
                    "jwks_uri": {
                      "type": "string",
                      "example": "http://localhost:3010/test/oidc/jwks"
                    },
                    "token_endpoint": {
                      "type": "string",
                      "example": "http://localhost:3010/test/oidc/token"
                    },
                    "grant_types_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "example": [
                        "client_credentials"
                      ]
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "503": {
            "description": "Test mode disabled",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/test/oidc/jwks": {
      "get": {
        "tags": [
          "Sandbox"
        ],
        "operationId": "sandbox.oidc-jwks",
        "summary": "Sandbox test issuer: signing keys",
        "description": "The RS256 public key the test issuer signs with. Generated in memory when the server starts — a restart rotates it and every earlier test token stops verifying. Unauthenticated.",
        "security": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "keys": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kty": {
                            "type": "string",
                            "example": "RSA"
                          },
                          "kid": {
                            "type": "string",
                            "example": "sandbox-1"
                          },
                          "alg": {
                            "type": "string",
                            "example": "RS256"
                          },
                          "use": {
                            "type": "string",
                            "example": "sig"
                          },
                          "n": {
                            "type": "string"
                          },
                          "e": {
                            "type": "string",
                            "example": "AQAB"
                          }
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "503": {
            "description": "Test mode disabled",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/test/oidc/token": {
      "post": {
        "tags": [
          "Sandbox"
        ],
        "operationId": "sandbox.oidc-token",
        "summary": "Sandbox test issuer: mint a token (client_credentials)",
        "description": "Trades a **test API key** for an OIDC bearer token, the way an identity provider trades a client secret for one. `client_id` is the subject the token is minted for; `client_secret` is an `osk_test_…` key (a live key is refused). Also accepts HTTP Basic client authentication. The tenant claim is always the key’s tenant — nothing in the request can widen it.\n\nThe token carries `iss` = this deployment’s test issuer and works on `/test/v1/*` only; `/v1/*` answers `403 KEY_MODE_MISMATCH`, as it does for a test key. Whether the token is *admitted* is the registered issuer’s configuration — registry (the subject must be a registered service account), intersect, or token-decides — exactly as on `/v1/*`. Requires the test issuer to be registered on /oauth-clients first; answers `400 invalid_request` naming the URL to register otherwise. Errors use the OAuth 2.0 shape (`error`, `error_description`). IP-rate-limited (60/hour).",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "grant_type",
                  "client_id",
                  "client_secret"
                ],
                "properties": {
                  "grant_type": {
                    "type": "string",
                    "enum": [
                      "client_credentials"
                    ]
                  },
                  "client_id": {
                    "type": "string",
                    "example": "billing-service",
                    "description": "The subject (`sub` and `azp`) the token is minted for."
                  },
                  "client_secret": {
                    "type": "string",
                    "example": "osk_test_default_…",
                    "description": "A test API key. Its tenant becomes the token’s tenant claim."
                  },
                  "scope": {
                    "type": "string",
                    "example": "customers:read vertical:accounting",
                    "description": "Space-separated scope claim. Defaults to the key’s scopes. Ignored in registry mode, narrows the registered set in intersect mode, mapped through scope rules in token-decides mode."
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "grant_type",
                  "client_id",
                  "client_secret"
                ],
                "properties": {
                  "grant_type": {
                    "type": "string",
                    "enum": [
                      "client_credentials"
                    ]
                  },
                  "client_id": {
                    "type": "string",
                    "example": "billing-service"
                  },
                  "client_secret": {
                    "type": "string",
                    "example": "osk_test_default_…"
                  },
                  "scope": {
                    "type": "string",
                    "example": "customers:read vertical:accounting"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token minted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "type": "string",
                      "example": "eyJhbGciOiJSUzI1NiIsImtpZCI6InNhbmRib3gtMSJ9.…"
                    },
                    "token_type": {
                      "type": "string",
                      "enum": [
                        "Bearer"
                      ]
                    },
                    "expires_in": {
                      "type": "integer",
                      "example": 3600
                    },
                    "scope": {
                      "type": "string",
                      "example": "customers:read vertical:accounting"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "description": "Unsupported grant, or the test issuer is not registered yet",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "401": {
            "description": "Missing or invalid client credentials (not a test key)",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "429": {
            "description": "Per-IP mint budget exhausted",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "503": {
            "description": "Test mode disabled",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ]
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/test/v1/connections": {
      "get": {
        "tags": [
          "Sandbox"
        ],
        "operationId": "sandbox.connections",
        "summary": "List sandbox connections",
        "description": "Every sandbox connection for the calling tenant — one per mounted vertical. **Start here**: every other `/test/v1/*` request needs a `connection_id`, and these are the only ids the sandbox accepts.\n\nRequires a **test-mode** dev key (`osk_test_…`). A live key on this path is `403 KEY_MODE_MISMATCH`, and the reverse is true on `/v1/*` — the two surfaces never share a credential.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SandboxConnection"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "required": [
                        "total"
                      ],
                      "properties": {
                        "total": {
                          "type": "integer",
                          "example": 9
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "401": {
            "description": "Missing or invalid key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "403": {
            "description": "A live key was used on the sandbox surface (`KEY_MODE_MISMATCH`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "429": {
            "description": "Rate limited — the sandbox applies the same limits as `/v1/*`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "503": {
            "description": "Test mode is switched off for this deployment (`TEST_MODE_DISABLED`). Operators control it with the `features.test_mode_enabled` runtime setting; it takes effect within one settings poll, and leaves `/v1/*` untouched.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/test/v1/reset": {
      "delete": {
        "tags": [
          "Sandbox"
        ],
        "operationId": "sandbox.reset",
        "summary": "Reset the sandbox",
        "description": "Deletes every sandbox record belonging to the calling tenant. The next read reseeds from the same documented examples the Unified API reference shows, so a suite can reset between runs and get identical data back.\n\nScoped to the tenant on the verified key, never to anything in the request — one tenant cannot reset another's. `/v1/*` data is untouched: the sandbox lives in its own table.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "required": [
                        "deleted"
                      ],
                      "properties": {
                        "deleted": {
                          "type": "integer",
                          "description": "How many records were removed.",
                          "example": 312
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "401": {
            "description": "Missing or invalid key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "403": {
            "description": "A live key was used on the sandbox surface (`KEY_MODE_MISMATCH`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "429": {
            "description": "Rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "503": {
            "description": "Test mode is switched off for this deployment (`TEST_MODE_DISABLED`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ]
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/test/v1/auth/{vertical}/{platform}/connect": {
      "get": {
        "tags": [
          "Sandbox"
        ],
        "operationId": "sandbox.auth-connect",
        "summary": "Start the mock OAuth ceremony",
        "description": "The sandbox stand-in for `GET /auth/{vertical}/{platform}/connect`. The live ceremony needs an enabled adapter with real OAuth client config and a live provider; the sandbox simulates the whole dance against the synthetic `sandbox` platform with **no outbound request**.\n\nWithout `outcome`, responds `302` to a hosted mock authorize page (Approve / Deny buttons) — the browser journey. With `outcome`, skips the page and drives the flow programmatically:\n\n- `granted` → 302 straight to the callback with a valid `code` + `state` → the callback answers `201` with the **derived sandbox connection id**.\n- `denied` → callback answers `400 OAUTH_ACCESS_DENIED` (no id).\n- `error` → callback answers `400 OAUTH_PROVIDER_ERROR` (no id).\n- `expired` → the callback receives a state that was never stored → `400 INVALID_STATE`, exactly what an expired live state looks like.\n\n`tenant_id` is required — the ceremony derives the connection id from it, the same UUIDv5 derivation as `GET /test/v1/connections`. Only `platform = 'sandbox'` exists; any other slug answers the live-shaped `404 ADAPTER_UNAVAILABLE`. Unauthenticated by design (browser ceremony, like the live `/auth` GETs), gated by the test-mode flag and an IP rate limit.",
        "security": [],
        "parameters": [
          {
            "name": "vertical",
            "in": "path",
            "required": true,
            "description": "Vertical name (`accounting`, `crm`, `ecommerce`, `logistics`, `payments`, `docsign`, `projects`, `customer-support`, `inventory`).",
            "schema": {
              "$ref": "#/components/schemas/Vertical"
            }
          },
          {
            "name": "platform",
            "in": "path",
            "required": true,
            "description": "Always `sandbox` — the only platform the sandbox serves.",
            "schema": {
              "type": "string",
              "enum": [
                "sandbox"
              ]
            }
          },
          {
            "name": "tenant_id",
            "in": "query",
            "required": true,
            "description": "Tenant whose derived sandbox connection the ceremony grants.",
            "schema": {
              "type": "string",
              "example": "default"
            }
          },
          {
            "name": "label",
            "in": "query",
            "description": "Optional label echoed on the granted connection.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "outcome",
            "in": "query",
            "description": "Skip the hosted authorize page and drive the flow programmatically.",
            "schema": {
              "type": "string",
              "enum": [
                "granted",
                "denied",
                "error",
                "expired"
              ]
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect — to the hosted mock authorize page (no `outcome`) or directly to the callback (`outcome` given).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "400": {
            "description": "MISSING_PARAMS (no tenant_id), INVALID_OUTCOME, or INVALID_LINK_TOKEN",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "404": {
            "description": "ADAPTER_UNAVAILABLE — platform is not 'sandbox' or unknown vertical",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "503": {
            "description": "TEST_MODE_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/test/v1/auth/{vertical}/{platform}/callback": {
      "get": {
        "tags": [
          "Sandbox"
        ],
        "operationId": "sandbox.auth-callback",
        "summary": "Complete the mock OAuth ceremony",
        "description": "Where the mock authorize page (or an `outcome`-driven redirect) lands. Consumes the one-time `state` — a replayed, expired, or unknown state answers `400 INVALID_STATE`, and a state started for a different vertical answers `400 STATE_MISMATCH`, mirroring the live CSRF guard.\n\nOn success the response is `201` with the **derived** sandbox connection id — the same id `GET /test/v1/connections` lists for that tenant and vertical. The sandbox never mints new connection ids; denied/error outcomes return an error payload and no id. (A flow started from a sandbox Connect Link 302s to the hosted done page instead of returning JSON, mirroring the live Connect Link branch.)",
        "security": [],
        "parameters": [
          {
            "name": "vertical",
            "in": "path",
            "required": true,
            "description": "Vertical name (`accounting`, `crm`, `ecommerce`, `logistics`, `payments`, `docsign`, `projects`, `customer-support`, `inventory`).",
            "schema": {
              "$ref": "#/components/schemas/Vertical"
            }
          },
          {
            "name": "platform",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "sandbox"
              ]
            }
          },
          {
            "name": "code",
            "in": "query",
            "description": "The mock authorization code (any `sbx_…` value the connect leg issued).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": true,
            "description": "One-time CSRF state issued by the connect leg.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "error",
            "in": "query",
            "description": "Provider-style error instead of a code: `access_denied` or `server_error`.",
            "schema": {
              "type": "string",
              "enum": [
                "access_denied",
                "server_error"
              ]
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Mock connection granted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "required": [
                        "id",
                        "vertical",
                        "platform",
                        "tenantId",
                        "status"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The DERIVED sandbox connection id — identical to the one `GET /test/v1/connections` lists for this tenant + vertical.",
                          "example": "ed57733f-b65b-56fc-93a9-5654d3183944"
                        },
                        "vertical": {
                          "$ref": "#/components/schemas/Vertical"
                        },
                        "platform": {
                          "type": "string",
                          "enum": [
                            "sandbox"
                          ]
                        },
                        "tenantId": {
                          "type": "string",
                          "example": "default"
                        },
                        "label": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "connected"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "302": {
            "description": "Connect Link flow — redirect to the hosted done page.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "400": {
            "description": "MISSING_PARAMS, INVALID_STATE (unknown / expired / replayed), STATE_MISMATCH, OAUTH_ACCESS_DENIED, or OAUTH_PROVIDER_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "503": {
            "description": "TEST_MODE_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/admin/connections": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "List connections (operator)",
        "description": "Returns every stored connection across every vertical. **Operator-only — gated by `X-Admin-Secret`.** Each row carries its `vertical` and `platform`. Tenant-scoped clients should use `GET /v1/connections` (Bearer dev key) instead.",
        "parameters": [
          {
            "name": "vertical",
            "in": "query",
            "description": "Filter to one vertical.",
            "schema": {
              "$ref": "#/components/schemas/Vertical"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "description": "Filter to one adapter, by slug. See the `PlatformSlug` schema or `GET /v1/platforms` for valid values.",
            "schema": {
              "type": "string",
              "example": "fortnox"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "expired",
                "revoked"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AdminConnection"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/admin/connections/{id}": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "Get a connection (operator)",
        "description": "Operator-only. Tenant-scoped clients use `GET /v1/connections/{id}` (Bearer + `connections:read` scope).",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdminConnection"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Admin"
        ],
        "summary": "Update connection metadata (operator)",
        "description": "Update `label` or `tenantId`. Operator-only. Tenant-scoped clients use `PATCH /v1/connections/{id}` (Bearer + `connections:write` scope).",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "tenantId": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdminConnection"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "Admin"
        ],
        "summary": "Delete a connection (operator)",
        "description": "Removes the connection row. Does NOT call the upstream platform to revoke OAuth tokens. Operator-only. Tenant-scoped clients use `DELETE /v1/connections/{id}` (Bearer + `connections:write` scope).",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/auth/{vertical}/{platform}/connect": {
      "get": {
        "tags": [
          "Auth"
        ],
        "summary": "Start OAuth — redirect to provider authorization URL",
        "description": "Browser endpoint. The user-agent is 302'd to the upstream provider's authorization URL. After the user consents, the provider redirects back to `GET /auth/{vertical}/{platform}/callback`.\n\n**When to use this vs the POST variant:** check the platform's `auth_type` in `/v1/platforms/{vertical}/{slug}`. `oauth2` → use this GET. Any other value (`api_key`, `basic`, `session`) → use the POST variant on the same path.\n\n**Admin tooling vs end-user flow:** this path is for admin tooling — the resulting connection has `ownerTenantId = null` and **does not appear** under `/v1/customers/{id}/connections`. For end-user flows (where the connection should be attached to one of your customers), mint a Connect Link with `POST /v1/customers/{id}/connect-links` instead and let the user complete OAuth via that flow.",
        "security": [],
        "parameters": [
          {
            "name": "vertical",
            "in": "path",
            "required": true,
            "description": "Vertical name (`accounting`, `crm`, `ecommerce`, `logistics`, `payments`, `docsign`, `projects`, `customer-support`, `inventory`).",
            "schema": {
              "$ref": "#/components/schemas/Vertical"
            }
          },
          {
            "name": "platform",
            "in": "path",
            "required": true,
            "description": "Adapter slug for the upstream platform (e.g. `fortnox`, `shopify`).",
            "schema": {
              "$ref": "#/components/schemas/PlatformSlug"
            }
          },
          {
            "name": "tenant_id",
            "in": "query",
            "schema": {
              "type": [
                "string",
                "null"
              ]
            },
            "description": "Tenant the connection belongs to. Omit for admin-tooling (no-owner) connections."
          },
          {
            "name": "label",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Optional human-readable label, surfaced in connection listings."
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to provider authorization endpoint",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "400": {
            "description": "Platform is marked unsupported and cannot be connected. Body: `{ error: { code: \"PLATFORM_UNSUPPORTED\", message, reason, issueUrl } }`.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Connect via static API key (no OAuth)",
        "description": "For platforms whose `auth_type` is `api_key` (or similar non-OAuth) — primarily logistics carriers (e.g. FedEx, UPS, Shippo) and a handful of CRM platforms. Stores the static credential and returns the new connection.\n\n**When to use this vs the GET variant:** check the platform's `auth_type` in `/v1/platforms/{vertical}/{slug}`. `oauth2` → use `GET /auth/{vertical}/{platform}/connect` (browser redirect). `api_key` (or any other non-oauth value) → use this POST.\n\nAdapters that haven't opted into the static-credential flow (no `exchangeCredentials()`) reject this with 404 — fall back to the OAuth GET path.\n\n**Credential fields are the adapter's, not a fixed `api_key`.** Send them as `fields`, keyed by the names in `credentialFields()` — `GET /v1/platforms/{vertical}/{slug}` lists them. Some adapters take one token, others take `clientId` + `clientSecret` plus an account id. `api_key` is accepted as shorthand **only** where the adapter declares exactly one field (the carrier case); anything else answers 400 and names what it needs.\n\n`tenant_id` is optional: omit it for admin-tooling connections (the connection lands with `ownerTenantId = null` and won't appear under `/v1/customers/{id}/connections`). Provide it when minting a connection that should belong to one of your tenants.\n\n**Two credentials, deliberately unequal.** Send `X-Admin-Secret` and `tenant_id` is taken from the body, so an operator can provision for any tenant or for none. Send a tenant Bearer key carrying `connections:write` and it works too — but `tenant_id` comes from the KEY and the body’s value is ignored, which is what makes it safe to expose: a tenant can provision its own carriers headlessly and cannot reach another’s. Presenting a Bearer header selects the tenant path even if a secret is also present, so the narrower rule wins.\n\nThis route always requires a credential: an unauthenticated caller able to supply `tenant_id` could mint a connection owned by any tenant and route that tenant’s traffic through an upstream account the caller controls. End-user credential entry belongs on the Connect Link flow, which is scoped by a one-time session token.",
        "security": [
          {
            "AdminSecret": []
          },
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "vertical",
            "in": "path",
            "required": true,
            "description": "Vertical name (`accounting`, `crm`, `ecommerce`, `logistics`, `payments`, `docsign`, `projects`, `customer-support`, `inventory`).",
            "schema": {
              "$ref": "#/components/schemas/Vertical"
            }
          },
          {
            "name": "platform",
            "in": "path",
            "required": true,
            "description": "Adapter slug for the upstream platform (e.g. `fortnox`, `shopify`).",
            "schema": {
              "$ref": "#/components/schemas/PlatformSlug"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Supply `fields` (preferred) or `api_key` for single-field adapters. One of the two is required.",
                "properties": {
                  "fields": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "The adapter's credential fields, keyed by the names `credentialFields()` declares.",
                    "example": {
                      "clientId": "ck_live_…",
                      "clientSecret": "cs_live_…"
                    }
                  },
                  "api_key": {
                    "type": "string",
                    "description": "Shorthand for a single-field adapter. Rejected with 400 when the adapter declares more than one field.",
                    "example": "shippo_live_…"
                  },
                  "tenant_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Tenant the connection belongs to. Omit for admin-tooling (no-owner) connections. **Ignored when authenticating with a tenant Bearer key** — that key’s own tenant is used."
                  },
                  "label": {
                    "type": "string",
                    "description": "Optional human-readable label."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connection created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "required": [
                        "id",
                        "platform",
                        "status"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "platform": {
                          "type": "string"
                        },
                        "tenantId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "label": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "connected"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "description": "Missing or rejected credentials, or an unsupported platform. `MISSING_FIELDS` and `FIELDS_REQUIRED` both carry the adapter's field list; `CREDENTIAL_EXCHANGE_FAILED` means the platform refused them; `PLATFORM_UNSUPPORTED` means the platform is marked unsupported and carries `reason`/`issueUrl`.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "401": {
            "description": "A Bearer key was sent and it is invalid or expired.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "403": {
            "description": "Missing or invalid `X-Admin-Secret`, or a Bearer key without `connections:write`. A sandbox (`osk_test_…`) key is also refused — this writes a real credential.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Duplicate label for (vertical, platform, tenant).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "retry-after": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/auth/{vertical}/{platform}/callback": {
      "get": {
        "tags": [
          "Auth"
        ],
        "summary": "OAuth callback — exchanges code, stores connection",
        "description": "Returned to by the upstream provider with `code` and `state` query params. Exchanges the code for tokens and persists a new connection row.\n\n**Two response shapes** depending on how the OAuth was started:\n- **Admin tooling** (started via `GET /auth/.../connect`): returns 200 JSON with `{ connection_id, vertical, platform }`. The connection has `ownerTenantId = null` — it won't appear under `/v1/customers/{id}/connections`.\n- **Connect Link flow** (started via `POST /connect/sessions/:token/oauth-start`): 302 redirects to the session's `redirect_url` (or the hosted thank-you page). The connection has `ownerTenantId` set from the session's tenant and IS visible under `/v1/customers/{id}/connections`.",
        "security": [],
        "parameters": [
          {
            "name": "vertical",
            "in": "path",
            "required": true,
            "description": "Vertical name (`accounting`, `crm`, `ecommerce`, `logistics`, `payments`, `docsign`, `projects`, `customer-support`, `inventory`).",
            "schema": {
              "$ref": "#/components/schemas/Vertical"
            }
          },
          {
            "name": "platform",
            "in": "path",
            "required": true,
            "description": "Adapter slug for the upstream platform (e.g. `fortnox`, `shopify`).",
            "schema": {
              "$ref": "#/components/schemas/PlatformSlug"
            }
          },
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Connection created (admin-tooling flow). For Connect Link flows, response is 302 to the session redirect_url.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "connection_id",
                    "vertical",
                    "platform"
                  ],
                  "properties": {
                    "connection_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "vertical": {
                      "$ref": "#/components/schemas/Vertical"
                    },
                    "platform": {
                      "type": "string",
                      "description": "Adapter slug. See the `PlatformSlug` schema for the full list.",
                      "example": "fortnox"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/platforms": {
      "get": {
        "tags": [
          "Platform"
        ],
        "summary": "List platforms",
        "description": "Flat list of every adapter known to the service across every vertical. Each row carries an `enabled` boolean reflecting the deployment-specific activation state — use `?enabled=true` to filter to only the platforms a customer can actually connect to right now. Requires a credential: a Bearer dev key (live) or `X-Admin-Secret`. **In test mode** (`/test/v1/platforms`, test key) the catalog is curated: one synthetic `sandbox` platform per vertical, always enabled — exactly the platforms the sandbox connections use.",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "AdminSecret": []
          }
        ],
        "parameters": [
          {
            "name": "vertical",
            "in": "query",
            "description": "Filter to one vertical.",
            "schema": {
              "$ref": "#/components/schemas/Vertical"
            }
          },
          {
            "$ref": "#/components/parameters/SearchParam"
          },
          {
            "name": "enabled",
            "in": "query",
            "description": "When `true`, return only platforms the operator has enabled on this deployment. When `false`, return only disabled platforms. Omit to return both.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Platform"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          }
        }
      }
    },
    "/platforms/{vertical}/{slug}": {
      "get": {
        "tags": [
          "Platform"
        ],
        "summary": "Get platform metadata",
        "description": "Requires a credential: a Bearer dev key (live) or `X-Admin-Secret`. In test mode (`/test/v1/platforms/{vertical}/sandbox`, test key) only the synthetic `sandbox` slug resolves.",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "AdminSecret": []
          }
        ],
        "parameters": [
          {
            "name": "vertical",
            "in": "path",
            "required": true,
            "description": "Vertical name (`accounting`, `crm`, `ecommerce`, `logistics`, `payments`, `docsign`, `projects`, `customer-support`, `inventory`).",
            "schema": {
              "$ref": "#/components/schemas/Vertical"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Adapter slug.",
            "schema": {
              "$ref": "#/components/schemas/PlatformSlug"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Platform"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/capabilities": {
      "get": {
        "tags": [
          "Platform"
        ],
        "operationId": "capabilities.get",
        "summary": "List the verticals this deployment serves",
        "description": "The verticals whose routes answer for your credential: every vertical the deployment runs that its license includes. An MCP client registers tools only for these. Any Bearer dev key works, with no particular scope; an `mcp:read` key is also refused here when the license or the `features.mcp_enabled` setting withholds MCP. Carries no license details. End-user tokens (`eut_`) use `GET /v1/me/capabilities`, which lists the verticals mounted under `/v1/me` that the license includes. **In test mode** (`/test/v1/capabilities`, test key) the list is the sandbox verticals the license includes.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Capabilities"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/admin/platforms": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "List adapter enable-state across every vertical",
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vertical",
            "in": "query",
            "description": "Filter to one vertical.",
            "schema": {
              "$ref": "#/components/schemas/Vertical"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AdapterRow"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/admin/platforms/{vertical}/{slug}/enable": {
      "post": {
        "tags": [
          "Admin"
        ],
        "summary": "Enable an adapter (and optionally seed its config)",
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vertical",
            "in": "path",
            "required": true,
            "description": "Vertical name (`accounting`, `crm`, `ecommerce`, `logistics`, `payments`, `docsign`, `projects`, `customer-support`, `inventory`).",
            "schema": {
              "$ref": "#/components/schemas/Vertical"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Adapter slug.",
            "schema": {
              "$ref": "#/components/schemas/PlatformSlug"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "config": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "description": "Platform is marked unsupported and cannot be enabled. Body: `{ error: { code: \"PLATFORM_UNSUPPORTED\", message, reason, issueUrl } }`.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Unknown adapter (vertical, slug)",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/admin/platforms/{vertical}/{slug}/disable": {
      "post": {
        "tags": [
          "Admin"
        ],
        "summary": "Disable an adapter (settings row preserved)",
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vertical",
            "in": "path",
            "required": true,
            "description": "Vertical name (`accounting`, `crm`, `ecommerce`, `logistics`, `payments`, `docsign`, `projects`, `customer-support`, `inventory`).",
            "schema": {
              "$ref": "#/components/schemas/Vertical"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Adapter slug.",
            "schema": {
              "$ref": "#/components/schemas/PlatformSlug"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Unknown adapter",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/webhooks/{vertical}/{platform}": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Inbound webhook receiver",
        "description": "Verifies the upstream signature, normalises the payload into one or more `WebhookEvent`s, fans each one out across matching stored connections (same `(vertical, platform, tenantId)` may resolve to multiple connections), and — if `webhooks.callbackUrl` is configured — POSTs `{ events: WebhookEvent[] }` to that URL as a fire-and-forget. Response body carries only `{ received, eventCount }`; consumers that need the event payloads wire a `callbackUrl`.",
        "security": [],
        "parameters": [
          {
            "name": "vertical",
            "in": "path",
            "required": true,
            "description": "Vertical name (`accounting`, `crm`, `ecommerce`, `logistics`, `payments`, `docsign`, `projects`, `customer-support`, `inventory`).",
            "schema": {
              "$ref": "#/components/schemas/Vertical"
            }
          },
          {
            "name": "platform",
            "in": "path",
            "required": true,
            "description": "Adapter slug for the upstream platform (e.g. `fortnox`, `shopify`).",
            "schema": {
              "$ref": "#/components/schemas/PlatformSlug"
            }
          },
          {
            "name": "x-test-signature",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Upstream-defined payload, passed verbatim to the adapter handler. The examples below are **representative raw upstream payloads** — each platform defines its own shape, so these illustrate the kind of body to expect rather than a canonical schema.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              },
              "examples": {
                "payments.charge.succeeded": {
                  "summary": "Representative raw Stripe charge.succeeded payload",
                  "value": {
                    "id": "evt_1042",
                    "type": "charge.succeeded",
                    "created": 1768469400,
                    "data": {
                      "object": {
                        "id": "ch_1042",
                        "object": "charge",
                        "amount": 125000,
                        "currency": "usd",
                        "status": "succeeded",
                        "customer": "cus_4Qm2Xa9Lr",
                        "receipt_email": "jane.doe@acme.example"
                      }
                    }
                  }
                },
                "accounting.invoice.updated": {
                  "summary": "Representative raw Xero invoice.updated payload",
                  "value": {
                    "events": [
                      {
                        "resourceId": "inv_1042",
                        "eventCategory": "INVOICE",
                        "eventType": "UPDATE",
                        "eventDateUtc": "2026-02-01T14:20:00Z",
                        "tenantId": "acme"
                      }
                    ]
                  }
                },
                "crm.contact.created": {
                  "summary": "Representative raw HubSpot contact.created payload",
                  "value": [
                    {
                      "eventId": "whs_1042",
                      "subscriptionType": "contact.creation",
                      "occurredAt": 1768469400000,
                      "objectId": "cus_4Qm2Xa9Lr",
                      "propertyName": "email",
                      "propertyValue": "jane.doe@acme.example"
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "received",
                    "eventCount"
                  ],
                  "properties": {
                    "received": {
                      "type": "boolean"
                    },
                    "eventCount": {
                      "type": "integer",
                      "description": "Number of `WebhookEvent`s produced after fan-out. May exceed the upstream event count when a (platform, tenantId) matches multiple stored connections."
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "No webhook handler for (vertical, platform)",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/customers": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List customers",
        "description": "Returns customers owned by the tenant of the calling API key. Searchable by email, display name, or external reference. Requires scope `customers:read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Customer"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Create or upsert a customer",
        "description": "Idempotent on `(tenant, email)` — re-posting the same email returns the existing record with a 200 instead of erroring. Requires scope `customers:write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "displayName": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "externalReference": {
                    "type": "string",
                    "maxLength": 200
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Existing record returned (idempotent retry).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "201": {
            "description": "Customer created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1customers~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "UpdateById": {
                "operationRef": "#/paths/~1v1~1customers~1{id}/patch",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Update this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1v1~1customers~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ]
      }
    },
    "/customers/{id}": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "Get a customer",
        "description": "Requires scope `customers:read`. Pass `?include_pii=true` to additionally return the decrypted PII (firstName, lastName, phone, address, personalIdNumber); requires scope `customers:read_pii`. Each reveal writes a structured `pii_reveal` audit log line.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IncludePiiParam"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Customers"
        ],
        "summary": "Update a customer",
        "description": "Requires scope `customers:write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 200
                  },
                  "externalReference": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 200
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "Customers"
        ],
        "summary": "Delete a customer",
        "description": "Detaches the customer from any connect-link sessions and hard-deletes the record. By default linked connections are NOT revoked — pass `?cascade=connections` to also delete every connection this customer’s links produced, which drops their cached resources, sync history and external-account links (the standard connection-delete cascade). The provider-side OAuth grant is not called either way. Requires scope `customers:write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "name": "cascade",
            "in": "query",
            "description": "Pass `connections` to also delete this customer's connections and their derived state — the erasure-request shape.",
            "schema": {
              "type": "string",
              "enum": [
                "connections"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/customers/{id}/connections": {
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List a customer's connections",
        "description": "Returns every connection joined to this customer via a consumed Connect Link session. Requires scope `connections:read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Connection"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/customers/{id}/connect-links": {
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Create a hosted Connect Link for a customer",
        "description": "Returns a single-use, time-bound URL the customer opens to authorise an integration. When the customer completes the flow, the resulting connection is tagged back to this customer and visible at `GET /v1/customers/{id}/connections`. Requires scope `connect-links:write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "When `vertical` is supplied without `platform`, the customer can pick any enabled adapter in that vertical. When both are supplied, the link is pinned to a single adapter.",
                "properties": {
                  "label": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "vertical": {
                    "$ref": "#/components/schemas/Vertical"
                  },
                  "platform": {
                    "type": "string",
                    "description": "Adapter slug. See the `PlatformSlug` schema for the full list.",
                    "example": "fortnox"
                  },
                  "redirectUrl": {
                    "type": "string",
                    "format": "uri"
                  },
                  "expiresInSeconds": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 7776000,
                    "description": "TTL in seconds. Defaults to 7 days; capped at 90."
                  }
                }
              },
              "examples": {
                "pinned": {
                  "summary": "Pinned to a single adapter (Xero)",
                  "value": {
                    "vertical": "accounting",
                    "platform": "xero",
                    "label": "Acme onboarding"
                  }
                },
                "customerPicks": {
                  "summary": "Vertical only — customer chooses any enabled adapter",
                  "value": {
                    "vertical": "accounting"
                  }
                },
                "withRedirect": {
                  "summary": "Return the customer to your app when done",
                  "value": {
                    "vertical": "accounting",
                    "redirectUrl": "https://app.acme.example/done"
                  }
                },
                "oneTime": {
                  "summary": "Single-use link — consumed after one connection",
                  "value": {
                    "vertical": "accounting",
                    "oneTimeOnly": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Link created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ConnectLink"
                    }
                  }
                },
                "examples": {
                  "active": {
                    "summary": "Active link returned to send to the customer",
                    "value": {
                      "data": {
                        "id": "cl_8f3a2b9c4d",
                        "token": "cl_8f3a2b9c4d",
                        "url": "https://connect.northwind.example/cl_8f3a2b9c4d",
                        "label": "Acme onboarding",
                        "endUserId": "cus_4Qm2Xa9Lr",
                        "allowedVerticals": [
                          "accounting"
                        ],
                        "allowedPlatforms": [
                          {
                            "vertical": "accounting",
                            "slug": "xero"
                          }
                        ],
                        "redirectUrl": "https://app.acme.example/done",
                        "expiresAt": 1769955600000,
                        "consumedAt": null,
                        "connectionId": null,
                        "status": "active"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "description": "Customer not found",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      }
    },
    "/connections": {
      "get": {
        "tags": [
          "Connections"
        ],
        "summary": "List your tenant's connections",
        "description": "Returns connections owned by your tenant — i.e. connections that landed via a Connect Link spawned for one of your customers. Connections created out-of-band via admin tooling carry no owner tenant and are not returned here. Requires scope `connections:read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "vertical",
            "in": "query",
            "description": "Filter to one vertical.",
            "schema": {
              "$ref": "#/components/schemas/Vertical"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "description": "Filter to one adapter, by slug. See the `PlatformSlug` schema or `GET /v1/platforms` for valid values.",
            "schema": {
              "type": "string",
              "example": "fortnox"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Connection"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Missing required scope",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      }
    },
    "/connections/{id}": {
      "get": {
        "tags": [
          "Connections"
        ],
        "summary": "Get a connection",
        "description": "Cross-tenant lookups return 404 (not 403) so the caller cannot probe for other tenants' ids. Requires scope `connections:read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Connection"
                    }
                  }
                },
                "examples": {
                  "active": {
                    "summary": "Active — tokens valid",
                    "value": {
                      "data": {
                        "id": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90",
                        "vertical": "accounting",
                        "platform": "xero",
                        "tenantId": "acme",
                        "ownerTenantId": "acme",
                        "label": "Acme — Xero",
                        "status": "active",
                        "expiresAt": "2026-02-01T14:20:00Z",
                        "createdAt": "2026-01-15T09:30:00Z",
                        "updatedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  },
                  "expired": {
                    "summary": "Expired — access token lapsed, refresh needed",
                    "value": {
                      "data": {
                        "id": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90",
                        "vertical": "accounting",
                        "platform": "xero",
                        "tenantId": "acme",
                        "ownerTenantId": "acme",
                        "label": "Acme — Xero",
                        "status": "expired",
                        "expiresAt": "2026-02-01T14:20:00Z",
                        "createdAt": "2026-01-15T09:30:00Z",
                        "updatedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  },
                  "revoked": {
                    "summary": "Revoked — connection deactivated",
                    "value": {
                      "data": {
                        "id": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90",
                        "vertical": "accounting",
                        "platform": "xero",
                        "tenantId": "acme",
                        "ownerTenantId": "acme",
                        "label": "Acme — Xero",
                        "status": "revoked",
                        "expiresAt": null,
                        "createdAt": "2026-01-15T09:30:00Z",
                        "updatedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "patch": {
        "tags": [
          "Connections"
        ],
        "summary": "Rename a connection",
        "description": "Body: `{ \"label\": \"<new>\" | null }`. Requires scope `connections:write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "label"
                ],
                "properties": {
                  "label": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Connection"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Duplicate label for (vertical, platform, tenant)",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "retry-after": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Connections"
        ],
        "summary": "Delete a connection",
        "description": "Removes the connection row. Does NOT call the upstream platform to revoke OAuth tokens — issue a platform-side revoke separately if needed. Requires scope `connections:write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/events": {
      "get": {
        "tags": [
          "Events"
        ],
        "operationId": "events.list",
        "summary": "List inbound events",
        "description": "Returns verified inbound platform webhook events for your tenant in `seq` order (oldest first). `seq` is monotonic, so paging with `after_seq` = the previous page's `meta.next_cursor` pulls only new events with no clock-skew gaps. Requires scope `events:read`. In test mode (`/test/v1/events`) the stream is a small deterministic synthetic set.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "after_seq",
            "in": "query",
            "description": "Return only events with `seq` greater than this. Pass the previous page's `meta.next_cursor`. Omit (or `0`) to start from the beginning.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0,
              "example": 0
            }
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InboundEvent"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "required": [
                        "next_cursor",
                        "count"
                      ],
                      "properties": {
                        "next_cursor": {
                          "type": "integer",
                          "format": "int64",
                          "description": "Highest `seq` in this page (equals `after_seq` when the page is empty). Pass it back as `after_seq` to poll.",
                          "example": 2
                        },
                        "count": {
                          "type": "integer",
                          "example": 2
                        },
                        "fetchedAt": {
                          "$ref": "#/components/schemas/ISO8601"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Missing required scope (`events:read`)",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      }
    },
    "/{vertical}/sync": {
      "post": {
        "tags": [
          "Sync"
        ],
        "summary": "Enqueue a background sync job",
        "description": "Walks the vertical's listable resources for the given connection and bulk-upserts canonical rows into the local cache. Returns 409 with the existing job if one is already pending or running for the same connection. Returns 404 in `passthrough` mode (route not mounted).\n\n**Scope.** A sync only fills the local cache and never writes upstream, so the touch axis alone is enough — `vertical:{vertical}` or `vertical:read`. `vertical:write` is NOT required.\n\n**Unless you send `callback_url`.** Supplying one makes the deployment issue an outbound POST of its own when the job finishes, which is a different authority from refreshing your cache, so it additionally requires `vertical:write`. A key without that scope gets `403 INSUFFICIENT_SCOPE`.\n\nIf you do not need a callback, send an empty JSON object as the body. The body is optional, but an empty one is not: the server rejects a request that sets `Content-Type: application/json` and sends nothing with `400 Body cannot be empty when content-type is set to 'application/json'` — and this console, like most REST clients, always sets that header. So send `{}` (or omit both the body and the header):\n\n```sh\ncurl -X POST -H \"Authorization: Bearer $KEY\" -H \"Content-Type: application/json\" \\\n  \"$BASE/v1/{vertical}/sync?connection_id=<uuid>\" -d '{}'\n```\n\nA `callback_url` must be `https`, carry no embedded credentials, and must not resolve to a loopback, private or link-local address; it is validated when the job is enqueued (`400 INVALID_CALLBACK_URL`) and re-resolved immediately before the callback is sent.\n\n**In the sandbox** (`/test/v1/{vertical}/sync`, test keys) the job lifecycle is simulated: it walks pending → running → completed over ~2s (`?fast=true` completes before the response returns), completion seeds a couple of fresh fixture rows per resource type so a re-poll sees new data, and `callback_url` is validated and stored but **never dialed** — the sandbox makes no outbound requests; poll `GET /sync/{jobId}` instead. The tighter 10/hour budget applies only to live syncs.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "vertical",
            "in": "path",
            "required": true,
            "description": "Vertical name (`accounting`, `crm`, `ecommerce`, `logistics`, `payments`, `docsign`, `projects`, `customer-support`, `inventory`).",
            "schema": {
              "$ref": "#/components/schemas/Vertical"
            }
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "callback_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Optional URL to POST `sync.completed` / `sync.failed` events to. Retries up to 3× with exponential backoff. Requires the `vertical:write` scope — omit it (send `{}`) if your key is read-only. Must be https, carry no credentials, and not resolve to a loopback, private or link-local address."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Job accepted (status `pending`).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SyncJob"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "description": "Vertical unknown or `passthrough` mode — sync routes not mounted.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "409": {
            "description": "A pending or running sync already exists for this connection. The body returns the existing `SyncJob`.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "retry-after": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Sync"
        ],
        "summary": "List sync jobs for one connection",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "vertical",
            "in": "path",
            "required": true,
            "description": "Vertical name (`accounting`, `crm`, `ecommerce`, `logistics`, `payments`, `docsign`, `projects`, `customer-support`, `inventory`).",
            "schema": {
              "$ref": "#/components/schemas/Vertical"
            }
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by job status.",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "running",
                "completed",
                "failed"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SyncJob"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "description": "Missing required scope.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      }
    },
    "/{vertical}/sync/{jobId}": {
      "get": {
        "tags": [
          "Sync"
        ],
        "summary": "Get a sync job by id",
        "description": "Fetch one sync job. `connection_id` is required even though `jobId` identifies the job on its own: every `/v1/{vertical}/*` route is gated by the unified auth middleware, which resolves the connection before routing in order to determine the platform adapter and to verify the connection belongs to the caller's tenant. The handler additionally 404s a job that belongs to a different connection, so a job id from another connection cannot be probed.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "vertical",
            "in": "path",
            "required": true,
            "description": "Vertical name (`accounting`, `crm`, `ecommerce`, `logistics`, `payments`, `docsign`, `projects`, `customer-support`, `inventory`).",
            "schema": {
              "$ref": "#/components/schemas/Vertical"
            }
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SyncJob"
                    }
                  }
                },
                "examples": {
                  "pending": {
                    "summary": "Queued — worker has not started yet",
                    "value": {
                      "data": {
                        "id": "sync_1042",
                        "vertical": "accounting",
                        "connectionId": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90",
                        "platform": "xero",
                        "tenantId": "acme",
                        "callbackUrl": "https://hooks.acme.example/sync",
                        "createdAt": "2026-01-15T09:30:00Z",
                        "status": "pending",
                        "progress": null,
                        "error": null,
                        "startedAt": null,
                        "completedAt": null
                      }
                    }
                  },
                  "running": {
                    "summary": "In flight — some resources synced, others still pending",
                    "value": {
                      "data": {
                        "id": "sync_1042",
                        "vertical": "accounting",
                        "connectionId": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90",
                        "platform": "xero",
                        "tenantId": "acme",
                        "callbackUrl": "https://hooks.acme.example/sync",
                        "createdAt": "2026-01-15T09:30:00Z",
                        "status": "running",
                        "progress": {
                          "invoices": {
                            "synced": 128,
                            "status": "completed"
                          },
                          "contacts": {
                            "synced": 64,
                            "status": "running"
                          },
                          "bills": {
                            "synced": 0,
                            "status": "pending"
                          }
                        },
                        "error": null,
                        "startedAt": "2026-01-15T09:30:00Z",
                        "completedAt": null
                      }
                    }
                  },
                  "completed": {
                    "summary": "Finished — every resource synced",
                    "value": {
                      "data": {
                        "id": "sync_1042",
                        "vertical": "accounting",
                        "connectionId": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90",
                        "platform": "xero",
                        "tenantId": "acme",
                        "callbackUrl": "https://hooks.acme.example/sync",
                        "createdAt": "2026-01-15T09:30:00Z",
                        "status": "completed",
                        "progress": {
                          "invoices": {
                            "synced": 128,
                            "status": "completed"
                          },
                          "contacts": {
                            "synced": 64,
                            "status": "completed"
                          },
                          "bills": {
                            "synced": 42,
                            "status": "completed"
                          }
                        },
                        "error": null,
                        "startedAt": "2026-01-15T09:30:00Z",
                        "completedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  },
                  "failed": {
                    "summary": "Aborted — upstream error surfaced on the job",
                    "value": {
                      "data": {
                        "id": "sync_1042",
                        "vertical": "accounting",
                        "connectionId": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90",
                        "platform": "xero",
                        "tenantId": "acme",
                        "callbackUrl": "https://hooks.acme.example/sync",
                        "createdAt": "2026-01-15T09:30:00Z",
                        "status": "failed",
                        "progress": {
                          "invoices": {
                            "synced": 128,
                            "status": "completed"
                          },
                          "contacts": {
                            "synced": 0,
                            "status": "failed",
                            "error": "rate limited by upstream"
                          }
                        },
                        "error": "rate limited by upstream",
                        "startedAt": "2026-01-15T09:30:00Z",
                        "completedAt": "2026-02-01T14:20:00Z"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "404": {
            "description": "Job not found or owned by a different tenant.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      }
    },
    "/admin/api-keys": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "List developer API keys",
        "description": "Lists every key (active + revoked) optionally filtered by tenant. Admin-only — proxied through admin-api as `/api/api-keys`.",
        "security": [],
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApiKey"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "post": {
        "tags": [
          "Admin"
        ],
        "summary": "Mint a developer API key",
        "description": "Returns the plaintext key exactly once in `data.plaintext`. Optional `scopes` array narrows the key; default is `[\"*\"]`.",
        "security": [],
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "tenantId"
                ],
                "properties": {
                  "tenantId": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ApiKeyMint"
                    }
                  }
                }
              }
            },
            "links": {
              "DeleteById": {
                "operationRef": "#/paths/~1admin~1api-keys~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/admin/api-keys/{id}": {
      "delete": {
        "tags": [
          "Admin"
        ],
        "summary": "Revoke a developer API key",
        "security": [],
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/webhook-subscriptions": {
      "get": {
        "tags": [
          "Webhook subscriptions"
        ],
        "operationId": "webhook-subscriptions.list",
        "summary": "List your tenant's webhook subscriptions",
        "description": "Requires scope `webhooks:read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookSubscription"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Missing required scope",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Webhook subscriptions"
        ],
        "operationId": "webhook-subscriptions.create",
        "summary": "Create a webhook subscription (secret returned once)",
        "description": "Registers an HTTPS endpoint for your tenant’s events without an operator round-trip. Requires scope `webhooks:write`. The response carries the plaintext signing secret exactly once — receivers verify `X-OI-Signature` by HMAC-SHA256-ing the raw body with it. The subscription is pinned to the tenant on your key; there is no `tenantId` field. Destination URLs are SSRF-guarded (public `https` hosts only), and one tenant may hold at most 20 subscriptions (`403 WEBHOOK_SUB_QUOTA_EXCEEDED`).",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "label": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 200,
                    "example": "Billing service"
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Event names to receive. Use `*` (or omit) for all, exact names, or prefix wildcards like `customer.*`.",
                    "example": [
                      "customer.created"
                    ]
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "opensteward",
                      "slack",
                      "teams",
                      "flat"
                    ],
                    "description": "Payload shape. Defaults to `opensteward`, the signed event envelope."
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Custom headers sent with every delivery. Stored encrypted, never returned. Reserved names rejected: `x-oi-*`, `host`, `content-*`, hop-by-hop."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookSubscriptionWithSecret"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1v1~1webhook-subscriptions~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "UpdateById": {
                "operationRef": "#/paths/~1v1~1webhook-subscriptions~1{id}/patch",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Update this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1v1~1webhook-subscriptions~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Missing required scope, or subscription quota exceeded",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ]
      }
    },
    "/webhook-subscriptions/{id}": {
      "get": {
        "tags": [
          "Webhook subscriptions"
        ],
        "operationId": "webhook-subscriptions.get",
        "summary": "Get one of your webhook subscriptions",
        "description": "Cross-tenant lookups return 404 (not 403) so ids cannot be probed. Requires scope `webhooks:read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookSubscription"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Missing required scope",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "patch": {
        "tags": [
          "Webhook subscriptions"
        ],
        "operationId": "webhook-subscriptions.update",
        "summary": "Update format, headers or label",
        "description": "`url` and `events` stay immutable, as on the operator surface — this exists so a header credential can be rotated or a subscription renamed without losing its delivery history. Requires scope `webhooks:write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "format": {
                    "type": "string",
                    "enum": [
                      "opensteward",
                      "slack",
                      "teams",
                      "flat"
                    ]
                  },
                  "headers": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Replace the custom header set; null clears it."
                  },
                  "label": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 200
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookSubscription"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Missing required scope",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "Webhook subscriptions"
        ],
        "operationId": "webhook-subscriptions.delete",
        "summary": "Delete a webhook subscription",
        "description": "Requires scope `webhooks:write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Missing required scope",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/webhook-subscriptions/{id}/test": {
      "post": {
        "tags": [
          "Webhook subscriptions"
        ],
        "operationId": "webhook-subscriptions.test",
        "summary": "Send one synthetic delivery",
        "description": "Proves a destination works without creating real data. Synchronous, never queued, never retried; a receiver rejection is reported as a result, not an error. Requires scope `webhooks:write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Delivery attempted — `data.ok` says whether the receiver accepted it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "ok": {
                          "type": "boolean"
                        },
                        "status": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "format": {
                          "type": "string"
                        },
                        "sentBody": {
                          "type": "string"
                        },
                        "error": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Missing required scope",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/webhook-subscriptions/{id}/paused": {
      "post": {
        "tags": [
          "Webhook subscriptions"
        ],
        "operationId": "webhook-subscriptions.set-paused",
        "summary": "Pause or resume deliveries",
        "description": "Retains the subscription but stops deliveries while paused. Body `{ \"paused\": false }` resumes; omitting the body pauses. Requires scope `webhooks:write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "paused": {
                    "type": "boolean",
                    "default": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Missing required scope",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/webhook-subscriptions/{id}/rotate-secret": {
      "post": {
        "tags": [
          "Webhook subscriptions"
        ],
        "operationId": "webhook-subscriptions.rotate-secret",
        "summary": "Rotate the signing secret (returned once)",
        "description": "Mints a new shared secret and returns it exactly once. Deliveries sign with the new secret immediately — update the receiver first. Requires scope `webhooks:write`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "200": {
            "description": "New secret returned",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Missing required scope",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/webhook-subscriptions/{id}/deliveries": {
      "get": {
        "tags": [
          "Webhook subscriptions"
        ],
        "operationId": "webhook-subscriptions.deliveries",
        "summary": "One subscription's delivery log",
        "description": "Recent deliveries with status, attempt count and receiver response — the first place to look when events stop arriving. Requires scope `webhooks:read`.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "delivered",
                "dead"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Missing required scope",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/admin/webhook-subscriptions": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "List outbound webhook subscriptions",
        "security": [],
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookSubscription"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "post": {
        "tags": [
          "Admin"
        ],
        "summary": "Create a webhook subscription",
        "description": "Returns the plaintext shared secret exactly once. Receivers verify the `X-OI-Signature` header by HMAC-SHA256-ing the raw request body with this secret.",
        "security": [],
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "tenantId",
                  "url"
                ],
                "properties": {
                  "tenantId": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "label": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 200,
                    "description": "Optional human-friendly name for the subscription. Purely descriptive; a blank string is stored as null.",
                    "example": "Billing service"
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Event names to receive. Use `*` (or omit) for all, exact event names, or prefix wildcards like `customer.*`.",
                    "example": [
                      "customer.created"
                    ]
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "opensteward",
                      "slack",
                      "teams",
                      "flat"
                    ],
                    "description": "Payload shape for this endpoint. Defaults to `opensteward`, the signed event envelope. Choose `slack` for a Slack incoming-webhook URL, `teams` for a Teams Workflows (Power Automate) URL, or `flat` for a tool that only maps top-level fields. The signature always covers the rendered bytes, whichever shape is sent.",
                    "example": "slack"
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Custom headers sent with every delivery, for a receiver that authenticates by header. Stored encrypted and never returned. Reserved names are rejected: `x-oi-*` (they carry the signature), `host`, `content-*`, and hop-by-hop headers. At most 10 headers, 4096 bytes in total; CR, LF and non-ASCII characters are rejected rather than stripped.",
                    "example": {
                      "X-Api-Key": "k-123"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookSubscriptionWithSecret"
                    }
                  }
                }
              }
            },
            "links": {
              "UpdateById": {
                "operationRef": "#/paths/~1admin~1webhook-subscriptions~1{id}/patch",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Update this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1admin~1webhook-subscriptions~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "callbacks": {
          "webhookDelivery": {
            "{$request.body#/url}": {
              "post": {
                "summary": "Webhook delivery (server → subscriber)",
                "description": "When any tenant-scoped event matches this subscription's `events` filter, the integration-server POSTs the canonical `WebhookEvent` payload to the URL captured at create time. Each request includes `X-OI-Signature: sha256=<hex>` — verify by HMAC-SHA256-ing the raw request body with the `secret` returned from the 201 response above. Retries follow exponential backoff via the deliveries table; inspect via `GET /admin/webhook-subscriptions/{id}/deliveries`. Subscriber must respond with 2xx within 10s; any other status (or timeout) is retried.",
                "requestBody": {
                  "required": true,
                  "content": {
                    "application/json": {
                      "schema": {
                        "$ref": "#/components/schemas/WebhookEvent"
                      }
                    }
                  }
                },
                "responses": {
                  "2XX": {
                    "description": "Subscriber acknowledged receipt — delivery marked succeeded."
                  },
                  "default": {
                    "description": "Any non-2xx response is treated as a delivery failure and queued for retry."
                  }
                }
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/admin/webhook-subscriptions/{id}": {
      "patch": {
        "tags": [
          "Admin"
        ],
        "summary": "Change a webhook subscription label, payload format or headers",
        "description": "Changes the label, and how deliveries are shaped and authenticated. The URL and event list are immutable — recreate the subscription to change those. Headers are replaced wholesale rather than merged, so a header can be removed; an empty object or null clears them. Header values are never returned.",
        "security": [],
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "format": {
                    "type": "string",
                    "enum": [
                      "opensteward",
                      "slack",
                      "teams",
                      "flat"
                    ],
                    "description": "New payload shape for this endpoint.",
                    "example": "slack"
                  },
                  "headers": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Replaces the custom headers wholesale. An empty object or null removes them all.",
                    "example": {
                      "X-Api-Key": "k-456"
                    }
                  },
                  "label": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 200,
                    "description": "New human-friendly name. Null or a blank string clears it; omit the field to leave it unchanged.",
                    "example": "Billing service"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookSubscription"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "Admin"
        ],
        "summary": "Delete a webhook subscription",
        "security": [],
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/admin/webhook-subscriptions/{id}/test": {
      "post": {
        "tags": [
          "Admin"
        ],
        "summary": "Send a test event to a webhook subscription",
        "description": "Sends one synthetic `opensteward.test` event, rendered in the subscription's own format, signed with its own secret and carrying its custom headers — so a destination can be proven to work without creating real data to trigger a real event. Nothing is queued and no delivery row is written, so a failed test is never retried and the delivery history stays a record of real events. A receiver that rejects the payload is reported as `ok: false` with its status; that is the answer to the question, not an API error. Works on a paused subscription.",
        "security": [],
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Test attempted — inspect `ok` for the outcome",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookTestResult"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/admin/webhook-subscriptions/{id}/deliveries": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "List webhook delivery attempts",
        "description": "Each row represents one (subscription × event) attempt. Failed deliveries retry with exponential backoff (`5s, 30s, 2m, 10m, 30m, 2h`) and dead-letter after 8 attempts.",
        "security": [],
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "delivered",
                "dead"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookDelivery"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/admin/webhook-subscriptions/{id}/deliveries/{deliveryId}/replay": {
      "post": {
        "tags": [
          "Admin"
        ],
        "summary": "Replay a dead-lettered delivery",
        "description": "Resets the delivery to `pending` with `attempts=0` so the next worker tick picks it up. Receivers see the same `X-OI-Event-Id` so they can dedupe.",
        "security": [],
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "name": "deliveryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "202": {
            "description": "Replay scheduled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/WebhookDelivery"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Delivery not found",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/admin/platforms/{vertical}/{slug}/config": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "Read a platform's config (redacted)",
        "description": "Returns the platform's stored config with `clientSecret` removed and replaced by a `hasSecret: bool`. Used by the admin UI to prefill non-secret fields without ever re-handling the secret.",
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vertical",
            "in": "path",
            "required": true,
            "description": "Vertical name (`accounting`, `crm`, `ecommerce`, `logistics`, `payments`, `docsign`, `projects`, `customer-support`, `inventory`).",
            "schema": {
              "$ref": "#/components/schemas/Vertical"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Adapter slug.",
            "schema": {
              "$ref": "#/components/schemas/PlatformSlug"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "clientId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "redirectUri": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "scopes": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          }
                        },
                        "hasSecret": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Unknown platform",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Admin"
        ],
        "summary": "Replace a platform's config",
        "description": "Merges the provided config object with the stored config — fields not present in the body are kept. Pass `null` to clear a key. The platform is re-instantiated with the new config if it's currently enabled.",
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vertical",
            "in": "path",
            "required": true,
            "description": "Vertical name (`accounting`, `crm`, `ecommerce`, `logistics`, `payments`, `docsign`, `projects`, `customer-support`, `inventory`).",
            "schema": {
              "$ref": "#/components/schemas/Vertical"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Adapter slug.",
            "schema": {
              "$ref": "#/components/schemas/PlatformSlug"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "config"
                ],
                "properties": {
                  "config": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Unknown platform",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/admin/sync-jobs": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "List sync jobs across every vertical",
        "description": "Cross-tenant view. Tenant clients should use `GET /v1/{vertical}/sync` instead.",
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vertical",
            "in": "query",
            "description": "Filter to one vertical.",
            "schema": {
              "$ref": "#/components/schemas/Vertical"
            }
          },
          {
            "$ref": "#/components/parameters/ConnectionIdParam"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "running",
                "completed",
                "failed"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SyncJob"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "post": {
        "tags": [
          "Admin"
        ],
        "summary": "Enqueue a sync job (operator)",
        "description": "Operator alternative to `POST /v1/{vertical}/sync` (which is tenant-scoped). Resolves the vertical from the connection record, so only `connection_id` is required.",
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "connection_id"
                ],
                "properties": {
                  "connection_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "callback_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Optional URL to POST sync.completed / sync.failed events to."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Job accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SyncJob"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Connection not found.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "409": {
            "description": "A pending or running sync already exists for this connection.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "retry-after": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/admin/sync-jobs/{id}": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "Get a sync job by id (operator)",
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SyncJob"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Sync job not found.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/admin/sync-jobs/{id}/cancel": {
      "post": {
        "tags": [
          "Admin"
        ],
        "summary": "Cancel a sync job",
        "description": "Marks the job failed with reason \"cancelled by admin\". Running workers see the status flip on next progress write and abort. Already-completed / already-failed jobs return 409.",
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SyncJob"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Sync job not found.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "409": {
            "description": "Job is already completed or failed.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "retry-after": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/admin/end-users": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "List end-users (operator)",
        "description": "Cross-tenant view of every Connect Link end-user. Tenant-scoped clients use `GET /v1/customers` instead.",
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Free-text search on email / displayName / externalReference."
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Customer"
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "post": {
        "tags": [
          "Admin"
        ],
        "summary": "Create an end-user (operator)",
        "description": "Cross-tenant admin path. Tenant clients should use `POST /v1/customers`.",
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "tenantId",
                  "email"
                ],
                "properties": {
                  "tenantId": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "displayName": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "externalReference": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1admin~1end-users~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "UpdateById": {
                "operationRef": "#/paths/~1admin~1end-users~1{id}/patch",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Update this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1admin~1end-users~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/admin/end-users/{id}": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "Get an end-user with linked sessions + connections",
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IncludePiiParam"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "patch": {
        "tags": [
          "Admin"
        ],
        "summary": "Update end-user fields (operator)",
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "externalReference": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "pii": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "Admin"
        ],
        "summary": "Delete an end-user",
        "description": "Detaches any linked Connect Link sessions; does NOT delete connections. Operator-only.",
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/admin/connect-sessions": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "List Connect Link sessions",
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenantId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endUserId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "consumed",
                "revoked",
                "expired"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/LimitParam"
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "post": {
        "tags": [
          "Admin"
        ],
        "summary": "Create a Connect Link session (operator)",
        "description": "Operator path; tenant clients should use `POST /v1/customers/{id}/connect-links`. Upserts the customer if `customerEmail` is provided and no `endUserId` is set.",
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "tenantId"
                ],
                "properties": {
                  "tenantId": {
                    "type": "string"
                  },
                  "endUserId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "customerEmail": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "email"
                  },
                  "allowedVerticals": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Vertical"
                    }
                  },
                  "allowedPlatforms": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "vertical": {
                          "$ref": "#/components/schemas/Vertical"
                        },
                        "slug": {
                          "type": "string",
                          "description": "Adapter slug. See the `PlatformSlug` schema for the full list.",
                          "example": "fortnox"
                        }
                      }
                    }
                  },
                  "redirectUrl": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uri"
                  },
                  "expiresInSeconds": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "createdBy": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            },
            "links": {
              "GetById": {
                "operationRef": "#/paths/~1admin~1connect-sessions~1{id}/get",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Fetch this resource by its `id`."
              },
              "DeleteById": {
                "operationRef": "#/paths/~1admin~1connect-sessions~1{id}/delete",
                "parameters": {
                  "id": "$response.body#/data/id"
                },
                "description": "Delete this resource by its `id`."
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/admin/connect-sessions/{id}": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "Get a Connect Link session with linked customer + connection",
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdParam"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "Admin"
        ],
        "summary": "Revoke a Connect Link session",
        "description": "Marks the session revoked; existing connections that landed via the session are unaffected.",
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/admin/connections/{id}/cache-clear": {
      "post": {
        "tags": [
          "Admin"
        ],
        "summary": "Drop cached resources for a connection",
        "description": "Removes the `resources` cache rows owned by this connection without deleting the connection itself. Useful after a manual upstream data fix or to recover from cache drift. The next `/v1/{vertical}/*` GET re-populates from upstream. No-op in `passthrough` mode.",
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "responses": {
          "200": {
            "description": "Cache cleared",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Connection not found.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "409": {
            "description": "Connection has no `vertical` set.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "retry-after": {
                "$ref": "#/components/headers/RetryAfter"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    },
    "/admin/connections/{id}/sync-schedule": {
      "put": {
        "tags": [
          "Admin"
        ],
        "summary": "Set a connection's sync schedule (operator)",
        "description": "Replaces how often the connection's data is re-synced. `default` follows the deployment interval (the `data_store.sync.default_interval_minutes` runtime setting, 6 hours out of the box); `custom` syncs every `intervalMinutes` (15 minutes to 30 days, and only with `custom`); `trigger_only` never syncs automatically; `once` gives one automatic sync when connected. The reply carries the connection with its recomputed `sync` state, including the next sync time. In `passthrough` mode the schedule is stored but nothing syncs, and `sync` is null.",
        "parameters": [
          {
            "name": "X-Admin-Secret",
            "in": "header",
            "required": false,
            "description": "Required when ADMIN_SECRET is set on the server.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdParam"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKeyParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SyncSchedule"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdminConnection"
                    }
                  }
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "idempotency-replayed": {
                "$ref": "#/components/headers/IdempotencyReplayed"
              }
            }
          },
          "400": {
            "description": "`INVALID_SYNC_SCHEDULE` — an unknown mode, a `custom` schedule without `intervalMinutes`, an interval outside 15–43200, or an interval on any other mode.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          },
          "404": {
            "description": "`CONNECTION_NOT_FOUND`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "x-ratelimit-limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "x-ratelimit-remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "x-ratelimit-reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            }
          }
        }
      },
      "servers": [
        {
          "url": "{scheme}://{host}:{port}",
          "description": "OpenSteward deployment (unversioned paths)",
          "variables": {
            "scheme": {
              "default": "http",
              "enum": [
                "http",
                "https"
              ],
              "description": "HTTP scheme — http for local dev, https for deployed."
            },
            "host": {
              "default": "localhost",
              "enum": [
                "localhost"
              ],
              "description": "Hostname of the deployment (no port)."
            },
            "port": {
              "default": "3010",
              "enum": [
                "3010"
              ],
              "description": "Port as a string. Use \"443\" for https, \"80\" for http."
            }
          }
        }
      ],
      "x-opensteward-servers": "unversioned"
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "code",
          "description"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Machine-readable error code (e.g. `invalid_request`, `not_found`, `upstream_unavailable`).",
            "example": "not_found"
          },
          "description": {
            "type": "string",
            "description": "Human-readable explanation of what went wrong.",
            "example": "No connection found for the given id."
          },
          "type": {
            "type": "string",
            "description": "Error category (e.g. `validation`, `auth`, `upstream`, `internal`).",
            "example": "upstream"
          },
          "correlationId": {
            "type": "string",
            "description": "Request trace id; quote this when contacting support.",
            "example": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90"
          },
          "details": {
            "type": "object",
            "additionalProperties": true,
            "description": "Structured per-error context (e.g. failing field name). MUST include the full upstream error verbatim under `details.upstream` when the failure originated from an upstream platform call — preserves status code, body, headers, and any provider-specific error envelope so callers can debug without re-fetching.",
            "example": {
              "upstream": {
                "status": 404,
                "body": "Not Found"
              }
            },
            "properties": {
              "upstream": {
                "description": "Verbatim upstream error payload (raw provider response). Present when the failure came from an upstream platform call; omitted otherwise.",
                "example": {
                  "status": 404,
                  "body": "Not Found"
                },
                "oneOf": [
                  {
                    "type": "object",
                    "additionalProperties": true
                  },
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          }
        }
      },
      "Vertical": {
        "type": "string",
        "enum": [
          "accounting",
          "crm",
          "ecommerce",
          "logistics",
          "payments",
          "docsign",
          "projects",
          "customer-support",
          "inventory"
        ],
        "description": "One of the nine verticals OpenSteward maps to a canonical API. Determines which adapters, resources and webhook events apply.",
        "example": "accounting"
      },
      "E164": {
        "type": "string",
        "pattern": "^\\+[1-9]\\d{1,14}$",
        "description": "ITU-T E.164 international phone number — leading `+`, country code, subscriber number; 15 digits max, no spaces or formatting (e.g. `+14155552671`).",
        "example": "+14155550123"
      },
      "MIME": {
        "type": "string",
        "pattern": "^[a-z]+/[a-zA-Z0-9.+_-]+$",
        "description": "RFC 6838 media type identifier — lowercase top-level type, slash, subtype (e.g. `application/pdf`, `image/png`, `text/csv`).",
        "example": "application/pdf"
      },
      "Currency": {
        "$ref": "#/components/schemas/ISO4217",
        "description": "A currency, identified by its ISO 4217 three-letter code. Thin alias over `ISO4217` — kept as a named schema so `Money.currency` reads naturally and the layer can grow later if display metadata (symbol, name) is ever needed.",
        "example": "USD"
      },
      "Money": {
        "type": "object",
        "required": [
          "amount",
          "currency"
        ],
        "description": "Monetary value with explicit currency. `amount` is a decimal number in the currency's major unit; integer-minor-unit conversions happen at the edge of the application.",
        "properties": {
          "amount": {
            "type": "number",
            "minimum": 0,
            "description": "Amount in the currency's major unit, non-negative.",
            "example": 1250
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          }
        }
      },
      "Address": {
        "type": "object",
        "description": "Postal address. All fields optional; populated as the upstream platform provides them.",
        "properties": {
          "line1": {
            "type": "string",
            "description": "Street address, line 1.",
            "example": "2500 Market Street"
          },
          "line2": {
            "type": "string",
            "description": "Street address, line 2 (unit, suite).",
            "example": "Suite 300"
          },
          "city": {
            "type": "string",
            "description": "City or locality.",
            "example": "San Francisco"
          },
          "region": {
            "type": "string",
            "description": "State, province, or region.",
            "example": "CA"
          },
          "postalCode": {
            "type": "string",
            "description": "ZIP or postal code.",
            "example": "94114"
          },
          "country": {
            "$ref": "#/components/schemas/ISO3166"
          }
        }
      },
      "Email": {
        "type": "object",
        "required": [
          "email"
        ],
        "description": "Email address with an optional usage label.",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "description": "RFC 5322 email address.",
            "example": "jane.doe@acme.example"
          },
          "type": {
            "type": "string",
            "enum": [
              "WORK",
              "HOME",
              "OTHER"
            ],
            "example": "WORK"
          }
        }
      },
      "Phone": {
        "type": "object",
        "required": [
          "telephone"
        ],
        "description": "Phone number with an optional usage label.",
        "properties": {
          "telephone": {
            "$ref": "#/components/schemas/E164"
          },
          "type": {
            "type": "string",
            "enum": [
              "WORK",
              "HOME",
              "MOBILE",
              "FAX",
              "OTHER"
            ],
            "example": "WORK"
          }
        }
      },
      "Attachment": {
        "type": "object",
        "description": "File attachment metadata.",
        "properties": {
          "id": {
            "type": "string",
            "example": "att_8Hn2Kq"
          },
          "filename": {
            "type": "string",
            "example": "invoice-2026-01.pdf"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Hosted file URL.",
            "example": "https://files.acme.example/invoice-2026-01.pdf"
          },
          "mimeType": {
            "$ref": "#/components/schemas/MIME"
          }
        }
      },
      "ListMeta": {
        "type": "object",
        "required": [
          "platform",
          "totalCount",
          "page",
          "limit",
          "hasMore",
          "fetchedAt"
        ],
        "description": "Pagination + provenance metadata returned alongside every `/v1/*` list response.",
        "properties": {
          "platform": {
            "type": "string",
            "description": "Source platform slug.",
            "example": "stripe"
          },
          "totalCount": {
            "type": "integer",
            "nullable": true,
            "description": "Total records upstream reports for this collection, or `null` when the platform reports no count. Most platforms report none, so `null` is the common answer.",
            "example": 42
          },
          "page": {
            "type": "integer",
            "description": "The 1-based page served. A missing `?page`, or one that is not a decimal number of at least 1, is page 1.",
            "example": 1
          },
          "limit": {
            "type": "integer",
            "description": "Page size the server asked the platform for: the requested `limit` capped at 500 and at the platform's declared page maximum, or the smaller size one endpoint of the platform takes. `data` never exceeds it — the server truncates and logs if an adapter over-returns, so this always describes the payload.",
            "example": 25
          },
          "hasMore": {
            "type": "boolean",
            "nullable": true,
            "description": "Whether another page exists, from an upstream count, the platform's own next-page signal, or a page shorter than `limit`. A page can be shorter than `limit` and still report `true`, so page by this rather than by the row count. `null` when it is genuinely undecidable — a full page with no upstream count is indistinguishable from a collection that is an exact multiple of the page size. Never guessed.",
            "example": true
          },
          "fetchedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          }
        }
      },
      "SingleMeta": {
        "type": "object",
        "required": [
          "platform",
          "fetchedAt"
        ],
        "description": "Provenance metadata returned alongside every `/v1/*` single-resource response.",
        "properties": {
          "platform": {
            "type": "string",
            "description": "Source platform slug.",
            "example": "stripe"
          },
          "fetchedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          }
        }
      },
      "PlatformSlug": {
        "type": "string",
        "enum": [
          "123loadboard",
          "17track",
          "1centerprise",
          "1crm",
          "2c2p",
          "3plcentral",
          "a-trust",
          "a2x",
          "abacus-ch",
          "abraflexi",
          "accelo",
          "access-financials",
          "acconomy",
          "accountable",
          "accountedge",
          "accounteer",
          "accountingseed",
          "accountsiq",
          "accountsportal",
          "acctivate",
          "accurate",
          "act-crm",
          "actasign",
          "activecampaign",
          "activecollab",
          "acumatica",
          "acumatica-inventory",
          "ada-cx",
          "adobe-acrobat-sign",
          "advance-pro",
          "adyen",
          "afas",
          "affinity",
          "affirm",
          "afterpay",
          "aftership",
          "agendor",
          "agilecrm",
          "agiliron",
          "agiloft",
          "aha",
          "aimeos",
          "airtable",
          "airwallex",
          "aisino",
          "akaunting",
          "alegra",
          "alibaba",
          "allegro",
          "amanote",
          "amazon-mcf",
          "amazon-pay",
          "amazon-payment-services",
          "amazon-shipping",
          "amazon-sp",
          "amazon-sp-api",
          "andreani",
          "anfix",
          "ankorstore",
          "annature",
          "anvil",
          "apc-overnight",
          "apexx",
          "apicbase",
          "apollo",
          "appfolio",
          "apptivo",
          "aramex",
          "aramex-au",
          "aramex-me",
          "arcbest",
          "artia",
          "aruba",
          "asaas",
          "asana",
          "asendia",
          "assently",
          "asset-panda",
          "atome",
          "attio",
          "auspost",
          "autenti",
          "autentique",
          "authorize-net",
          "autocount",
          "avaza",
          "averitt",
          "avidxchange",
          "awork",
          "axonaut",
          "aymakan",
          "azul-cargo",
          "backlog",
          "bagisto",
          "bagy",
          "bambora",
          "barantum",
          "base-ec",
          "basecamp",
          "baserow",
          "belvo",
          "bettercommerce",
          "bexio",
          "bigcapital",
          "bigcartel",
          "bigcommerce",
          "bigtime",
          "bill4time",
          "billbee",
          "billdesk",
          "billie",
          "billin",
          "billingo",
          "billit",
          "billomat",
          "billy",
          "bind-erp",
          "birdview",
          "bitpay",
          "bitrix24",
          "bitso-business",
          "bjornlunden",
          "blackline",
          "bling",
          "blue-yonder",
          "bluedart",
          "blueink",
          "blueink-bypass",
          "bluejay",
          "bluenext",
          "bluesnap",
          "bman",
          "bokio",
          "bol",
          "bold-commerce",
          "boldsign",
          "bolt",
          "boondmanager",
          "booqable",
          "borzo",
          "bosta",
          "box-sign",
          "boxberry",
          "boxstorm",
          "bpost",
          "braintree",
          "breezedoc",
          "brevo",
          "brex",
          "bridge-open-banking",
          "brightpearl",
          "bring",
          "bringg",
          "brink-commerce",
          "briox",
          "brt",
          "buchhaltungsbutze",
          "buildertrend",
          "built-africa",
          "bukku",
          "bullhorn",
          "bumpa",
          "businessmap",
          "busy",
          "buymeacoffee",
          "cafe24",
          "cainiao",
          "calxa",
          "camelot-3pl",
          "campfire",
          "canada-post",
          "canpar",
          "capsule",
          "carerix",
          "cargo-one",
          "cargowise",
          "cargus",
          "cartpanda",
          "cas-genesisworld",
          "cashctrl",
          "cashfree",
          "catalyst",
          "ccavenue",
          "cdek",
          "cdiscount-marketplace",
          "cegid",
          "cellpoint-digital",
          "cellulant",
          "center",
          "centiga",
          "centra",
          "central-transport",
          "centralstationcrm",
          "certinal",
          "certinia",
          "ch-robinson",
          "chanjet",
          "channel-talk",
          "channeladvisor",
          "chaport",
          "chargebee",
          "chaskiq",
          "chatbot-knowmax",
          "chatwoot",
          "chazki",
          "checkout-com",
          "cheqroom",
          "chipax",
          "chronopost",
          "churnzero",
          "cielo",
          "cigo-tracker",
          "cin7-core",
          "cin7-omni",
          "circle",
          "circuit",
          "cjlogistics",
          "clarify",
          "clear",
          "clearbooks",
          "clearfeed",
          "clickpost",
          "clicksign",
          "clickup",
          "clientify",
          "close",
          "cloudfinance",
          "cloudme",
          "cloudsign",
          "clover",
          "cloze",
          "cma-cgm",
          "cmic",
          "cobra-crm",
          "coda",
          "cognigy",
          "coingate",
          "coinpayments",
          "colissimo",
          "colorme-shop",
          "colppy",
          "comarchoptima",
          "comm100",
          "commercelayer",
          "commercetools",
          "computop",
          "comsigntrust",
          "concord",
          "conekta",
          "conga-sign",
          "connectpos",
          "connectwise-psa",
          "conta",
          "contaazul",
          "contabilium",
          "contasimple",
          "contpaqi",
          "contractworks",
          "convoy",
          "copper",
          "corefactors",
          "corporatestack",
          "correios",
          "correo-argentino",
          "correos",
          "corteza-crm",
          "coupang",
          "couriers-please",
          "coyote",
          "crater",
          "creatio",
          "crelate",
          "crisp",
          "crm-com",
          "crossmint",
          "crunch",
          "crunchtime",
          "cryptomathic-signer",
          "crystallize",
          "cscart",
          "ctt",
          "cubbo",
          "cuentica",
          "curri",
          "customerly",
          "cybersource",
          "d-trust-sign-me",
          "d4sign",
          "da-vinci-unified",
          "daftra",
          "danea",
          "daraz",
          "dat",
          "datapel",
          "datev",
          "daylite",
          "dayton-freight",
          "debitoor",
          "decentro",
          "deck-commerce",
          "delhivery",
          "delightchat",
          "deliverect",
          "deliveree",
          "deliveroo",
          "deposco",
          "descartes",
          "deskcom-desk365",
          "deskera",
          "deskpro",
          "deutschepost",
          "dex",
          "dext",
          "dhl",
          "dhl-africa",
          "dhl-ecommerce",
          "dhl-freight",
          "dhl-global-forwarding",
          "dhl-parcel-bnl",
          "dhl-parcel-de",
          "digio",
          "digisigner",
          "digits",
          "dilovod",
          "dinero",
          "directo",
          "dispatchtrack",
          "dlocal",
          "dochub",
          "docspring",
          "documenso",
          "document360",
          "docuseal",
          "docusign",
          "dodo-payments",
          "dokobit",
          "doku",
          "dolibarr",
          "dooca-commerce",
          "doordash-drive",
          "dpd",
          "dpd-de",
          "dpd-local-uk",
          "dpd-uk",
          "drift",
          "dropbox-sign",
          "dropoff",
          "drupal-commerce",
          "dtdc",
          "dualentry",
          "duett",
          "dukaan",
          "dwolla",
          "dynamics-365-bc-inventory",
          "dynamics-365-scm",
          "dynamics365-crm",
          "dynamics365bc",
          "e-signature-eu",
          "e2open",
          "easebuzz",
          "easyecom",
          "easypost",
          "easyship",
          "ebanx",
          "ebay",
          "eboekhouden",
          "eccang",
          "echo",
          "economic",
          "ecount",
          "ecwid",
          "edesk",
          "efficy",
          "egain",
          "egestor",
          "eideasy",
          "ekart",
          "elasticpath",
          "elogii",
          "emsigner",
          "endicia",
          "engagebay",
          "envia",
          "enviaya",
          "epages",
          "epicor-kinetic",
          "eposnow",
          "epsilonnet",
          "erpag",
          "erplain",
          "erply",
          "erpnext",
          "eshipz",
          "esignglobal",
          "esignly",
          "espocrm",
          "estafeta",
          "estes",
          "ets-express",
          "etsy",
          "eudonet",
          "evershop",
          "eversign",
          "evoliz",
          "evri",
          "evrotrust",
          "eway",
          "exactonline",
          "extensiv",
          "extensiv-inventory",
          "extensiv-order-manager",
          "ezofficeinventory",
          "fabric",
          "facebook-shop",
          "factro",
          "facturadirecta",
          "facturama",
          "factusol",
          "faire",
          "fakturoid",
          "fakturownia",
          "falabella",
          "fareye",
          "faspay",
          "fastbill",
          "fastspring",
          "fastway-africa",
          "fatoura",
          "fatture24",
          "fatturecloud",
          "faveo-helpdesk",
          "favro",
          "fawry",
          "fedex",
          "fenbeitong",
          "fetchr",
          "fibery",
          "fieldwire",
          "fiken",
          "finale-inventory",
          "financio",
          "finix",
          "finly",
          "finmap",
          "firefly-iii",
          "fiserv",
          "fishbowl",
          "five9",
          "flash-express",
          "flexport",
          "flipkart",
          "float",
          "flowaccount",
          "flowmono",
          "flowspace",
          "fluent-commerce",
          "flutterwave",
          "fnac-marketplace",
          "focussoftnet",
          "folk",
          "follow-up-boss",
          "forcemanager",
          "forecast",
          "forethought",
          "fortnox",
          "forward-air",
          "foundation",
          "fourkites",
          "fourpx",
          "foxit-esign",
          "foxy-io",
          "fp-sign",
          "fpt-econtract",
          "frappe-crm",
          "frappe-helpdesk",
          "freeagent",
          "freedcamp",
          "freee",
          "freescout",
          "freightify",
          "freightos",
          "frenet",
          "freshbooks",
          "freshchat",
          "freshdesk",
          "freshsales",
          "freshservice",
          "front",
          "frontaccounting",
          "fulfil-io",
          "fynd",
          "gainsight",
          "gallabox",
          "gambio",
          "ganttpro",
          "gd-express",
          "geeyee",
          "geidea",
          "genesys-cloud",
          "geodis",
          "getaccept",
          "ghn",
          "ghtk",
          "giddh",
          "gig-logistics",
          "giobby",
          "gist",
          "gladly",
          "global-payments",
          "globegistics",
          "glovo",
          "gls",
          "gls-de",
          "gmarket",
          "gmo-sign",
          "gocardless",
          "gocodes",
          "gocomet",
          "godaddy-websites-commerce",
          "gofreight",
          "gofrugal",
          "gojek-send",
          "gold-vision",
          "goodday",
          "gophr",
          "gophr-uk",
          "gorgias",
          "gorgias-aircall",
          "goshare",
          "gr4vy",
          "grab-express",
          "granatum",
          "groove",
          "groove-sales",
          "gumroad",
          "gusto",
          "halopsa",
          "hapag-lloyd",
          "happyfox",
          "haptik",
          "haravan",
          "height",
          "helcim",
          "hellotars-support",
          "helpcenter-io",
          "helpcrunch",
          "helpcrunch-na",
          "helpjuice",
          "helpscout",
          "helpshift",
          "helpspot",
          "helpwise",
          "hepsiburada",
          "hermes-de",
          "highlevel",
          "hinawi",
          "hitpay",
          "hive",
          "hiver",
          "holded",
          "hongkong-post",
          "horizonerp",
          "hubspot",
          "hubspot-service-hub",
          "huly",
          "hygger",
          "hyperpay",
          "hyperswitch",
          "icertis",
          "icount",
          "idoklad",
          "idosell",
          "ifirma",
          "ikas",
          "imile",
          "inbooks",
          "increff",
          "infakt",
          "inflow",
          "infocert",
          "infoplus",
          "infor-wms",
          "inkit",
          "inloox",
          "innoship",
          "inpost",
          "insales",
          "insertnexo",
          "insightly",
          "insign",
          "instamojo",
          "intasend",
          "intelipost",
          "intercom",
          "interswitch",
          "inventory-planner",
          "inventree",
          "invoice-ninja",
          "invoiced",
          "invoiceportal",
          "invoiceq",
          "invoicexpress",
          "ionos",
          "ipaidthat",
          "ipay88",
          "iqmetrix",
          "ironclad",
          "itemit",
          "ithink-logistics",
          "iugu",
          "ixopay",
          "iyzico",
          "izberg",
          "jadlog",
          "jalebi",
          "janio",
          "japan-post",
          "jda",
          "jdcom",
          "jeebly",
          "jimdo",
          "jira",
          "jira-service-management",
          "jitbit-helpdesk",
          "jne",
          "jobadder",
          "jobdiva",
          "joor",
          "jotform-sign",
          "jsign",
          "jt-express",
          "jtl-shop",
          "jubelio",
          "jumia",
          "jumis",
          "jumpseller",
          "juro",
          "jushuitan",
          "juspay",
          "kaiten",
          "kanbanize",
          "kanboard",
          "kantata",
          "kapture-crm",
          "karbon",
          "karrio",
          "kashflow",
          "kashoo",
          "katana",
          "kaufland-marketplace",
          "kayako",
          "keap",
          "kerry-express",
          "khoros-care",
          "kibo",
          "killbill",
          "kinaxis",
          "kingdee",
          "kintone",
          "kitchenhub",
          "kladana",
          "klara",
          "klarna",
          "klenty",
          "kobo360",
          "kofi",
          "kommo",
          "konturelba",
          "kora",
          "kore-ai",
          "korea-post",
          "korona-pos",
          "krayin-crm",
          "kushki",
          "kustomer",
          "kwara",
          "kylas",
          "lacrm",
          "lago",
          "lalamove",
          "lark",
          "lasership",
          "lazada",
          "leadsquared",
          "lealos",
          "leantime",
          "ledgers-cloud",
          "ledgersmb",
          "leegality",
          "legaldesk",
          "legalesign",
          "lemlist",
          "lemon-squeezy",
          "leopards",
          "lessaccounting",
          "lex-persona",
          "lexoffice",
          "libeo",
          "libredesk",
          "libresign",
          "lightspeed-inventory",
          "lightspeed-retail",
          "lime-crm",
          "limeexpress",
          "linear",
          "linksquares",
          "linnworks",
          "listing-mirror",
          "liveagent",
          "livechat",
          "livehelpnow",
          "lleida-net",
          "loadsmart",
          "locate2u",
          "locus",
          "loggi",
          "logicommerce",
          "loginext",
          "logiwa",
          "logiwa-inventory",
          "logoyazilim",
          "loja-integrada",
          "loop-returns",
          "loxo",
          "loyverse",
          "luca",
          "lumin-sign",
          "luxtrust",
          "mabang-erp",
          "macropoint",
          "maersk",
          "magaya",
          "magento",
          "manager",
          "managerio",
          "manatal",
          "manhattan-active",
          "manhattan-wms",
          "manomano",
          "mantisbt",
          "marketman",
          "marketplacer",
          "masteraccounting",
          "mautic",
          "maximizer",
          "maxio",
          "mazeedone",
          "mazrica",
          "mazuma",
          "medius",
          "medusa",
          "megaplan",
          "megaventory",
          "meisterplan",
          "meistertask",
          "mekari-sign",
          "mekarijurnal",
          "melhor-envio",
          "melio",
          "membrain",
          "mercado-pago",
          "mercadolibre",
          "mercurygate",
          "meritaktiva",
          "metapack",
          "method-crm",
          "mezan",
          "microsoft-planner",
          "microsoft-todo",
          "midtrans",
          "mifiel",
          "mineraltree",
          "mintsoft",
          "mirakl",
          "misaamis",
          "missive",
          "mixmax",
          "modern-treasury",
          "modusign",
          "mojo-helpdesk",
          "mollie",
          "moloni",
          "monday",
          "monday-crm",
          "mondialrelay",
          "moneris",
          "moneybird",
          "moneyforward",
          "moov",
          "morning",
          "moskit",
          "moss",
          "mothership",
          "movidesk",
          "moyasar",
          "moysklad",
          "mpesa",
          "mri-software",
          "mrpeasy",
          "mural-pay",
          "mx",
          "mybillbook",
          "mycashflow",
          "myfatoorah",
          "mylerz",
          "myob",
          "myunisoft",
          "nacelle",
          "namirial",
          "naqel",
          "narvar",
          "nash",
          "nationex",
          "nearpay",
          "nethunt-crm",
          "netstock",
          "netsuite",
          "netsuite-crm",
          "netsuite-inventory",
          "netvisor",
          "network-international",
          "networkon",
          "neurored",
          "newegg",
          "nexi",
          "nextbillion-ai",
          "nextcloud-deck",
          "nhn-commerce",
          "nibo",
          "nifty",
          "nimble",
          "nimbuspost",
          "ninja-van",
          "nitro-sign",
          "nmi",
          "nocodb",
          "nocrm-io",
          "noon",
          "nopcommerce",
          "norce",
          "notion",
          "nova-poshta",
          "nowpayments",
          "nshift",
          "nuclino",
          "nuorder",
          "nutcache",
          "nutshell",
          "nuvei",
          "nuvemfiscal",
          "nzpost",
          "oca",
          "octadesk",
          "octopus",
          "odoo",
          "odoo-crm",
          "odoo-helpdesk",
          "odoo-inventory",
          "odoo-project",
          "odoo-sign",
          "olark",
          "old-dominion",
          "omie",
          "omnidesk",
          "omniva",
          "one-line",
          "oneflow",
          "onepagecrm",
          "ones",
          "onespan-sign",
          "onfleet",
          "ongoing-wms",
          "onro",
          "ontrac",
          "ontraport",
          "openboxes",
          "openbravo",
          "opencart",
          "openpay",
          "openproject",
          "opensign",
          "opn-payments",
          "optimizely-configured-commerce",
          "optimoroute",
          "ora",
          "oracle-cx",
          "oracle-otm",
          "oracle-wms",
          "orca-scan",
          "orckestra",
          "orderbot",
          "orderchamp",
          "orderful",
          "ordergroove",
          "ordoro",
          "orocommerce",
          "orocrm",
          "ortto",
          "osticket",
          "otobo",
          "otto-market",
          "outreach",
          "outvio",
          "ozon",
          "packeta",
          "packlink-pro",
          "paddle",
          "paga",
          "pagarme",
          "pagseguro",
          "pandadoc",
          "pandago",
          "pandle",
          "papercups",
          "paperlessngx",
          "parasut",
          "parcel2go",
          "parcelforce",
          "parcelhub",
          "parcellab",
          "patreon",
          "patriot",
          "pawapay",
          "payabli",
          "paydock",
          "payhawk",
          "payhip",
          "paymo",
          "paymob",
          "payoneer",
          "paypal",
          "payrexx",
          "paysafe",
          "paystack",
          "paytabs",
          "paytm",
          "paytr",
          "paytrail",
          "payu",
          "pdffiller",
          "peaccounting",
          "peach-payments",
          "peakaccount",
          "pega-crm",
          "penneo",
          "pennylane",
          "peoplevox",
          "pepperi",
          "perdoo",
          "pesapal",
          "petpooja",
          "phonepe",
          "pickrr",
          "pickware",
          "picqer",
          "pin-payments",
          "pinduoduo",
          "pingcode",
          "pinterest-shop",
          "pipe17",
          "pipedrive",
          "pipeline-crm",
          "pipeliner",
          "pirateship",
          "pitney-bowes",
          "pitt-ohio",
          "pivotal-tracker",
          "plaid",
          "plain",
          "plane",
          "planfix",
          "planhat",
          "planview-adaptivework",
          "plentyone",
          "pleo",
          "ploomes",
          "pochta-russia",
          "podio",
          "pohoda",
          "portcast",
          "post-dk",
          "posta-ke",
          "poste-italiane",
          "posti",
          "postnl",
          "postnord",
          "poweroffice",
          "ppl-cz",
          "prediko",
          "prestashop",
          "primer",
          "privyid",
          "process-street",
          "procore",
          "procountor",
          "productboard",
          "productive",
          "productplan",
          "profitbooks",
          "project44",
          "projectmanager",
          "projectplace",
          "promikbook",
          "proof",
          "proofhub",
          "proprofs-help-desk",
          "prosvasis",
          "pulpo-wms",
          "purolator",
          "puzzle",
          "pyrus",
          "qiscus",
          "qoblex",
          "qontak",
          "qoyod",
          "quadient",
          "quickbase",
          "quickbooks",
          "quickbutik",
          "quickfile",
          "quipu",
          "quiqup",
          "quire",
          "ragic",
          "rakuten",
          "ramp",
          "rapyd",
          "rasayel",
          "raynet",
          "razorpay",
          "rd-station-crm",
          "realbooks",
          "reamaze",
          "rebill",
          "rebilly",
          "recharge",
          "reckon",
          "reckon-one",
          "recruit-crm",
          "recruiterflow",
          "recurly",
          "redmine",
          "refrens",
          "regate",
          "reply-bird-conversations",
          "reply-io",
          "respond-io",
          "restaurant365",
          "retailcrm",
          "returngo",
          "revel",
          "revel-systems",
          "rex-crm",
          "richpanel",
          "rightsignature",
          "rillet",
          "rivile",
          "rl-carriers",
          "roadie",
          "roambee",
          "rocketlane",
          "routable",
          "route4me",
          "routific",
          "royalmail",
          "rplust",
          "ruddr",
          "runrun-it",
          "saasu",
          "sagawa",
          "sage-crm",
          "sage-x3-inventory",
          "sage50de",
          "sagebusinesscloud",
          "sageintacct",
          "saia",
          "saldeo",
          "saleor",
          "salesflare",
          "salesforce",
          "salesforce-commerce-cloud",
          "salesforce-service",
          "salesloft",
          "salesmanago",
          "salesmate",
          "salesnexus",
          "salla",
          "salt-edge",
          "samdock",
          "sameday",
          "samsara",
          "sana-commerce",
          "sansan",
          "sap-commerce",
          "sap-ewm",
          "sap-inventory",
          "sap-sales-cloud",
          "sap-tm",
          "sapb1",
          "sapo",
          "sberbusiness",
          "scalapay",
          "scayle",
          "scopevisio",
          "scoro",
          "scrive",
          "searates",
          "seatable",
          "seavantage",
          "secured-signing",
          "sefl",
          "sellbrite",
          "sellercloud",
          "sellfy",
          "sellsy",
          "sendcloud",
          "sendle",
          "sendowl",
          "sendparcel",
          "sendregning",
          "senpex",
          "sertifi",
          "servientrega",
          "sevdesk",
          "sezzle",
          "sf-express",
          "sharetribe",
          "shelf-nu",
          "shift4shop",
          "ship24",
          "shipbob",
          "shipbob-inventory",
          "shipbubble",
          "shipcloud",
          "shipday",
          "shipedge",
          "shipengine",
          "shiphero",
          "shiphero-inventory",
          "shipium",
          "shipkaro",
          "shipmondo",
          "shipmonk",
          "shipmozo",
          "shippeo",
          "shipperhq",
          "shippify",
          "shippo",
          "shippypro",
          "shiprocket",
          "shipsgo",
          "shipstation",
          "shipsy",
          "shiptheory",
          "shiptime",
          "shipway",
          "shipwire",
          "shogun",
          "shopaccino",
          "shopee",
          "shoper",
          "shopgate",
          "shopify",
          "shoplazza",
          "shopline",
          "shopware",
          "shopware-b2b",
          "shortcut",
          "shuup",
          "shyplite",
          "sicepat",
          "sign-plus",
          "signable",
          "signatureapi",
          "signaturely",
          "signaturit",
          "signdesk",
          "signeasy",
          "signhost",
          "signicat",
          "signiflow",
          "signnow",
          "signority",
          "signrequest",
          "signwell",
          "signzy",
          "siigo",
          "sila",
          "silverfin",
          "simplbooks",
          "simplicate",
          "sinao",
          "sinay",
          "singapore-post",
          "sirion",
          "sistemi",
          "skio",
          "skribble",
          "skrill",
          "skulabs",
          "skunexus",
          "skusavvy",
          "skuvault",
          "skydropx",
          "skynet",
          "smacc",
          "smartaccounts",
          "smartbill",
          "smartsheet",
          "smartsuite",
          "smartsupp",
          "smarttask",
          "smc3",
          "smsa",
          "snapengage",
          "snelstart",
          "snipcart",
          "snipe-it",
          "soldo",
          "solidgate",
          "solidus",
          "solve-crm",
          "sortly",
          "sos-inventory",
          "southeastern-freight",
          "spee-dee",
          "speedledger",
          "spendesk",
          "spherewms",
          "spiris",
          "spiro",
          "splitit",
          "spotler-crm",
          "spoton",
          "spree",
          "spreedly",
          "sprinklr-service",
          "sproof-sign",
          "spryker",
          "sps-commerce",
          "square",
          "squarespace",
          "stackby",
          "stackfield",
          "stampli",
          "stamps",
          "stark-bank",
          "starken",
          "starshipit",
          "startrack",
          "starweb",
          "stax-payments",
          "stay-ai",
          "stepover",
          "stessa",
          "stitch",
          "sto-express",
          "stocktrim",
          "store-feeder",
          "storehippo",
          "streak",
          "stripe",
          "stuart",
          "sugarcrm",
          "suitecrm",
          "suiteprojects-pro",
          "sumtracker",
          "sumup",
          "sunrise",
          "superbill",
          "superfaktura",
          "superoffice",
          "supportbench",
          "supy",
          "swell",
          "swish",
          "swisscom-trust-services",
          "swisssign",
          "sylius",
          "synder",
          "sysaid",
          "syspro",
          "systima",
          "szamlazzhu",
          "tabby",
          "taiga",
          "take-blip",
          "talkdesk",
          "tallyprime",
          "tamara",
          "tap-payments",
          "tapd",
          "targetprocess",
          "tawk-to",
          "tcs-express",
          "tcs-pk",
          "teambition",
          "teamgantt",
          "teamgate",
          "teamhood",
          "teamleader",
          "teamsupport",
          "teamsystem",
          "teamwave",
          "teamwork",
          "teamwork-crm",
          "teamwork-desk",
          "tecsys",
          "telr",
          "temu",
          "terminal-africa",
          "terminal49",
          "texada",
          "tforce-freight",
          "thena",
          "thirty-bees",
          "thunes",
          "tidio",
          "tiendanube",
          "tiime",
          "tiktok-shop",
          "tilaka",
          "tiledesk",
          "tink",
          "tiny",
          "tiny-erp",
          "tipalti",
          "tive",
          "tmall",
          "tnt",
          "toast",
          "todoist",
          "toggl-plan",
          "tokopedia",
          "toll-group",
          "tookan",
          "topship",
          "torgsoft",
          "total-express",
          "totango",
          "tower",
          "track-pod",
          "trackingmore",
          "tradlinx",
          "transfi",
          "transplace",
          "transporeon",
          "transportify",
          "tray-commerce",
          "trello",
          "trendyol",
          "trengo",
          "tribe-crm",
          "trimble-tms",
          "trimble-truckmate",
          "triple-a",
          "tripletex",
          "trolley",
          "truckstop",
          "truecommerce",
          "truelayer",
          "trustly",
          "tuleap",
          "turvo",
          "twenty",
          "twentyfoursevenoffice",
          "twinfield",
          "twproject",
          "tyms",
          "tyro",
          "uber-direct",
          "uber-freight",
          "uhasibu",
          "unicommerce",
          "unified-to-shipping",
          "unimicro",
          "unit4",
          "universign",
          "unleashed",
          "unthread",
          "unzer",
          "upayments",
          "ups",
          "upsales",
          "usedesk",
          "userlike",
          "usps",
          "uvdesk",
          "validated-id",
          "vamaship",
          "vario-software",
          "veeqo",
          "veho",
          "vend-pos",
          "vendasta",
          "vendure",
          "venipak",
          "veracore",
          "verifone-2checkout",
          "verloop",
          "versa-cloud-erp",
          "vhsys",
          "viafirma",
          "vikunja",
          "vincere",
          "vipps-mobilepay",
          "virto-commerce",
          "virtuemart",
          "visma",
          "visma-sign",
          "vismabusinessnxt",
          "vismanet",
          "vitally",
          "viva-com",
          "vivantio",
          "vizion",
          "vizion-api",
          "vnda",
          "volusion",
          "vosfactures",
          "vtex",
          "vtiger",
          "wafeq",
          "wakeo",
          "wakeupsales",
          "walmart",
          "ward-trucking",
          "warp",
          "wasp-barcode",
          "wati",
          "wave",
          "wayfair",
          "wbuy",
          "webcargo",
          "webcrm",
          "webdox",
          "webflow",
          "webgility",
          "webshipper",
          "weclapp",
          "weebly",
          "weeek",
          "weekdone",
          "wekan",
          "wfirma",
          "whitebooks",
          "wildberries",
          "wimi",
          "wint",
          "wise",
          "wise-systems",
          "wish",
          "wisomeinbuero",
          "wix",
          "wix-crm",
          "wompi",
          "wonderment",
          "woocommerce",
          "workboard",
          "workbooks",
          "workfront",
          "worktile",
          "worldline",
          "worldpay-fis",
          "wrebit",
          "wrike",
          "xcart",
          "xendit",
          "xentral",
          "xero",
          "xledger",
          "xodo-sign",
          "xpo",
          "xpressbees",
          "xt-commerce",
          "xubio",
          "yamato",
          "yampi",
          "yandex-tracker",
          "yapily",
          "yapstone",
          "yayoi",
          "yellow-ai",
          "yetiforce",
          "yoco",
          "yodel",
          "yokart",
          "yonyou",
          "yooz",
          "yoti-sign",
          "yousign",
          "youtrack",
          "yto-express",
          "yuki",
          "zalando",
          "zammad",
          "zealid",
          "zefort",
          "zendesk",
          "zendesk-sell",
          "zenhub",
          "zenkit",
          "zenvia",
          "zervant",
          "zid",
          "zim",
          "zip-bnpl",
          "zipbooks",
          "znode",
          "znuny",
          "zoho-bigin",
          "zoho-bugtracker",
          "zoho-crm",
          "zoho-desk",
          "zoho-inventory",
          "zoho-projects",
          "zoho-sign",
          "zoho-sprints",
          "zohobooks",
          "zorrosign",
          "zto-express",
          "zucchetti",
          "zuora",
          "zyro"
        ],
        "description": "Adapter slug identifying an upstream platform. Slugs are unique per platform but a handful appear in two verticals (e.g. `square` in payments and ecommerce), so a slug is only unambiguous alongside its vertical. `GET /v1/platforms` lists them with their vertical.",
        "example": "fortnox"
      },
      "AccountingSyncJob": {
        "type": "object",
        "description": "Background sync job. Created by `POST /v1/{vertical}/sync`.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "sync_1042"
          },
          "vertical": {
            "type": "string",
            "example": "accounting"
          },
          "connectionId": {
            "type": "string",
            "format": "uuid",
            "example": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90"
          },
          "platform": {
            "type": "string",
            "example": "xero"
          },
          "tenantId": {
            "type": "string",
            "nullable": true,
            "example": "acme"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed"
            ],
            "example": "completed"
          },
          "progress": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "object",
              "properties": {
                "synced": {
                  "type": "integer",
                  "example": 128
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "running",
                    "completed",
                    "skipped",
                    "failed"
                  ],
                  "example": "completed"
                },
                "error": {
                  "type": "string",
                  "example": "rate limited by upstream"
                }
              }
            }
          },
          "error": {
            "type": "string",
            "nullable": true,
            "example": null
          },
          "callbackUrl": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "example": "https://hooks.acme.example/sync"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "startedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ],
            "example": "2026-01-15T09:30:00Z"
          },
          "completedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ],
            "example": "2026-02-01T14:20:00Z"
          },
          "origin": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "manual",
              "api",
              "connect",
              "boot",
              "schedule",
              null
            ],
            "description": "Why the job was queued: `api` (POST /v1/{vertical}/sync), `manual` (the admin console), `connect` (right after a Connect Link), `boot` (DATA_STORE_AUTO_SYNC_ON_BOOT) or `schedule` (the connection's sync schedule). Null on jobs queued before this field existed.",
            "example": "schedule"
          }
        },
        "required": [
          "id",
          "vertical",
          "connectionId",
          "platform",
          "status",
          "createdAt"
        ]
      },
      "AccountingWebhookEvent": {
        "type": "object",
        "properties": {
          "id": {
            "example": "evt_inv_1042_created",
            "type": "string"
          },
          "platform": {
            "type": "string",
            "example": "fortnox"
          },
          "type": {
            "type": "string",
            "example": "invoice.created"
          },
          "resourceType": {
            "type": "string",
            "enum": [
              "invoice",
              "bill",
              "contact",
              "account",
              "journal",
              "transaction",
              "taxrate",
              "expense",
              "creditmemo",
              "order",
              "salesorder",
              "purchaseorder",
              "organization",
              "payment",
              "unknown"
            ],
            "example": "invoice"
          },
          "action": {
            "type": "string",
            "enum": [
              "created",
              "updated",
              "deleted",
              "unknown"
            ],
            "example": "created"
          },
          "resourceId": {
            "type": "string",
            "example": "inv_1042"
          },
          "tenantId": {
            "example": "acme",
            "type": "string"
          },
          "connectionId": {
            "example": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90",
            "type": "string"
          },
          "externalAccountId": {
            "example": "a1b2c3d4-...",
            "type": "string"
          },
          "payload": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "platform",
          "type",
          "resourceType",
          "action",
          "resourceId",
          "payload"
        ],
        "additionalProperties": false
      },
      "AccountingProvider": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "description": "Unique adapter identifier",
            "example": "xero"
          },
          "name": {
            "type": "string",
            "example": "Xero"
          },
          "description": {
            "type": "string",
            "example": "Cloud accounting for small business."
          },
          "website": {
            "type": "string",
            "format": "uri",
            "example": "https://www.xero.com"
          },
          "category": {
            "type": "string",
            "enum": [
              "accounting",
              "erp",
              "bookkeeping"
            ],
            "example": "accounting"
          },
          "primary_color": {
            "$ref": "#/components/schemas/HexColor"
          },
          "auth_type": {
            "type": "string",
            "enum": [
              "oauth2",
              "oauth2_cc",
              "api_key",
              "session",
              "local"
            ],
            "example": "oauth2"
          },
          "hq_country": {
            "$ref": "#/components/schemas/ISO3166"
          },
          "docs_url": {
            "type": "string",
            "format": "uri",
            "example": "https://developer.xero.com"
          },
          "pricing_url": {
            "type": "string",
            "format": "uri",
            "example": "https://www.xero.com/pricing"
          },
          "founded_year": {
            "type": "integer",
            "example": 2006
          },
          "logo": {
            "description": "Base64-encoded SVG logo, or null if not yet added",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "AccountingAccount": {
        "type": "object",
        "properties": {
          "id": {
            "example": "acct_4000",
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
          },
          "name": {
            "example": "4000 — Sales",
            "type": "string"
          },
          "description": {
            "example": "Revenue from product and subscription sales",
            "type": "string"
          },
          "customerDefinedCode": {
            "example": "4000",
            "type": "string"
          },
          "type": {
            "example": "INCOME",
            "type": "string",
            "enum": [
              "ASSET",
              "LIABILITY",
              "EQUITY",
              "INCOME",
              "EXPENSE",
              "OTHER",
              "unknown"
            ]
          },
          "status": {
            "example": "ACTIVE",
            "type": "string",
            "enum": [
              "ACTIVE",
              "ARCHIVED"
            ]
          },
          "group": {
            "example": "Revenue",
            "type": "string"
          },
          "section": {
            "example": "Operating Income",
            "type": "string"
          },
          "subgroup": {
            "example": "Product Sales",
            "type": "string"
          },
          "subsection": {
            "example": "Subscriptions",
            "type": "string"
          },
          "parentId": {
            "example": "acct_4000_parent",
            "type": "string"
          },
          "isPayable": {
            "example": false,
            "type": "boolean"
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "balance": {
            "description": "Signed account balance, minor units. Negative for accounts owing.",
            "example": 125000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "taxonomy": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "example": "tax_node_income",
                  "type": "string"
                },
                "name": {
                  "example": "Income",
                  "type": "string"
                },
                "type": {
                  "example": "INCOME",
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "AccountingBill": {
        "type": "object",
        "properties": {
          "id": {
            "example": "bill_2042",
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
          },
          "status": {
            "example": "PAID",
            "type": "string",
            "enum": [
              "DRAFT",
              "SUBMITTED",
              "AUTHORIZED",
              "PAID",
              "PARTIALLY_PAID",
              "OVERDUE",
              "VOIDED",
              "DELETED",
              "unknown"
            ]
          },
          "billNumber": {
            "example": "BILL-2042",
            "type": "string"
          },
          "contactId": {
            "example": "cus_4Qm2Xa9Lr",
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "totalAmount": {
            "example": 125000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "taxAmount": {
            "example": 10000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "discountAmount": {
            "example": 0,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "paidAmount": {
            "example": 125000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "balanceAmount": {
            "example": 0,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "refundAmount": {
            "example": 0,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "refundReason": {
            "example": "No refund issued",
            "type": "string"
          },
          "paymentCollectionMethod": {
            "example": "send_invoice",
            "type": "string",
            "enum": [
              "send_invoice",
              "charge_automatically"
            ],
            "description": "How the customer will be charged."
          },
          "notes": {
            "example": "Net 30 supplier bill for Acme Industries.",
            "type": "string"
          },
          "url": {
            "description": "Hosted bill URL.",
            "example": "https://app.acme.example/bills/BILL-2042",
            "type": "string",
            "format": "uri"
          },
          "send": {
            "example": false,
            "type": "boolean"
          },
          "lineAmountsIncludeTax": {
            "description": "Whether line `unitAmount`/`totalAmount` already include tax. `true` = tax-inclusive, `false` = tax-exclusive (tax is added on top), `null` = the platform applies no tax to this document, so the distinction does not arise and both readings give the same total. Without it, line items reconcile to the header by different arithmetic with nothing in the response saying which — inference from the totals breaks on zero-tax lines, mixed rates, rounding, and single-line documents where the two readings coincide.",
            "example": false,
            "type": [
              "boolean",
              "null"
            ]
          },
          "lineItems": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "example": "li_3001",
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256,
                      "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                    },
                    "accountId": {
                      "description": "Account.id of the ledger account this line posts to. Always the same identifier space as `Account.id`, so it resolves against the accounts resource directly.",
                      "example": "acct_4000",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountCode": {
                      "description": "Human-facing chart-of-accounts code for `accountId`, when the platform exposes one separately (Xero `AccountCode`). Mirrors `Account.customerDefinedCode`. Display only — platforms do not guarantee it unique or stable, so never join on it.",
                      "example": "4000",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 64
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemId": {
                      "example": "item_900",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemName": {
                      "example": "Annual platform subscription",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255,
                          "description": "Display name (display label or title). Max 255 chars.",
                          "example": "Acme Industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemDescription": {
                      "example": "Acme Industries annual platform subscription",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 2000,
                          "description": "Long-form free text. Max 2000 chars.",
                          "example": "Industrial supplies and equipment."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemSku": {
                      "example": "SUB-ANNUAL",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 256
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemVariants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "example": "ref_2001",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256,
                            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                          },
                          "name": {
                            "example": "Acme Industries",
                            "type": "string",
                            "maxLength": 255,
                            "description": "Display name (display label or title). Max 255 chars."
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "example": "ref_2001",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256,
                            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                          },
                          "name": {
                            "example": "Acme Industries",
                            "type": "string",
                            "maxLength": 255,
                            "description": "Display name (display label or title). Max 255 chars."
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "categoryIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256,
                        "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                        "example": "acme-industries"
                      }
                    },
                    "unitAmount": {
                      "description": "Per-unit price in the parent document currency, minor units.",
                      "example": 115000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "unitQuantity": {
                      "description": "Quantity.",
                      "example": 1,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "discountAmount": {
                      "description": "Discount applied to this line, minor units.",
                      "example": 0,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "taxAmount": {
                      "description": "Tax component of this line, minor units.",
                      "example": 10000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "taxrateId": {
                      "example": "tax_ca",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "totalAmount": {
                      "description": "Line total (`unitAmount × unitQuantity − discountAmount + taxAmount`), minor units.",
                      "example": 125000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "refundAmount": {
                      "example": 0,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "refundedAt": {
                      "example": "2026-02-20T00:00:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "notes": {
                      "example": "Renewal for the 2026 contract year.",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 5000,
                          "description": "Extra-long free text such as internal notes. Max 5000 chars.",
                          "example": "Net-30 terms agreed with Acme Industries."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "example": "2026-01-15T09:30:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "updatedAt": {
                      "example": "2026-02-01T14:20:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "attachments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "example": "att_5001",
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256,
                  "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                },
                "url": {
                  "description": "Hosted file URL.",
                  "example": "https://files.acme.example/invoices/INV-1042.pdf",
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uri"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "mimeType": {
                  "description": "MIME type, e.g. `application/pdf`.",
                  "example": "application/pdf",
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 255
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "fileName": {
                  "example": "INV-1042.pdf",
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 255
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "additionalProperties": false
            }
          },
          "postedAt": {
            "example": "2026-02-01",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "$ref": "#/components/schemas/CalendarDate"
              }
            ]
          },
          "dueAt": {
            "example": "2026-03-03",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "$ref": "#/components/schemas/CalendarDate"
              }
            ]
          },
          "paidAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-20T00:00:00Z"
          },
          "cancelledAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": null
          },
          "refundedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": null
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "AccountingContact": {
        "type": "object",
        "properties": {
          "id": {
            "example": "cus_4Qm2Xa9Lr",
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
          },
          "name": {
            "example": "Jane Doe",
            "type": "string",
            "maxLength": 255,
            "description": "Display name (display label or title). Max 255 chars."
          },
          "firstName": {
            "example": "Jane",
            "type": "string",
            "maxLength": 255,
            "description": "Display name (display label or title). Max 255 chars."
          },
          "lastName": {
            "example": "Doe",
            "type": "string",
            "maxLength": 255,
            "description": "Display name (display label or title). Max 255 chars."
          },
          "companyName": {
            "example": "Acme Industries",
            "type": "string",
            "maxLength": 255,
            "description": "Display name (display label or title). Max 255 chars."
          },
          "identification": {
            "example": "acme-industries",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ]
          },
          "taxNumber": {
            "example": "US-123456789",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "taxExemption": {
            "example": "OTHER",
            "type": "string",
            "enum": [
              "FEDERAL_GOV",
              "REGION_GOV",
              "LOCAL_GOV",
              "TRIBAL_GOV",
              "CHARITABLE_ORG",
              "RELIGIOUS_ORG",
              "EDUCATIONAL_ORG",
              "MEDICAL_ORG",
              "RESALE",
              "FOREIGN",
              "OTHER",
              "unknown"
            ]
          },
          "isCustomer": {
            "example": true,
            "type": "boolean"
          },
          "isSupplier": {
            "example": false,
            "type": "boolean"
          },
          "isActive": {
            "example": true,
            "type": "boolean"
          },
          "currency": {
            "example": "USD",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              },
              {
                "type": "null"
              }
            ]
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "email": {
                  "type": "string",
                  "maxLength": 320,
                  "format": "email",
                  "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
                  "description": "RFC 5322 email address.",
                  "example": "jane.doe@acme.example"
                },
                "type": {
                  "example": "WORK",
                  "type": "string",
                  "enum": [
                    "WORK",
                    "HOME",
                    "OTHER"
                  ]
                }
              },
              "required": [
                "email"
              ],
              "additionalProperties": false
            }
          },
          "telephones": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "telephone": {
                  "type": "string",
                  "maxLength": 64,
                  "example": "+14155550123"
                },
                "type": {
                  "example": "WORK",
                  "type": "string",
                  "enum": [
                    "WORK",
                    "HOME",
                    "MOBILE",
                    "FAX",
                    "OTHER"
                  ]
                }
              },
              "required": [
                "telephone"
              ],
              "additionalProperties": false
            }
          },
          "billingAddress": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "address1": {
                    "description": "Street address, line 1.",
                    "example": "2500 Market Street",
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "address2": {
                    "description": "Street address, line 2 (unit, suite).",
                    "example": "Suite 300",
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "city": {
                    "description": "City or locality.",
                    "example": "San Francisco",
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "region": {
                    "description": "State, province, or region.",
                    "example": "CA",
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postalCode": {
                    "description": "ZIP or postal code.",
                    "example": "94114",
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 40
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "example": "US",
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/ISO3166",
                        "example": "US"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "shippingAddress": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "address1": {
                    "description": "Street address, line 1.",
                    "example": "2500 Market Street",
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "address2": {
                    "description": "Street address, line 2 (unit, suite).",
                    "example": "Suite 300",
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "city": {
                    "description": "City or locality.",
                    "example": "San Francisco",
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "region": {
                    "description": "State, province, or region.",
                    "example": "CA",
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postalCode": {
                    "description": "ZIP or postal code.",
                    "example": "94114",
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 40
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "example": "US",
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/ISO3166",
                        "example": "US"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "paymentMethods": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "example": "ACH",
                  "type": "string",
                  "enum": [
                    "ACH",
                    "CARD",
                    "CHECK",
                    "WIRE",
                    "PAYPAL",
                    "OTHER",
                    "unknown"
                  ]
                },
                "name": {
                  "example": "Acme Industries operating account",
                  "type": "string",
                  "maxLength": 255,
                  "description": "Display name (display label or title). Max 255 chars."
                },
                "externalId": {
                  "example": "pm_ach_001",
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256,
                      "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                      "example": "acme-industries"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "additionalProperties": false
            }
          },
          "associatedContacts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "example": "ref_2001",
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256,
                  "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                },
                "name": {
                  "example": "Acme Industries",
                  "type": "string",
                  "maxLength": 255,
                  "description": "Display name (display label or title). Max 255 chars."
                }
              },
              "additionalProperties": false
            }
          },
          "portalUrl": {
            "example": "https://app.acme.example/portal/cus_4Qm2Xa9Lr",
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "example": "2026-01-15T09:30:00Z",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "example": "2026-02-01T14:20:00Z",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "AccountingCreditMemo": {
        "type": "object",
        "properties": {
          "id": {
            "example": "cm_3010",
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
          },
          "status": {
            "example": "AUTHORIZED",
            "type": "string",
            "enum": [
              "DRAFT",
              "AUTHORIZED",
              "PAID",
              "PARTIALLY_PAID",
              "VOIDED",
              "DELETED",
              "unknown"
            ]
          },
          "creditmemoNumber": {
            "example": "CM-3010",
            "type": "string"
          },
          "contactId": {
            "example": "cus_4Qm2Xa9Lr",
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "totalAmount": {
            "example": 125000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "taxAmount": {
            "example": 10000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "discountAmount": {
            "example": 0,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "paidAmount": {
            "example": 0,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "balanceAmount": {
            "example": 125000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "refundAmount": {
            "example": 0,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "refundReason": {
            "example": "Credit issued for over-billed subscription.",
            "type": "string"
          },
          "paymentCollectionMethod": {
            "example": "send_invoice",
            "type": "string",
            "enum": [
              "send_invoice",
              "charge_automatically"
            ],
            "description": "How the customer will be charged."
          },
          "notes": {
            "example": "Credit note applied to INV-1042 for Acme Industries.",
            "type": "string"
          },
          "url": {
            "example": "https://app.acme.example/credit-memos/CM-3010",
            "type": "string",
            "format": "uri"
          },
          "send": {
            "example": false,
            "type": "boolean"
          },
          "lineAmountsIncludeTax": {
            "description": "Whether line `unitAmount`/`totalAmount` already include tax. `true` = tax-inclusive, `false` = tax-exclusive (tax is added on top), `null` = the platform applies no tax to this document, so the distinction does not arise and both readings give the same total. Without it, line items reconcile to the header by different arithmetic with nothing in the response saying which — inference from the totals breaks on zero-tax lines, mixed rates, rounding, and single-line documents where the two readings coincide.",
            "example": false,
            "type": [
              "boolean",
              "null"
            ]
          },
          "lineItems": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "example": "li_3001",
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256,
                      "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                    },
                    "accountId": {
                      "description": "Account.id of the ledger account this line posts to. Always the same identifier space as `Account.id`, so it resolves against the accounts resource directly.",
                      "example": "acct_4000",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountCode": {
                      "description": "Human-facing chart-of-accounts code for `accountId`, when the platform exposes one separately (Xero `AccountCode`). Mirrors `Account.customerDefinedCode`. Display only — platforms do not guarantee it unique or stable, so never join on it.",
                      "example": "4000",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 64
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemId": {
                      "example": "item_900",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemName": {
                      "example": "Annual platform subscription",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255,
                          "description": "Display name (display label or title). Max 255 chars.",
                          "example": "Acme Industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemDescription": {
                      "example": "Acme Industries annual platform subscription",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 2000,
                          "description": "Long-form free text. Max 2000 chars.",
                          "example": "Industrial supplies and equipment."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemSku": {
                      "example": "SUB-ANNUAL",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 256
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemVariants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "example": "ref_2001",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256,
                            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                          },
                          "name": {
                            "example": "Acme Industries",
                            "type": "string",
                            "maxLength": 255,
                            "description": "Display name (display label or title). Max 255 chars."
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "example": "ref_2001",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256,
                            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                          },
                          "name": {
                            "example": "Acme Industries",
                            "type": "string",
                            "maxLength": 255,
                            "description": "Display name (display label or title). Max 255 chars."
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "categoryIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256,
                        "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                        "example": "acme-industries"
                      }
                    },
                    "unitAmount": {
                      "description": "Per-unit price in the parent document currency, minor units.",
                      "example": 115000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "unitQuantity": {
                      "description": "Quantity.",
                      "example": 1,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "discountAmount": {
                      "description": "Discount applied to this line, minor units.",
                      "example": 0,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "taxAmount": {
                      "description": "Tax component of this line, minor units.",
                      "example": 10000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "taxrateId": {
                      "example": "tax_ca",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "totalAmount": {
                      "description": "Line total (`unitAmount × unitQuantity − discountAmount + taxAmount`), minor units.",
                      "example": 125000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "refundAmount": {
                      "example": 0,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "refundedAt": {
                      "example": "2026-02-20T00:00:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "notes": {
                      "example": "Renewal for the 2026 contract year.",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 5000,
                          "description": "Extra-long free text such as internal notes. Max 5000 chars.",
                          "example": "Net-30 terms agreed with Acme Industries."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "example": "2026-01-15T09:30:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "updatedAt": {
                      "example": "2026-02-01T14:20:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "attachments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "example": "att_5001",
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256,
                  "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                },
                "url": {
                  "description": "Hosted file URL.",
                  "example": "https://files.acme.example/invoices/INV-1042.pdf",
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uri"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "mimeType": {
                  "description": "MIME type, e.g. `application/pdf`.",
                  "example": "application/pdf",
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 255
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "fileName": {
                  "example": "INV-1042.pdf",
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 255
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "additionalProperties": false
            }
          },
          "appliedTo": {
            "description": "The invoice(s) this credit memo credits or is applied to, when the platform records the link. One entry per application; amount in minor units when the platform gives a per-application amount.",
            "example": [
              {
                "invoiceId": "inv_1042",
                "invoiceNumber": "INV-1042",
                "amount": 125000,
                "appliedAt": "2026-02-01"
              }
            ],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "invoiceId": {
                  "description": "Platform id of the invoice, the same id the Invoice resource reports.",
                  "example": "inv_1042",
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "invoiceNumber": {
                  "description": "Human-readable number of the invoice, when the platform gives it.",
                  "example": "INV-1042",
                  "type": "string",
                  "minLength": 1
                },
                "amount": {
                  "description": "Amount of this credit memo applied to this invoice, in minor units.",
                  "example": 125000,
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991,
                      "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                      "example": 125000
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "appliedAt": {
                  "description": "When the credit was applied to this invoice.",
                  "example": "2026-02-01",
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ISO8601"
                    },
                    {
                      "$ref": "#/components/schemas/CalendarDate"
                    }
                  ]
                }
              },
              "additionalProperties": false,
              "description": "One invoice this credit memo is linked to. At least one of `invoiceId` and `invoiceNumber` is always present; some platforms record the link by number only."
            }
          },
          "postedAt": {
            "example": "2026-02-01",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "$ref": "#/components/schemas/CalendarDate"
              }
            ]
          },
          "dueAt": {
            "example": "2026-03-03",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "$ref": "#/components/schemas/CalendarDate"
              }
            ]
          },
          "paidAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": null
          },
          "cancelledAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": null
          },
          "refundedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": null
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "AccountingQuote": {
        "type": "object",
        "properties": {
          "id": {
            "example": "quo_5501",
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
          },
          "status": {
            "example": "SENT",
            "type": "string",
            "enum": [
              "DRAFT",
              "SENT",
              "ACCEPTED",
              "DECLINED",
              "INVOICED",
              "EXPIRED",
              "DELETED",
              "unknown"
            ]
          },
          "quoteNumber": {
            "example": "QU-0042",
            "type": "string"
          },
          "reference": {
            "example": "Website redesign, phase 2",
            "type": "string"
          },
          "contactId": {
            "example": "cus_4Qm2Xa9Lr",
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "totalAmount": {
            "example": 125000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "subtotalAmount": {
            "example": 115000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "taxAmount": {
            "example": 10000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "discountAmount": {
            "example": 0,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "example": "Phase 2 proposal",
            "type": "string"
          },
          "summary": {
            "example": "Design and build, six weeks.",
            "type": "string"
          },
          "terms": {
            "example": "Valid for 30 days from issue.",
            "type": "string"
          },
          "url": {
            "example": "https://app.acme.example/quotes/QU-0042",
            "type": "string",
            "format": "uri"
          },
          "lineAmountsIncludeTax": {
            "description": "Whether line `unitAmount`/`totalAmount` already include tax. `true` = tax-inclusive, `false` = tax-exclusive (tax is added on top), `null` = the platform applies no tax to this document. Same three-state meaning as on invoices and credit memos.",
            "example": false,
            "type": [
              "boolean",
              "null"
            ]
          },
          "lineItems": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "example": "li_3001",
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256,
                      "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                    },
                    "accountId": {
                      "description": "Account.id of the ledger account this line posts to. Always the same identifier space as `Account.id`, so it resolves against the accounts resource directly.",
                      "example": "acct_4000",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountCode": {
                      "description": "Human-facing chart-of-accounts code for `accountId`, when the platform exposes one separately (Xero `AccountCode`). Mirrors `Account.customerDefinedCode`. Display only — platforms do not guarantee it unique or stable, so never join on it.",
                      "example": "4000",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 64
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemId": {
                      "example": "item_900",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemName": {
                      "example": "Annual platform subscription",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255,
                          "description": "Display name (display label or title). Max 255 chars.",
                          "example": "Acme Industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemDescription": {
                      "example": "Acme Industries annual platform subscription",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 2000,
                          "description": "Long-form free text. Max 2000 chars.",
                          "example": "Industrial supplies and equipment."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemSku": {
                      "example": "SUB-ANNUAL",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 256
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemVariants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "example": "ref_2001",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256,
                            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                          },
                          "name": {
                            "example": "Acme Industries",
                            "type": "string",
                            "maxLength": 255,
                            "description": "Display name (display label or title). Max 255 chars."
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "example": "ref_2001",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256,
                            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                          },
                          "name": {
                            "example": "Acme Industries",
                            "type": "string",
                            "maxLength": 255,
                            "description": "Display name (display label or title). Max 255 chars."
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "categoryIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256,
                        "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                        "example": "acme-industries"
                      }
                    },
                    "unitAmount": {
                      "description": "Per-unit price in the parent document currency, minor units.",
                      "example": 115000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "unitQuantity": {
                      "description": "Quantity.",
                      "example": 1,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "discountAmount": {
                      "description": "Discount applied to this line, minor units.",
                      "example": 0,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "taxAmount": {
                      "description": "Tax component of this line, minor units.",
                      "example": 10000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "taxrateId": {
                      "example": "tax_ca",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "totalAmount": {
                      "description": "Line total (`unitAmount × unitQuantity − discountAmount + taxAmount`), minor units.",
                      "example": 125000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "refundAmount": {
                      "example": 0,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "refundedAt": {
                      "example": "2026-02-20T00:00:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "notes": {
                      "example": "Renewal for the 2026 contract year.",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 5000,
                          "description": "Extra-long free text such as internal notes. Max 5000 chars.",
                          "example": "Net-30 terms agreed with Acme Industries."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "example": "2026-01-15T09:30:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "updatedAt": {
                      "example": "2026-02-01T14:20:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "issuedAt": {
            "example": "2026-02-01",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "$ref": "#/components/schemas/CalendarDate"
              }
            ]
          },
          "expiresAt": {
            "example": "2026-03-03",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "$ref": "#/components/schemas/CalendarDate"
              }
            ]
          },
          "acceptedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": null
          },
          "declinedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": null
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "AccountingExpense": {
        "type": "object",
        "properties": {
          "id": {
            "example": "exp_5005",
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
          },
          "name": {
            "example": "Client travel — Acme Industries onsite",
            "type": "string"
          },
          "accountId": {
            "example": "acct_4000",
            "type": "string"
          },
          "contactId": {
            "example": "cus_4Qm2Xa9Lr",
            "type": "string"
          },
          "userId": {
            "example": "usr_jane",
            "type": "string"
          },
          "approverUserId": {
            "example": "usr_finance_lead",
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "paymentMethod": {
            "example": "CARD",
            "type": "string"
          },
          "taxAmount": {
            "example": 10000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "totalAmount": {
            "example": 125000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "reimbursedAmount": {
            "example": 125000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "lineAmountsIncludeTax": {
            "description": "Whether line amounts already include tax. `null` = no tax applies, so the distinction does not arise.",
            "example": false,
            "type": [
              "boolean",
              "null"
            ]
          },
          "lineItems": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "example": "li_3001",
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256,
                      "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                    },
                    "accountId": {
                      "description": "Account.id of the ledger account this line posts to. Always the same identifier space as `Account.id`, so it resolves against the accounts resource directly.",
                      "example": "acct_4000",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountCode": {
                      "description": "Human-facing chart-of-accounts code for `accountId`, when the platform exposes one separately (Xero `AccountCode`). Mirrors `Account.customerDefinedCode`. Display only — platforms do not guarantee it unique or stable, so never join on it.",
                      "example": "4000",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 64
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemId": {
                      "example": "item_900",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemName": {
                      "example": "Annual platform subscription",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255,
                          "description": "Display name (display label or title). Max 255 chars.",
                          "example": "Acme Industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemDescription": {
                      "example": "Acme Industries annual platform subscription",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 2000,
                          "description": "Long-form free text. Max 2000 chars.",
                          "example": "Industrial supplies and equipment."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemSku": {
                      "example": "SUB-ANNUAL",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 256
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemVariants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "example": "ref_2001",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256,
                            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                          },
                          "name": {
                            "example": "Acme Industries",
                            "type": "string",
                            "maxLength": 255,
                            "description": "Display name (display label or title). Max 255 chars."
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "example": "ref_2001",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256,
                            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                          },
                          "name": {
                            "example": "Acme Industries",
                            "type": "string",
                            "maxLength": 255,
                            "description": "Display name (display label or title). Max 255 chars."
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "categoryIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256,
                        "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                        "example": "acme-industries"
                      }
                    },
                    "unitAmount": {
                      "description": "Per-unit price in the parent document currency, minor units.",
                      "example": 115000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "unitQuantity": {
                      "description": "Quantity.",
                      "example": 1,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "discountAmount": {
                      "description": "Discount applied to this line, minor units.",
                      "example": 0,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "taxAmount": {
                      "description": "Tax component of this line, minor units.",
                      "example": 10000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "taxrateId": {
                      "example": "tax_ca",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "totalAmount": {
                      "description": "Line total (`unitAmount × unitQuantity − discountAmount + taxAmount`), minor units.",
                      "example": 125000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "refundAmount": {
                      "example": 0,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "refundedAt": {
                      "example": "2026-02-20T00:00:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "notes": {
                      "example": "Renewal for the 2026 contract year.",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 5000,
                          "description": "Extra-long free text such as internal notes. Max 5000 chars.",
                          "example": "Net-30 terms agreed with Acme Industries."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "example": "2026-01-15T09:30:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "updatedAt": {
                      "example": "2026-02-01T14:20:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "postedAt": {
            "example": "2026-02-01",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "$ref": "#/components/schemas/CalendarDate"
              }
            ]
          },
          "approvedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-05T00:00:00Z"
          },
          "reimbursedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-20T00:00:00Z"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "AccountingInvoice": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Platform-specific invoice identifier.",
            "example": "inv_1042",
            "type": "string"
          },
          "type": {
            "example": "INVOICE",
            "type": "string",
            "enum": [
              "INVOICE",
              "BILL",
              "CREDITMEMO"
            ],
            "description": "Document kind. `INVOICE` = accounts receivable, `BILL` = accounts payable, `CREDITMEMO` = credit note."
          },
          "status": {
            "example": "PAID",
            "type": "string",
            "enum": [
              "DRAFT",
              "AUTHORIZED",
              "SUBMITTED",
              "PAID",
              "PARTIALLY_PAID",
              "OVERDUE",
              "VOIDED",
              "PARTIALLY_REFUNDED",
              "REFUNDED",
              "DELETED",
              "unknown"
            ],
            "description": "Canonical invoice lifecycle state. Platforms map their own vocabularies to these values; values that cannot be mapped become `\"unknown\"` rather than being silently dropped."
          },
          "invoiceNumber": {
            "description": "Human-readable invoice number as shown to the customer.",
            "example": "INV-1042",
            "type": "string"
          },
          "contactId": {
            "description": "Contact.id of the customer being invoiced.",
            "example": "cus_4Qm2Xa9Lr",
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "totalAmount": {
            "description": "Grand total including tax, in the invoice currency (minor units).",
            "example": 125000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "taxAmount": {
            "description": "Total tax component of `totalAmount` (minor units).",
            "example": 10000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "discountAmount": {
            "description": "Total discount applied (minor units).",
            "example": 0,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "paidAmount": {
            "description": "Amount collected so far (minor units).",
            "example": 125000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "balanceAmount": {
            "description": "Outstanding balance (`totalAmount` − `paidAmount`), minor units.",
            "example": 0,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "refundAmount": {
            "description": "Amount refunded to the customer, if any (minor units).",
            "example": 0,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "refundReason": {
            "description": "Free-form refund explanation.",
            "example": "No refund issued",
            "type": "string"
          },
          "paymentCollectionMethod": {
            "example": "send_invoice",
            "type": "string",
            "enum": [
              "send_invoice",
              "charge_automatically"
            ],
            "description": "How the customer will be charged."
          },
          "reference": {
            "description": "Customer-facing reference (PO number, project code).",
            "example": "PO-ACME-2026",
            "type": "string"
          },
          "notes": {
            "description": "Free-form notes shown on the invoice.",
            "example": "Thank you for your business, Acme Industries.",
            "type": "string"
          },
          "url": {
            "description": "Hosted invoice URL, when the platform provides one.",
            "example": "https://app.acme.example/invoices/INV-1042",
            "type": "string",
            "format": "uri"
          },
          "send": {
            "description": "When `true` on create, the platform emails the invoice immediately.",
            "example": true,
            "type": "boolean"
          },
          "lineAmountsIncludeTax": {
            "description": "Whether line `unitAmount`/`totalAmount` already include tax. `true` = tax-inclusive, `false` = tax-exclusive (tax is added on top), `null` = the platform applies no tax to this document, so the distinction does not arise and both readings give the same total. Without it, line items reconcile to the header by different arithmetic with nothing in the response saying which — inference from the totals breaks on zero-tax lines, mixed rates, rounding, and single-line documents where the two readings coincide.",
            "example": false,
            "type": [
              "boolean",
              "null"
            ]
          },
          "lineItems": {
            "description": "Invoice line items.",
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "example": "li_3001",
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256,
                      "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                    },
                    "accountId": {
                      "description": "Account.id of the ledger account this line posts to. Always the same identifier space as `Account.id`, so it resolves against the accounts resource directly.",
                      "example": "acct_4000",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountCode": {
                      "description": "Human-facing chart-of-accounts code for `accountId`, when the platform exposes one separately (Xero `AccountCode`). Mirrors `Account.customerDefinedCode`. Display only — platforms do not guarantee it unique or stable, so never join on it.",
                      "example": "4000",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 64
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemId": {
                      "example": "item_900",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemName": {
                      "example": "Annual platform subscription",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255,
                          "description": "Display name (display label or title). Max 255 chars.",
                          "example": "Acme Industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemDescription": {
                      "example": "Acme Industries annual platform subscription",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 2000,
                          "description": "Long-form free text. Max 2000 chars.",
                          "example": "Industrial supplies and equipment."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemSku": {
                      "example": "SUB-ANNUAL",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 256
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemVariants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "example": "ref_2001",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256,
                            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                          },
                          "name": {
                            "example": "Acme Industries",
                            "type": "string",
                            "maxLength": 255,
                            "description": "Display name (display label or title). Max 255 chars."
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "example": "ref_2001",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256,
                            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                          },
                          "name": {
                            "example": "Acme Industries",
                            "type": "string",
                            "maxLength": 255,
                            "description": "Display name (display label or title). Max 255 chars."
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "categoryIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256,
                        "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                        "example": "acme-industries"
                      }
                    },
                    "unitAmount": {
                      "description": "Per-unit price in the parent document currency, minor units.",
                      "example": 115000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "unitQuantity": {
                      "description": "Quantity.",
                      "example": 1,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "discountAmount": {
                      "description": "Discount applied to this line, minor units.",
                      "example": 0,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "taxAmount": {
                      "description": "Tax component of this line, minor units.",
                      "example": 10000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "taxrateId": {
                      "example": "tax_ca",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "totalAmount": {
                      "description": "Line total (`unitAmount × unitQuantity − discountAmount + taxAmount`), minor units.",
                      "example": 125000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "refundAmount": {
                      "example": 0,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "refundedAt": {
                      "example": "2026-02-20T00:00:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "notes": {
                      "example": "Renewal for the 2026 contract year.",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 5000,
                          "description": "Extra-long free text such as internal notes. Max 5000 chars.",
                          "example": "Net-30 terms agreed with Acme Industries."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "example": "2026-01-15T09:30:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "updatedAt": {
                      "example": "2026-02-01T14:20:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "attachments": {
            "description": "File attachments linked to the invoice.",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "example": "att_5001",
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256,
                  "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                },
                "url": {
                  "description": "Hosted file URL.",
                  "example": "https://files.acme.example/invoices/INV-1042.pdf",
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uri"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "mimeType": {
                  "description": "MIME type, e.g. `application/pdf`.",
                  "example": "application/pdf",
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 255
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "fileName": {
                  "example": "INV-1042.pdf",
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 255
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "additionalProperties": false
            }
          },
          "postedAt": {
            "description": "Invoice date — when it was issued.",
            "example": "2026-02-01",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "$ref": "#/components/schemas/CalendarDate"
              }
            ]
          },
          "dueAt": {
            "description": "Payment due date.",
            "example": "2026-03-03",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "$ref": "#/components/schemas/CalendarDate"
              }
            ]
          },
          "paidAt": {
            "$ref": "#/components/schemas/ISO8601",
            "description": "When the invoice was fully paid.",
            "example": "2026-02-20T00:00:00Z"
          },
          "cancelledAt": {
            "$ref": "#/components/schemas/ISO8601",
            "description": "When the invoice was voided.",
            "example": null
          },
          "refundedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "description": "When the invoice was refunded.",
            "example": null
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "description": "Platform timestamp when the record was created.",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "description": "Platform timestamp of the last modification.",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "description": "Complete unmodified raw platform response.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false,
        "description": "Customer invoice — a request for payment issued to a customer."
      },
      "AccountingJournal": {
        "type": "object",
        "properties": {
          "id": {
            "example": "jrnl_9001",
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
          },
          "description": {
            "example": "Sales revenue recognition — INV-1042",
            "type": "string"
          },
          "reference": {
            "example": "INV-1042",
            "type": "string"
          },
          "source": {
            "example": "invoice",
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "taxAmount": {
            "example": 10000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "taxrateId": {
            "example": "tax_ca",
            "type": "string"
          },
          "lineItems": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "example": "jli_7001",
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256,
                      "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                    },
                    "accountId": {
                      "example": "acct_4000",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "contactId": {
                      "example": "cus_4Qm2Xa9Lr",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "invoiceId": {
                      "example": "inv_1042",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "paymentId": {
                      "example": "pay_8001",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "projectId": {
                      "example": "proj_500",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "organizationId": {
                      "example": "org_acme",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "groupId": {
                      "example": "grp_100",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "categoryIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256,
                        "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                        "example": "acme-industries"
                      }
                    },
                    "description": {
                      "example": "Sales revenue — INV-1042",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 2000,
                          "description": "Long-form free text. Max 2000 chars.",
                          "example": "Industrial supplies and equipment."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "debitAmount": {
                      "description": "Debit side, minor units.",
                      "example": 125000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "creditAmount": {
                      "description": "Credit side, minor units.",
                      "example": 0,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "taxAmount": {
                      "example": 10000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "totalAmount": {
                      "example": 125000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "postedAt": {
            "example": "2026-02-01",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "$ref": "#/components/schemas/CalendarDate"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "AccountingOrder": {
        "type": "object",
        "properties": {
          "id": {
            "example": "ord_7001",
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
          },
          "status": {
            "example": "COMPLETED",
            "type": "string",
            "enum": [
              "DRAFT",
              "ACTIVE",
              "COMPLETED",
              "CANCELLED",
              "REFUNDED",
              "unknown"
            ]
          },
          "type": {
            "example": "SALES",
            "type": "string",
            "enum": [
              "SALES",
              "PURCHASE",
              "unknown"
            ]
          },
          "accountId": {
            "example": "acct_4000",
            "type": "string"
          },
          "contactId": {
            "example": "cus_4Qm2Xa9Lr",
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "totalAmount": {
            "example": 125000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "lineAmountsIncludeTax": {
            "description": "Whether line `unitAmount`/`totalAmount` already include tax. `true` = tax-inclusive, `false` = tax-exclusive (tax is added on top), `null` = the platform applies no tax to this document, so the distinction does not arise and both readings give the same total. Without it, line items reconcile to the header by different arithmetic with nothing in the response saying which — inference from the totals breaks on zero-tax lines, mixed rates, rounding, and single-line documents where the two readings coincide.",
            "example": false,
            "type": [
              "boolean",
              "null"
            ]
          },
          "lineItems": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "example": "li_3001",
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256,
                      "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                    },
                    "accountId": {
                      "description": "Account.id of the ledger account this line posts to. Always the same identifier space as `Account.id`, so it resolves against the accounts resource directly.",
                      "example": "acct_4000",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountCode": {
                      "description": "Human-facing chart-of-accounts code for `accountId`, when the platform exposes one separately (Xero `AccountCode`). Mirrors `Account.customerDefinedCode`. Display only — platforms do not guarantee it unique or stable, so never join on it.",
                      "example": "4000",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 64
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemId": {
                      "example": "item_900",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemName": {
                      "example": "Annual platform subscription",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255,
                          "description": "Display name (display label or title). Max 255 chars.",
                          "example": "Acme Industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemDescription": {
                      "example": "Acme Industries annual platform subscription",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 2000,
                          "description": "Long-form free text. Max 2000 chars.",
                          "example": "Industrial supplies and equipment."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemSku": {
                      "example": "SUB-ANNUAL",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 256
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemVariants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "example": "ref_2001",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256,
                            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                          },
                          "name": {
                            "example": "Acme Industries",
                            "type": "string",
                            "maxLength": 255,
                            "description": "Display name (display label or title). Max 255 chars."
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "example": "ref_2001",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256,
                            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                          },
                          "name": {
                            "example": "Acme Industries",
                            "type": "string",
                            "maxLength": 255,
                            "description": "Display name (display label or title). Max 255 chars."
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "categoryIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256,
                        "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                        "example": "acme-industries"
                      }
                    },
                    "unitAmount": {
                      "description": "Per-unit price in the parent document currency, minor units.",
                      "example": 115000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "unitQuantity": {
                      "description": "Quantity.",
                      "example": 1,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "discountAmount": {
                      "description": "Discount applied to this line, minor units.",
                      "example": 0,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "taxAmount": {
                      "description": "Tax component of this line, minor units.",
                      "example": 10000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "taxrateId": {
                      "example": "tax_ca",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "totalAmount": {
                      "description": "Line total (`unitAmount × unitQuantity − discountAmount + taxAmount`), minor units.",
                      "example": 125000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "refundAmount": {
                      "example": 0,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "refundedAt": {
                      "example": "2026-02-20T00:00:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "notes": {
                      "example": "Renewal for the 2026 contract year.",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 5000,
                          "description": "Extra-long free text such as internal notes. Max 5000 chars.",
                          "example": "Net-30 terms agreed with Acme Industries."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "example": "2026-01-15T09:30:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "updatedAt": {
                      "example": "2026-02-01T14:20:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "billingAddress": {
            "type": "object",
            "properties": {
              "address1": {
                "description": "Street address, line 1.",
                "example": "2500 Market Street",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "address2": {
                "description": "Street address, line 2 (unit, suite).",
                "example": "Suite 300",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "city": {
                "description": "City or locality.",
                "example": "San Francisco",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "region": {
                "description": "State, province, or region.",
                "example": "CA",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postalCode": {
                "description": "ZIP or postal code.",
                "example": "94114",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 40
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "country": {
                "example": "US",
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ISO3166",
                    "example": "US"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          "shippingAddress": {
            "type": "object",
            "properties": {
              "address1": {
                "description": "Street address, line 1.",
                "example": "2500 Market Street",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "address2": {
                "description": "Street address, line 2 (unit, suite).",
                "example": "Suite 300",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "city": {
                "description": "City or locality.",
                "example": "San Francisco",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "region": {
                "description": "State, province, or region.",
                "example": "CA",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postalCode": {
                "description": "ZIP or postal code.",
                "example": "94114",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 40
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "country": {
                "example": "US",
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ISO3166",
                    "example": "US"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          "postedAt": {
            "example": "2026-02-01",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "$ref": "#/components/schemas/CalendarDate"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "AccountingOrganization": {
        "type": "object",
        "properties": {
          "id": {
            "example": "org_acme",
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
          },
          "name": {
            "example": "Acme Industries",
            "type": "string"
          },
          "legalName": {
            "example": "Acme Industries, Inc.",
            "type": "string"
          },
          "organizationCode": {
            "example": "acme-industries",
            "type": "string"
          },
          "taxNumber": {
            "example": "US-123456789",
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "timezone": {
            "description": "IANA tz database identifier (e.g. `America/New_York`).",
            "example": "America/Los_Angeles",
            "type": "string"
          },
          "website": {
            "example": "https://www.acme.example",
            "type": "string",
            "format": "uri"
          },
          "fiscalYearEndMonth": {
            "description": "1 = January, 12 = December.",
            "example": 12,
            "type": "integer",
            "minimum": 1,
            "maximum": 12
          },
          "parentId": {
            "example": "org_acme_holdings",
            "type": "string"
          },
          "address": {
            "type": "object",
            "properties": {
              "address1": {
                "description": "Street address, line 1.",
                "example": "2500 Market Street",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "address2": {
                "description": "Street address, line 2 (unit, suite).",
                "example": "Suite 300",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "city": {
                "description": "City or locality.",
                "example": "San Francisco",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "region": {
                "description": "State, province, or region.",
                "example": "CA",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postalCode": {
                "description": "ZIP or postal code.",
                "example": "94114",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 40
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "country": {
                "example": "US",
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ISO3166",
                    "example": "US"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "AccountingPurchaseOrder": {
        "type": "object",
        "properties": {
          "id": {
            "example": "po_8001",
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
          },
          "status": {
            "example": "COMPLETED",
            "type": "string",
            "enum": [
              "DRAFT",
              "ACTIVE",
              "COMPLETED",
              "CANCELLED",
              "unknown"
            ]
          },
          "accountId": {
            "example": "acct_4000",
            "type": "string"
          },
          "contactId": {
            "example": "cus_4Qm2Xa9Lr",
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "totalAmount": {
            "example": 125000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "lineAmountsIncludeTax": {
            "description": "Whether line `unitAmount`/`totalAmount` already include tax. `true` = tax-inclusive, `false` = tax-exclusive (tax is added on top), `null` = the platform applies no tax to this document, so the distinction does not arise and both readings give the same total. Without it, line items reconcile to the header by different arithmetic with nothing in the response saying which — inference from the totals breaks on zero-tax lines, mixed rates, rounding, and single-line documents where the two readings coincide.",
            "example": false,
            "type": [
              "boolean",
              "null"
            ]
          },
          "lineItems": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "example": "li_3001",
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256,
                      "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                    },
                    "accountId": {
                      "description": "Account.id of the ledger account this line posts to. Always the same identifier space as `Account.id`, so it resolves against the accounts resource directly.",
                      "example": "acct_4000",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountCode": {
                      "description": "Human-facing chart-of-accounts code for `accountId`, when the platform exposes one separately (Xero `AccountCode`). Mirrors `Account.customerDefinedCode`. Display only — platforms do not guarantee it unique or stable, so never join on it.",
                      "example": "4000",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 64
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemId": {
                      "example": "item_900",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemName": {
                      "example": "Annual platform subscription",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255,
                          "description": "Display name (display label or title). Max 255 chars.",
                          "example": "Acme Industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemDescription": {
                      "example": "Acme Industries annual platform subscription",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 2000,
                          "description": "Long-form free text. Max 2000 chars.",
                          "example": "Industrial supplies and equipment."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemSku": {
                      "example": "SUB-ANNUAL",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 256
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemVariants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "example": "ref_2001",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256,
                            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                          },
                          "name": {
                            "example": "Acme Industries",
                            "type": "string",
                            "maxLength": 255,
                            "description": "Display name (display label or title). Max 255 chars."
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "example": "ref_2001",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256,
                            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                          },
                          "name": {
                            "example": "Acme Industries",
                            "type": "string",
                            "maxLength": 255,
                            "description": "Display name (display label or title). Max 255 chars."
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "categoryIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256,
                        "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                        "example": "acme-industries"
                      }
                    },
                    "unitAmount": {
                      "description": "Per-unit price in the parent document currency, minor units.",
                      "example": 115000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "unitQuantity": {
                      "description": "Quantity.",
                      "example": 1,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "discountAmount": {
                      "description": "Discount applied to this line, minor units.",
                      "example": 0,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "taxAmount": {
                      "description": "Tax component of this line, minor units.",
                      "example": 10000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "taxrateId": {
                      "example": "tax_ca",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "totalAmount": {
                      "description": "Line total (`unitAmount × unitQuantity − discountAmount + taxAmount`), minor units.",
                      "example": 125000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "refundAmount": {
                      "example": 0,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "refundedAt": {
                      "example": "2026-02-20T00:00:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "notes": {
                      "example": "Renewal for the 2026 contract year.",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 5000,
                          "description": "Extra-long free text such as internal notes. Max 5000 chars.",
                          "example": "Net-30 terms agreed with Acme Industries."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "example": "2026-01-15T09:30:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "updatedAt": {
                      "example": "2026-02-01T14:20:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "billingAddress": {
            "type": "object",
            "properties": {
              "address1": {
                "description": "Street address, line 1.",
                "example": "2500 Market Street",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "address2": {
                "description": "Street address, line 2 (unit, suite).",
                "example": "Suite 300",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "city": {
                "description": "City or locality.",
                "example": "San Francisco",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "region": {
                "description": "State, province, or region.",
                "example": "CA",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postalCode": {
                "description": "ZIP or postal code.",
                "example": "94114",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 40
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "country": {
                "example": "US",
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ISO3166",
                    "example": "US"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          "shippingAddress": {
            "type": "object",
            "properties": {
              "address1": {
                "description": "Street address, line 1.",
                "example": "2500 Market Street",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "address2": {
                "description": "Street address, line 2 (unit, suite).",
                "example": "Suite 300",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "city": {
                "description": "City or locality.",
                "example": "San Francisco",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "region": {
                "description": "State, province, or region.",
                "example": "CA",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postalCode": {
                "description": "ZIP or postal code.",
                "example": "94114",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 40
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "country": {
                "example": "US",
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ISO3166",
                    "example": "US"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          "postedAt": {
            "example": "2026-02-01",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "$ref": "#/components/schemas/CalendarDate"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "AccountingSalesOrder": {
        "type": "object",
        "properties": {
          "id": {
            "example": "so_7501",
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
          },
          "status": {
            "example": "COMPLETED",
            "type": "string",
            "enum": [
              "DRAFT",
              "ACTIVE",
              "COMPLETED",
              "CANCELLED",
              "unknown"
            ]
          },
          "accountId": {
            "example": "acct_4000",
            "type": "string"
          },
          "contactId": {
            "example": "cus_4Qm2Xa9Lr",
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "salesChannel": {
            "example": "direct",
            "type": "string"
          },
          "totalAmount": {
            "example": 125000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "lineAmountsIncludeTax": {
            "description": "Whether line `unitAmount`/`totalAmount` already include tax. `true` = tax-inclusive, `false` = tax-exclusive (tax is added on top), `null` = the platform applies no tax to this document, so the distinction does not arise and both readings give the same total. Without it, line items reconcile to the header by different arithmetic with nothing in the response saying which — inference from the totals breaks on zero-tax lines, mixed rates, rounding, and single-line documents where the two readings coincide.",
            "example": false,
            "type": [
              "boolean",
              "null"
            ]
          },
          "lineItems": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "example": "li_3001",
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256,
                      "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                    },
                    "accountId": {
                      "description": "Account.id of the ledger account this line posts to. Always the same identifier space as `Account.id`, so it resolves against the accounts resource directly.",
                      "example": "acct_4000",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountCode": {
                      "description": "Human-facing chart-of-accounts code for `accountId`, when the platform exposes one separately (Xero `AccountCode`). Mirrors `Account.customerDefinedCode`. Display only — platforms do not guarantee it unique or stable, so never join on it.",
                      "example": "4000",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 64
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemId": {
                      "example": "item_900",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemName": {
                      "example": "Annual platform subscription",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255,
                          "description": "Display name (display label or title). Max 255 chars.",
                          "example": "Acme Industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemDescription": {
                      "example": "Acme Industries annual platform subscription",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 2000,
                          "description": "Long-form free text. Max 2000 chars.",
                          "example": "Industrial supplies and equipment."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemSku": {
                      "example": "SUB-ANNUAL",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 256
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "itemVariants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "example": "ref_2001",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256,
                            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                          },
                          "name": {
                            "example": "Acme Industries",
                            "type": "string",
                            "maxLength": 255,
                            "description": "Display name (display label or title). Max 255 chars."
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "example": "ref_2001",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256,
                            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                          },
                          "name": {
                            "example": "Acme Industries",
                            "type": "string",
                            "maxLength": 255,
                            "description": "Display name (display label or title). Max 255 chars."
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "categoryIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256,
                        "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                        "example": "acme-industries"
                      }
                    },
                    "unitAmount": {
                      "description": "Per-unit price in the parent document currency, minor units.",
                      "example": 115000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "unitQuantity": {
                      "description": "Quantity.",
                      "example": 1,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "discountAmount": {
                      "description": "Discount applied to this line, minor units.",
                      "example": 0,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "taxAmount": {
                      "description": "Tax component of this line, minor units.",
                      "example": 10000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "taxrateId": {
                      "example": "tax_ca",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "totalAmount": {
                      "description": "Line total (`unitAmount × unitQuantity − discountAmount + taxAmount`), minor units.",
                      "example": 125000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "refundAmount": {
                      "example": 0,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "refundedAt": {
                      "example": "2026-02-20T00:00:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "notes": {
                      "example": "Renewal for the 2026 contract year.",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 5000,
                          "description": "Extra-long free text such as internal notes. Max 5000 chars.",
                          "example": "Net-30 terms agreed with Acme Industries."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "example": "2026-01-15T09:30:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "updatedAt": {
                      "example": "2026-02-01T14:20:00Z",
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/ISO8601"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "billingAddress": {
            "type": "object",
            "properties": {
              "address1": {
                "description": "Street address, line 1.",
                "example": "2500 Market Street",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "address2": {
                "description": "Street address, line 2 (unit, suite).",
                "example": "Suite 300",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "city": {
                "description": "City or locality.",
                "example": "San Francisco",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "region": {
                "description": "State, province, or region.",
                "example": "CA",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postalCode": {
                "description": "ZIP or postal code.",
                "example": "94114",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 40
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "country": {
                "example": "US",
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ISO3166",
                    "example": "US"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          "shippingAddress": {
            "type": "object",
            "properties": {
              "address1": {
                "description": "Street address, line 1.",
                "example": "2500 Market Street",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "address2": {
                "description": "Street address, line 2 (unit, suite).",
                "example": "Suite 300",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "city": {
                "description": "City or locality.",
                "example": "San Francisco",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "region": {
                "description": "State, province, or region.",
                "example": "CA",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postalCode": {
                "description": "ZIP or postal code.",
                "example": "94114",
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 40
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "country": {
                "example": "US",
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ISO3166",
                    "example": "US"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          "postedAt": {
            "example": "2026-02-01",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "$ref": "#/components/schemas/CalendarDate"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "AccountingTaxRate": {
        "type": "object",
        "properties": {
          "id": {
            "example": "tax_ca",
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
          },
          "name": {
            "example": "CA Sales Tax",
            "type": "string"
          },
          "description": {
            "example": "California state and local sales tax",
            "type": "string"
          },
          "rate": {
            "example": 8.75,
            "type": "number"
          },
          "isActive": {
            "example": true,
            "type": "boolean"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "AccountingTransaction": {
        "type": "object",
        "properties": {
          "id": {
            "example": "txn_8001",
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
          },
          "accountId": {
            "example": "acct_4000",
            "type": "string"
          },
          "splitAccountId": {
            "example": "acct_1100",
            "type": "string"
          },
          "type": {
            "example": "PAYMENT",
            "type": "string"
          },
          "reference": {
            "example": "INV-1042",
            "type": "string"
          },
          "memo": {
            "example": "Payment received for INV-1042",
            "type": "string"
          },
          "customerMessage": {
            "example": "Thank you for your payment, Acme Industries.",
            "type": "string"
          },
          "paymentMethod": {
            "example": "ACH",
            "type": "string"
          },
          "paymentTerms": {
            "example": "Net 30",
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "subTotalAmount": {
            "example": 115000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "taxAmount": {
            "example": 10000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "totalAmount": {
            "example": 125000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "contacts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "example": "cus_4Qm2Xa9Lr",
                  "type": "string"
                },
                "name": {
                  "example": "Jane Doe",
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          },
          "lineAmountsIncludeTax": {
            "description": "Whether line `unitAmount`/`totalAmount` already include tax. `true` = tax-inclusive, `false` = tax-exclusive (tax is added on top), `null` = the platform applies no tax to this document, so the distinction does not arise and both readings give the same total. Without it, line items reconcile to the header by different arithmetic with nothing in the response saying which — inference from the totals breaks on zero-tax lines, mixed rates, rounding, and single-line documents where the two readings coincide.",
            "example": false,
            "type": [
              "boolean",
              "null"
            ]
          },
          "lineItems": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "example": "tli_6001",
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256,
                      "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
                    },
                    "accountId": {
                      "example": "acct_4000",
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                          "example": "acme-industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountCode": {
                      "description": "Human-facing chart-of-accounts code for `accountId`, when the platform exposes one separately (Xero `AccountCode`). Mirrors `Account.customerDefinedCode`. Display only — platforms do not guarantee it unique or stable, so never join on it.",
                      "example": "4000",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 64
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "name": {
                      "example": "Annual platform subscription",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 255,
                          "description": "Display name (display label or title). Max 255 chars.",
                          "example": "Acme Industries"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "description": {
                      "example": "Acme Industries annual platform subscription",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 2000,
                          "description": "Long-form free text. Max 2000 chars.",
                          "example": "Industrial supplies and equipment."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "objectType": {
                      "example": "sales_item",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 64
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "unitAmount": {
                      "example": 115000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "unitQuantity": {
                      "example": 1,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "totalAmount": {
                      "example": 125000,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "postedAt": {
            "description": "Transaction date — when it was posted. A calendar date where the platform states one.",
            "example": "2026-02-01",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "$ref": "#/components/schemas/CalendarDate"
              }
            ]
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "CRMActivity": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Platform-specific activity identifier.",
            "example": "act_discovery"
          },
          "type": {
            "description": "Activity kind — typical values: `call`, `email`, `meeting`, `task`, `deadline`, `lunch`.",
            "example": "call",
            "type": "string"
          },
          "subject": {
            "description": "Short activity title.",
            "example": "Discovery call",
            "type": "string"
          },
          "note": {
            "description": "Free-form body / agenda / follow-up notes.",
            "example": "Follow up on Q1 expansion",
            "type": "string"
          },
          "contact_id": {
            "description": "Contact.id the activity is linked to.",
            "example": "cont_jane",
            "type": "string"
          },
          "company_id": {
            "description": "Company.id the activity is linked to.",
            "example": "co_acme",
            "type": "string"
          },
          "deal_id": {
            "description": "Deal.id the activity is linked to.",
            "example": "deal_1042",
            "type": "string"
          },
          "owner_id": {
            "description": "Platform user who owns the activity.",
            "example": "usr_olivia",
            "type": "string"
          },
          "due_date": {
            "$ref": "#/components/schemas/ISO8601",
            "description": "Scheduled or due time as ISO 8601.",
            "example": "2026-02-01T14:20:00Z"
          },
          "done": {
            "description": "Whether the activity has been completed.",
            "example": true,
            "type": "boolean"
          },
          "duration_minutes": {
            "description": "Planned or actual duration in minutes.",
            "example": 30,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "created_at": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updated_at": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "description": "Complete unmodified raw platform response."
          }
        },
        "required": [
          "id",
          "metadata"
        ],
        "additionalProperties": false,
        "description": "A scheduled or logged interaction — call, email, meeting, task."
      },
      "CRMCompany": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Platform-specific company identifier.",
            "example": "co_acme"
          },
          "name": {
            "type": "string",
            "description": "Legal or display name of the organisation.",
            "example": "Acme Industries"
          },
          "domain": {
            "description": "Primary web domain (e.g. `example.com`).",
            "example": "acme.example",
            "type": "string"
          },
          "phone": {
            "description": "Main phone number.",
            "example": "+14155550123",
            "type": "string"
          },
          "industry": {
            "description": "Industry or sector. Platform-defined.",
            "example": "Manufacturing",
            "type": "string"
          },
          "size": {
            "description": "Approximate headcount.",
            "example": 350,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "owner_id": {
            "description": "Platform user who owns the record.",
            "example": "usr_olivia",
            "type": "string"
          },
          "address": {
            "description": "Registered or primary postal address.",
            "type": "object",
            "properties": {
              "line1": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255,
                    "example": "2500 Market Street"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "line2": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255,
                    "example": "Suite 300"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "city": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120,
                    "example": "San Francisco"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "region": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120,
                    "example": "CA"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postalCode": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 40,
                    "example": "94114"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "country": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ISO3166",
                    "example": "US"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          "tags": {
            "description": "Free-form labels.",
            "example": [
              "vip",
              "q1-expansion"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created_at": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updated_at": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "accounting_organization_id": {
            "description": "Cross-vertical link — Accounting Organization.id when the same entity is known there.",
            "example": "org_acme",
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "description": "Complete unmodified raw platform response."
          }
        },
        "required": [
          "id",
          "name",
          "metadata"
        ],
        "additionalProperties": false,
        "description": "An organisation or account in the CRM."
      },
      "CRMContact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Platform-specific contact identifier.",
            "example": "cont_jane"
          },
          "first_name": {
            "description": "Given name.",
            "example": "Jane",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "description": "Display name (display label or title). Max 255 chars.",
                "example": "Acme Industries"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_name": {
            "description": "Family name.",
            "example": "Doe",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "description": "Display name (display label or title). Max 255 chars.",
                "example": "Acme Industries"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "description": "Full display name. Derived by the platform when not set explicitly.",
            "example": "Jane Doe",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "description": "Display name (display label or title). Max 255 chars.",
                "example": "Acme Industries"
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "description": "Primary email address.",
            "example": "jane.doe@acme.example",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 320,
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
                "description": "RFC 5321 email address. Max 320 chars.",
                "example": "jane.doe@acme.example"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "description": "Primary phone number.",
            "example": "+14155550123",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "mobile": {
            "description": "Mobile phone number, if distinct from `phone`.",
            "example": "+14155550123",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "description": "Job title.",
            "example": "Head of Finance",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "description": "Display name (display label or title). Max 255 chars.",
                "example": "Acme Industries"
              },
              {
                "type": "null"
              }
            ]
          },
          "company_id": {
            "description": "Linked Company.id. Empty for unattached contacts.",
            "example": "co_acme",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                "example": "acme-industries"
              },
              {
                "type": "null"
              }
            ]
          },
          "owner_id": {
            "description": "Platform user who owns the record.",
            "example": "usr_olivia",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                "example": "acme-industries"
              },
              {
                "type": "null"
              }
            ]
          },
          "stage": {
            "description": "Lifecycle stage (e.g. `lead`, `customer`). Platform-defined.",
            "example": "customer",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "tags": {
            "description": "Free-form labels.",
            "example": [
              "vip",
              "q1-expansion"
            ],
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 255
            }
          },
          "address": {
            "description": "Primary postal address.",
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "line1": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255,
                        "example": "2500 Market Street"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "line2": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255,
                        "example": "Suite 300"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "city": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120,
                        "example": "San Francisco"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "region": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120,
                        "example": "CA"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postalCode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 40,
                        "example": "94114"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/ISO3166",
                        "example": "US"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "example": "2026-01-15T09:30:00Z",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601",
                "example": "2026-01-15T09:30:00Z"
              },
              {
                "type": "null"
              }
            ]
          },
          "updated_at": {
            "example": "2026-02-01T14:20:00Z",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601",
                "example": "2026-01-15T09:30:00Z"
              },
              {
                "type": "null"
              }
            ]
          },
          "ecommerce_customer_id": {
            "description": "Cross-vertical link — Ecommerce Customer.id when the same person is known there.",
            "example": "cus_jane",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                "example": "acme-industries"
              },
              {
                "type": "null"
              }
            ]
          },
          "accounting_contact_id": {
            "description": "Cross-vertical link — Accounting Contact.id when the same person is known there.",
            "example": "cont_jane",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                "example": "acme-industries"
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "description": "Complete unmodified raw platform response. Use this for fields not yet normalised."
          }
        },
        "required": [
          "id",
          "metadata"
        ],
        "additionalProperties": false,
        "description": "A person known to the CRM — lead, prospect, customer, or contact."
      },
      "CRMDeal": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Platform-specific deal identifier.",
            "example": "deal_1042"
          },
          "title": {
            "type": "string",
            "description": "Human-readable deal name.",
            "example": "Acme Q1 Expansion"
          },
          "value": {
            "description": "Monetary value with currency.",
            "type": "object",
            "properties": {
              "amount": {
                "type": "number",
                "minimum": 0,
                "description": "Amount in the currency, non-negative.",
                "example": 1200000
              },
              "currency": {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ],
            "additionalProperties": false
          },
          "status": {
            "description": "Open/won/lost state. Platform-defined vocabulary.",
            "example": "open",
            "type": "string"
          },
          "stage": {
            "description": "Current stage label (e.g. `Qualified`, `Negotiation`).",
            "example": "Negotiation",
            "type": "string"
          },
          "stage_id": {
            "description": "Platform-specific stage identifier within the pipeline.",
            "example": "stage_negotiation",
            "type": "string"
          },
          "pipeline_id": {
            "description": "Pipeline.id the deal belongs to.",
            "example": "pipe_sales",
            "type": "string"
          },
          "contact_ids": {
            "description": "Contact.ids associated with the deal.",
            "example": [
              "cont_jane"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "company_id": {
            "description": "Primary Company.id associated with the deal.",
            "example": "co_acme",
            "type": "string"
          },
          "owner_id": {
            "description": "Platform user who owns the record.",
            "example": "usr_olivia",
            "type": "string"
          },
          "close_date": {
            "$ref": "#/components/schemas/ISO8601",
            "description": "Expected or actual close date as ISO 8601.",
            "example": "2026-03-31T00:00:00Z"
          },
          "probability": {
            "description": "Estimated probability of winning, 0–100.",
            "example": 60,
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "created_at": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updated_at": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "accounting_invoice_id": {
            "description": "Cross-vertical link — Accounting Invoice.id emitted when the deal closes won.",
            "example": "inv_1042",
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "description": "Complete unmodified raw platform response."
          }
        },
        "required": [
          "id",
          "title",
          "metadata"
        ],
        "additionalProperties": false,
        "description": "A sales opportunity / pipeline deal."
      },
      "CRMNote": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Platform-specific note identifier.",
            "example": "note_q1"
          },
          "content": {
            "type": "string",
            "description": "Free-form note body.",
            "example": "Follow up on Q1 expansion"
          },
          "contact_id": {
            "description": "Contact.id the note is attached to.",
            "example": "cont_jane",
            "type": "string"
          },
          "company_id": {
            "description": "Company.id the note is attached to.",
            "example": "co_acme",
            "type": "string"
          },
          "deal_id": {
            "description": "Deal.id the note is attached to.",
            "example": "deal_1042",
            "type": "string"
          },
          "owner_id": {
            "description": "Platform user who authored the note.",
            "example": "usr_olivia",
            "type": "string"
          },
          "created_at": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updated_at": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "description": "Complete unmodified raw platform response."
          }
        },
        "required": [
          "id",
          "content",
          "metadata"
        ],
        "additionalProperties": false,
        "description": "A free-form note attached to a contact, company, or deal."
      },
      "CRMPipeline": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Platform-specific pipeline identifier.",
            "example": "pipe_sales"
          },
          "name": {
            "type": "string",
            "description": "Human-readable pipeline label.",
            "example": "Sales"
          },
          "stages": {
            "description": "Ordered list of stages.",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Platform-specific stage identifier.",
                  "example": "stage_negotiation"
                },
                "name": {
                  "type": "string",
                  "description": "Human-readable stage label (e.g. `Qualified`, `Proposal sent`).",
                  "example": "Negotiation"
                },
                "order": {
                  "description": "Position in the pipeline, 0-indexed.",
                  "example": 3,
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "win_probability": {
                  "description": "Default probability (0–100) assigned to deals in this stage.",
                  "example": 60,
                  "type": "number",
                  "minimum": 0,
                  "maximum": 100
                }
              },
              "required": [
                "id",
                "name"
              ],
              "additionalProperties": false,
              "description": "A single stage within a deal pipeline."
            }
          },
          "is_active": {
            "description": "Whether the pipeline is in active use.",
            "example": true,
            "type": "boolean"
          },
          "created_at": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updated_at": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "description": "Complete unmodified raw platform response."
          }
        },
        "required": [
          "id",
          "name",
          "metadata"
        ],
        "additionalProperties": false,
        "description": "A deal pipeline — a named sequence of sales stages."
      },
      "CRMPipelineStage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Platform-specific stage identifier.",
            "example": "stage_negotiation"
          },
          "name": {
            "type": "string",
            "description": "Human-readable stage label (e.g. `Qualified`, `Proposal sent`).",
            "example": "Negotiation"
          },
          "order": {
            "description": "Position in the pipeline, 0-indexed.",
            "example": 3,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "win_probability": {
            "description": "Default probability (0–100) assigned to deals in this stage.",
            "example": 60,
            "type": "number",
            "minimum": 0,
            "maximum": 100
          }
        },
        "required": [
          "id",
          "name"
        ],
        "additionalProperties": false,
        "description": "A single stage within a deal pipeline."
      },
      "CRMWebhookEvent": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Unique event ID from the platform, if provided.",
            "example": "evt_cont_jane_created",
            "type": "string"
          },
          "platform": {
            "type": "string",
            "description": "Adapter slug, e.g. `hubspot`.",
            "example": "hubspot"
          },
          "type": {
            "type": "string",
            "description": "Dot-notation `resource.action` string, e.g. `contact.created`. Always lower-case.",
            "example": "contact.created"
          },
          "resourceType": {
            "type": "string",
            "enum": [
              "unknown"
            ],
            "description": "Canonical resource category for the webhook payload. `unknown` when the event cannot be classified.",
            "example": "unknown"
          },
          "action": {
            "type": "string",
            "enum": [
              "created",
              "updated",
              "deleted",
              "unknown"
            ],
            "description": "Lifecycle action implied by the event.",
            "example": "created"
          },
          "resourceId": {
            "type": "string",
            "description": "Platform-specific resource identifier.",
            "example": "cont_jane"
          },
          "tenantId": {
            "description": "Tenant / organisation ID when available.",
            "example": "acme",
            "type": "string"
          },
          "connectionId": {
            "description": "Resolved connection UUID — populated by the dispatcher when a single matching connection exists.",
            "example": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90",
            "type": "string"
          },
          "payload": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "description": "Complete, unmodified raw platform webhook payload."
          }
        },
        "required": [
          "platform",
          "type",
          "resourceType",
          "action",
          "resourceId",
          "payload"
        ],
        "additionalProperties": false,
        "description": "Canonical webhook event envelope emitted after verifying a platform signature."
      },
      "CRMSyncJob": {
        "type": "object",
        "description": "Background sync job. Created by `POST /v1/{vertical}/sync`.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "sync_1042"
          },
          "vertical": {
            "type": "string",
            "example": "accounting"
          },
          "connectionId": {
            "type": "string",
            "format": "uuid",
            "example": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90"
          },
          "platform": {
            "type": "string",
            "example": "xero"
          },
          "tenantId": {
            "type": "string",
            "nullable": true,
            "example": "acme"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed"
            ],
            "example": "completed"
          },
          "progress": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "object",
              "properties": {
                "synced": {
                  "type": "integer",
                  "example": 128
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "running",
                    "completed",
                    "skipped",
                    "failed"
                  ],
                  "example": "completed"
                },
                "error": {
                  "type": "string",
                  "example": "rate limited by upstream"
                }
              }
            }
          },
          "error": {
            "type": "string",
            "nullable": true,
            "example": null
          },
          "callbackUrl": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "example": "https://hooks.acme.example/sync"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "startedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ],
            "example": "2026-01-15T09:30:00Z"
          },
          "completedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ],
            "example": "2026-02-01T14:20:00Z"
          },
          "origin": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "manual",
              "api",
              "connect",
              "boot",
              "schedule",
              null
            ],
            "description": "Why the job was queued: `api` (POST /v1/{vertical}/sync), `manual` (the admin console), `connect` (right after a Connect Link), `boot` (DATA_STORE_AUTO_SYNC_ON_BOOT) or `schedule` (the connection's sync schedule). Null on jobs queued before this field existed.",
            "example": "schedule"
          }
        },
        "required": [
          "id",
          "vertical",
          "connectionId",
          "platform",
          "status",
          "createdAt"
        ]
      },
      "CRMProvider": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "description": "Unique adapter identifier",
            "example": "hubspot"
          },
          "name": {
            "type": "string",
            "example": "HubSpot"
          },
          "description": {
            "type": "string",
            "example": "CRM, sales, and marketing platform."
          },
          "website": {
            "type": "string",
            "format": "uri",
            "example": "https://www.hubspot.com"
          },
          "category": {
            "type": "string",
            "enum": [
              "crm",
              "sales",
              "marketing"
            ],
            "example": "crm"
          },
          "primary_color": {
            "$ref": "#/components/schemas/HexColor"
          },
          "auth_type": {
            "type": "string",
            "enum": [
              "oauth2",
              "oauth2_cc",
              "api_key",
              "session",
              "local"
            ],
            "example": "oauth2"
          },
          "hq_country": {
            "$ref": "#/components/schemas/ISO3166"
          },
          "docs_url": {
            "type": "string",
            "format": "uri",
            "example": "https://developers.hubspot.com"
          },
          "pricing_url": {
            "type": "string",
            "format": "uri",
            "example": "https://www.hubspot.com/pricing"
          },
          "founded_year": {
            "type": "integer",
            "example": 2006
          },
          "logo": {
            "description": "Base64-encoded SVG logo, or null if not yet added",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "EcommerceAddressSchema": {
        "type": "object",
        "properties": {
          "line1": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "example": "2500 Market Street"
              },
              {
                "type": "null"
              }
            ]
          },
          "line2": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "example": "Suite 300"
              },
              {
                "type": "null"
              }
            ]
          },
          "city": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120,
                "example": "San Francisco"
              },
              {
                "type": "null"
              }
            ]
          },
          "region": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120,
                "example": "CA"
              },
              {
                "type": "null"
              }
            ]
          },
          "postalCode": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40,
                "example": "94114"
              },
              {
                "type": "null"
              }
            ]
          },
          "country": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO3166",
                "example": "US"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "EcommerceAttachmentSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "att_wk2026_manual"
          },
          "filename": {
            "type": "string",
            "example": "wireless-keyboard-manual.pdf"
          },
          "url": {
            "type": "string",
            "minLength": 1,
            "description": "Hosted file URL or absolute path.",
            "example": "https://cdn.acme.example/manuals/wireless-keyboard-manual.pdf"
          },
          "mimeType": {
            "type": "string",
            "description": "MIME type, e.g. `image/png`.",
            "example": "application/pdf"
          }
        },
        "required": [
          "id",
          "filename",
          "url",
          "mimeType"
        ],
        "additionalProperties": false
      },
      "EcommerceCollectionSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "col_accessories"
          },
          "title": {
            "type": "string",
            "example": "Accessories"
          },
          "handle": {
            "example": "accessories",
            "type": "string",
            "pattern": "^[a-z0-9-]+$",
            "description": "URL-safe slug — lowercase letters, digits, hyphens."
          },
          "description": {
            "example": "Keyboards, mice, and other desk accessories.",
            "type": "string"
          },
          "type": {
            "example": "MANUAL",
            "type": "string",
            "enum": [
              "MANUAL",
              "SMART",
              "unknown"
            ]
          },
          "productIds": {
            "example": [
              "prod_wk2026"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "image": {
            "type": "object",
            "properties": {
              "id": {
                "example": "img_wk2026_hero",
                "type": "string"
              },
              "url": {
                "type": "string",
                "minLength": 1,
                "description": "Hosted image URL or absolute path.",
                "example": "https://cdn.acme.example/products/wireless-keyboard.jpg"
              },
              "alt": {
                "example": "Wireless Keyboard",
                "type": "string"
              },
              "width": {
                "example": 1200,
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "height": {
                "example": 800,
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "position": {
                "description": "Display order, 0-indexed.",
                "example": 0,
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "url"
            ],
            "additionalProperties": false
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "publishedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "example": {
              "collectionPlatformId": "gid://shopify/Collection/col_accessories"
            }
          }
        },
        "required": [
          "id",
          "title",
          "metadata"
        ],
        "additionalProperties": false
      },
      "EcommerceCollectionTypeSchema": {
        "type": "string",
        "enum": [
          "MANUAL",
          "SMART",
          "unknown"
        ]
      },
      "EcommerceCustomerSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "cus_4Qm2Xa9Lr"
          },
          "email": {
            "example": "jane.doe@acme.example",
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "firstName": {
            "example": "Jane",
            "type": "string"
          },
          "lastName": {
            "example": "Doe",
            "type": "string"
          },
          "phone": {
            "example": "+14155550123",
            "type": "string"
          },
          "acceptsMarketing": {
            "example": true,
            "type": "boolean"
          },
          "ordersCount": {
            "example": 1,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "totalSpent": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 7999
              },
              "currency": {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ],
            "additionalProperties": false
          },
          "tags": {
            "example": [
              "accessories"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "defaultAddress": {
            "type": "object",
            "properties": {
              "line1": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255,
                    "example": "2500 Market Street"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "line2": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255,
                    "example": "Suite 300"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "city": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120,
                    "example": "San Francisco"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "region": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120,
                    "example": "CA"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postalCode": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 40,
                    "example": "94114"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "country": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ISO3166",
                    "example": "US"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          "addresses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "line1": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 255,
                      "example": "2500 Market Street"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "line2": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 255,
                      "example": "Suite 300"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "city": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 120,
                      "example": "San Francisco"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "region": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 120,
                      "example": "CA"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "postalCode": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 40,
                      "example": "94114"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "country": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ISO3166",
                      "example": "US"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "additionalProperties": false
            }
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "example": {
              "customerPlatformId": "gid://shopify/Customer/cus_4Qm2Xa9Lr"
            }
          }
        },
        "required": [
          "id",
          "metadata"
        ],
        "additionalProperties": false
      },
      "EcommerceDiscountAppliesToSchema": {
        "type": "string",
        "enum": [
          "ORDER",
          "PRODUCTS",
          "SHIPPING",
          "unknown"
        ]
      },
      "EcommerceDiscountCustomerEligibilitySchema": {
        "type": "string",
        "enum": [
          "ALL",
          "SPECIFIC",
          "unknown"
        ]
      },
      "EcommerceDiscountSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "disc_acme10"
          },
          "code": {
            "example": "ACME10",
            "type": "string"
          },
          "title": {
            "example": "Acme 10% Off",
            "type": "string"
          },
          "type": {
            "example": "PERCENTAGE",
            "type": "string",
            "enum": [
              "PERCENTAGE",
              "FIXED_AMOUNT",
              "FREE_SHIPPING",
              "BUY_X_GET_Y",
              "unknown"
            ]
          },
          "value": {
            "example": 10,
            "type": "number",
            "minimum": 0
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "appliesTo": {
            "example": "ORDER",
            "type": "string",
            "enum": [
              "ORDER",
              "PRODUCTS",
              "SHIPPING",
              "unknown"
            ]
          },
          "productIds": {
            "example": [
              "prod_wk2026"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "collectionIds": {
            "example": [],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "minimumPurchaseAmount": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 7999
              },
              "currency": {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ],
            "additionalProperties": false
          },
          "usageLimit": {
            "example": 100,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "usageCount": {
            "example": 1,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "customerEligibility": {
            "example": "ALL",
            "type": "string",
            "enum": [
              "ALL",
              "SPECIFIC",
              "unknown"
            ]
          },
          "startsAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "endsAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": null
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "example": {
              "discountPlatformId": "gid://shopify/DiscountCode/disc_acme10"
            }
          }
        },
        "required": [
          "id",
          "metadata"
        ],
        "additionalProperties": false
      },
      "EcommerceDiscountTypeSchema": {
        "type": "string",
        "enum": [
          "PERCENTAGE",
          "FIXED_AMOUNT",
          "FREE_SHIPPING",
          "BUY_X_GET_Y",
          "unknown"
        ]
      },
      "EcommerceFulfillmentLineItemSchema": {
        "type": "object",
        "properties": {
          "lineItemId": {
            "type": "string",
            "example": "li_1"
          },
          "quantity": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "example": 1
          }
        },
        "required": [
          "lineItemId",
          "quantity"
        ],
        "additionalProperties": false
      },
      "EcommerceFulfillmentSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "ful_1042"
          },
          "orderId": {
            "type": "string",
            "example": "ord_1042"
          },
          "status": {
            "example": "SUCCESS",
            "type": "string",
            "enum": [
              "PENDING",
              "OPEN",
              "SUCCESS",
              "CANCELLED",
              "ERROR",
              "FAILURE",
              "unknown"
            ]
          },
          "trackingNumber": {
            "example": "1Z999AA10123456784",
            "type": "string"
          },
          "trackingUrl": {
            "example": "https://www.ups.com/track?tracknum=1Z999AA10123456784",
            "type": "string",
            "format": "uri"
          },
          "carrier": {
            "example": "UPS",
            "type": "string"
          },
          "service": {
            "example": "Ground",
            "type": "string"
          },
          "locationId": {
            "example": "loc_sf_market",
            "type": "string"
          },
          "shipmentId": {
            "example": null,
            "type": "string"
          },
          "lineItems": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "lineItemId": {
                  "type": "string",
                  "example": "li_1"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "example": 1
                }
              },
              "required": [
                "lineItemId",
                "quantity"
              ],
              "additionalProperties": false
            }
          },
          "notifyCustomer": {
            "example": true,
            "type": "boolean"
          },
          "shippedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "estimatedDeliveryAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-18T09:30:00Z"
          },
          "deliveredAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-17T16:45:00Z"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "example": {
              "fulfillmentPlatformId": "gid://shopify/Fulfillment/ful_1042"
            }
          }
        },
        "required": [
          "id",
          "orderId",
          "metadata"
        ],
        "additionalProperties": false
      },
      "EcommerceFulfillmentStatusSchema": {
        "type": "string",
        "enum": [
          "PENDING",
          "OPEN",
          "SUCCESS",
          "CANCELLED",
          "ERROR",
          "FAILURE",
          "unknown"
        ]
      },
      "EcommerceImageSchema": {
        "type": "object",
        "properties": {
          "id": {
            "example": "img_wk2026_hero",
            "type": "string"
          },
          "url": {
            "type": "string",
            "minLength": 1,
            "description": "Hosted image URL or absolute path.",
            "example": "https://cdn.acme.example/products/wireless-keyboard.jpg"
          },
          "alt": {
            "example": "Wireless Keyboard",
            "type": "string"
          },
          "width": {
            "example": 1200,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "height": {
            "example": 800,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "position": {
            "description": "Display order, 0-indexed.",
            "example": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "url"
        ],
        "additionalProperties": false
      },
      "EcommerceInventoryLevelSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "var_wk2026_blk:loc_sf_market"
          },
          "variantId": {
            "type": "string",
            "example": "var_wk2026_blk"
          },
          "locationId": {
            "type": "string",
            "example": "loc_sf_market"
          },
          "available": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "example": 42
          },
          "committed": {
            "example": 1,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "incoming": {
            "example": 10,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "onHand": {
            "example": 43,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "example": {
              "inventoryLevelPlatformId": "gid://shopify/InventoryLevel/var_wk2026_blk:loc_sf_market"
            }
          }
        },
        "required": [
          "id",
          "variantId",
          "locationId",
          "available",
          "metadata"
        ],
        "additionalProperties": false
      },
      "EcommerceLineItemSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "li_1"
          },
          "productId": {
            "example": "prod_wk2026",
            "type": "string"
          },
          "variantId": {
            "example": "var_wk2026_blk",
            "type": "string"
          },
          "title": {
            "type": "string",
            "example": "Wireless Keyboard"
          },
          "quantity": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "example": 1
          },
          "price": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 7999
              },
              "currency": {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ],
            "additionalProperties": false
          },
          "totalDiscount": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 7999
              },
              "currency": {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ],
            "additionalProperties": false
          },
          "taxLines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string",
                  "example": "CA State Tax"
                },
                "rate": {
                  "type": "number",
                  "minimum": 0,
                  "description": "Decimal tax rate (e.g. 0.07 for 7%) — adapter convention may differ.",
                  "example": 0.0875
                },
                "amount": {
                  "type": "object",
                  "properties": {
                    "amount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991,
                      "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                      "example": 7999
                    },
                    "currency": {
                      "$ref": "#/components/schemas/ISO4217",
                      "example": "USD"
                    }
                  },
                  "required": [
                    "amount",
                    "currency"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "title",
                "rate",
                "amount"
              ],
              "additionalProperties": false
            }
          },
          "sku": {
            "example": "WK-2026",
            "type": "string"
          },
          "fulfillableQuantity": {
            "example": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "fulfillmentStatus": {
            "example": "FULFILLED",
            "type": "string",
            "enum": [
              "UNFULFILLED",
              "PARTIAL",
              "FULFILLED",
              "RESTOCKED",
              "unknown"
            ]
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "example": {
              "lineItemPlatformId": "gid://shopify/LineItem/li_1"
            }
          }
        },
        "required": [
          "id",
          "title",
          "quantity",
          "price",
          "metadata"
        ],
        "additionalProperties": false
      },
      "EcommerceLocationSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "loc_sf_market"
          },
          "name": {
            "type": "string",
            "example": "San Francisco Warehouse"
          },
          "active": {
            "example": true,
            "type": "boolean"
          },
          "address": {
            "type": "object",
            "properties": {
              "line1": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255,
                    "example": "2500 Market Street"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "line2": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255,
                    "example": "Suite 300"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "city": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120,
                    "example": "San Francisco"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "region": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120,
                    "example": "CA"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postalCode": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 40,
                    "example": "94114"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "country": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ISO3166",
                    "example": "US"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          "phone": {
            "example": "+14155550123",
            "type": "string"
          },
          "isFulfillmentCenter": {
            "example": true,
            "type": "boolean"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "example": {
              "locationPlatformId": "gid://shopify/Location/loc_sf_market"
            }
          }
        },
        "required": [
          "id",
          "name",
          "metadata"
        ],
        "additionalProperties": false
      },
      "EcommerceMoneySchema": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
            "example": 7999
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          }
        },
        "required": [
          "amount",
          "currency"
        ],
        "additionalProperties": false
      },
      "EcommerceOrderFinancialStatusSchema": {
        "type": "string",
        "enum": [
          "PENDING",
          "AUTHORIZED",
          "PARTIALLY_PAID",
          "PAID",
          "PARTIALLY_REFUNDED",
          "REFUNDED",
          "VOIDED",
          "unknown"
        ]
      },
      "EcommerceOrderFulfillmentStatusSchema": {
        "type": "string",
        "enum": [
          "UNFULFILLED",
          "PARTIAL",
          "FULFILLED",
          "RESTOCKED",
          "unknown"
        ]
      },
      "EcommerceOrderSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "ord_1042"
          },
          "orderNumber": {
            "example": "#1042",
            "type": "string"
          },
          "name": {
            "example": "#1042",
            "type": "string"
          },
          "customerId": {
            "example": "cus_4Qm2Xa9Lr",
            "type": "string"
          },
          "email": {
            "example": "jane.doe@acme.example",
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "phone": {
            "example": "+14155550123",
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "subtotalPrice": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 7999
              },
              "currency": {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ],
            "additionalProperties": false
          },
          "totalTax": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 7999
              },
              "currency": {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ],
            "additionalProperties": false
          },
          "totalDiscounts": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 7999
              },
              "currency": {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ],
            "additionalProperties": false
          },
          "totalShipping": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 7999
              },
              "currency": {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ],
            "additionalProperties": false
          },
          "totalPrice": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 7999
              },
              "currency": {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ],
            "additionalProperties": false
          },
          "financialStatus": {
            "example": "PAID",
            "type": "string",
            "enum": [
              "PENDING",
              "AUTHORIZED",
              "PARTIALLY_PAID",
              "PAID",
              "PARTIALLY_REFUNDED",
              "REFUNDED",
              "VOIDED",
              "unknown"
            ]
          },
          "fulfillmentStatus": {
            "example": "FULFILLED",
            "type": "string",
            "enum": [
              "UNFULFILLED",
              "PARTIAL",
              "FULFILLED",
              "RESTOCKED",
              "unknown"
            ]
          },
          "lineItems": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "example": "li_1"
                },
                "productId": {
                  "example": "prod_wk2026",
                  "type": "string"
                },
                "variantId": {
                  "example": "var_wk2026_blk",
                  "type": "string"
                },
                "title": {
                  "type": "string",
                  "example": "Wireless Keyboard"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "example": 1
                },
                "price": {
                  "type": "object",
                  "properties": {
                    "amount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991,
                      "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                      "example": 7999
                    },
                    "currency": {
                      "$ref": "#/components/schemas/ISO4217",
                      "example": "USD"
                    }
                  },
                  "required": [
                    "amount",
                    "currency"
                  ],
                  "additionalProperties": false
                },
                "totalDiscount": {
                  "type": "object",
                  "properties": {
                    "amount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991,
                      "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                      "example": 7999
                    },
                    "currency": {
                      "$ref": "#/components/schemas/ISO4217",
                      "example": "USD"
                    }
                  },
                  "required": [
                    "amount",
                    "currency"
                  ],
                  "additionalProperties": false
                },
                "taxLines": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "example": "CA State Tax"
                      },
                      "rate": {
                        "type": "number",
                        "minimum": 0,
                        "description": "Decimal tax rate (e.g. 0.07 for 7%) — adapter convention may differ.",
                        "example": 0.0875
                      },
                      "amount": {
                        "type": "object",
                        "properties": {
                          "amount": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991,
                            "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                            "example": 7999
                          },
                          "currency": {
                            "$ref": "#/components/schemas/ISO4217",
                            "example": "USD"
                          }
                        },
                        "required": [
                          "amount",
                          "currency"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "title",
                      "rate",
                      "amount"
                    ],
                    "additionalProperties": false
                  }
                },
                "sku": {
                  "example": "WK-2026",
                  "type": "string"
                },
                "fulfillableQuantity": {
                  "example": 0,
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "fulfillmentStatus": {
                  "example": "FULFILLED",
                  "type": "string",
                  "enum": [
                    "UNFULFILLED",
                    "PARTIAL",
                    "FULFILLED",
                    "RESTOCKED",
                    "unknown"
                  ]
                },
                "metadata": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {},
                  "example": {
                    "lineItemPlatformId": "gid://shopify/LineItem/li_1"
                  }
                }
              },
              "required": [
                "id",
                "title",
                "quantity",
                "price",
                "metadata"
              ],
              "additionalProperties": false
            }
          },
          "billingAddress": {
            "type": "object",
            "properties": {
              "line1": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255,
                    "example": "2500 Market Street"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "line2": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255,
                    "example": "Suite 300"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "city": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120,
                    "example": "San Francisco"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "region": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120,
                    "example": "CA"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postalCode": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 40,
                    "example": "94114"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "country": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ISO3166",
                    "example": "US"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          "shippingAddress": {
            "type": "object",
            "properties": {
              "line1": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255,
                    "example": "2500 Market Street"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "line2": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255,
                    "example": "Suite 300"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "city": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120,
                    "example": "San Francisco"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "region": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120,
                    "example": "CA"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postalCode": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 40,
                    "example": "94114"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "country": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ISO3166",
                    "example": "US"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          "fulfillmentIds": {
            "example": [
              "ful_1042"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "refundIds": {
            "example": [],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "transactionIds": {
            "example": [
              "txn_1042"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "discountCodes": {
            "example": [
              "ACME10"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "example": [
              "accessories"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "note": {
            "example": "Leave at front desk.",
            "type": "string"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "processedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "cancelledAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": null
          },
          "cancelReason": {
            "example": null,
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "example": {
              "orderPlatformId": "gid://shopify/Order/ord_1042"
            }
          }
        },
        "required": [
          "id",
          "metadata"
        ],
        "additionalProperties": false
      },
      "EcommerceProductOptionSchema": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Platform-specific option identifier.",
            "example": "opt_wk2026_color",
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "Option label shown to shoppers (e.g. `Size`, `Color`).",
            "example": "Color"
          },
          "values": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Allowed values for this option (e.g. `[\"S\", \"M\", \"L\"]`).",
            "example": [
              "Black"
            ]
          },
          "position": {
            "description": "Display order, 0-indexed.",
            "example": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "name",
          "values"
        ],
        "additionalProperties": false,
        "description": "A product option (e.g. \"Size\" or \"Color\"). Combines with sibling options to form variant `optionValues` maps."
      },
      "EcommerceProductSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Platform-specific product identifier.",
            "example": "prod_wk2026"
          },
          "title": {
            "type": "string",
            "description": "Product name shown to shoppers.",
            "example": "Wireless Keyboard"
          },
          "description": {
            "description": "HTML-capable description body.",
            "example": "<p>A compact wireless keyboard.</p>",
            "type": "string"
          },
          "handle": {
            "description": "URL slug (e.g. `red-t-shirt`).",
            "example": "wireless-keyboard",
            "type": "string",
            "pattern": "^[a-z0-9-]+$"
          },
          "status": {
            "example": "ACTIVE",
            "type": "string",
            "enum": [
              "ACTIVE",
              "ARCHIVED",
              "DRAFT"
            ],
            "description": "Storefront visibility state."
          },
          "vendor": {
            "description": "Brand or supplier.",
            "example": "Acme Industries",
            "type": "string"
          },
          "productType": {
            "description": "Merchandise category / type.",
            "example": "Accessories",
            "type": "string"
          },
          "tags": {
            "description": "Free-form labels.",
            "example": [
              "accessories"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "options": {
            "description": "Configurable options (e.g. size, color).",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "description": "Platform-specific option identifier.",
                  "example": "opt_wk2026_color",
                  "type": "string"
                },
                "name": {
                  "type": "string",
                  "description": "Option label shown to shoppers (e.g. `Size`, `Color`).",
                  "example": "Color"
                },
                "values": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Allowed values for this option (e.g. `[\"S\", \"M\", \"L\"]`).",
                  "example": [
                    "Black"
                  ]
                },
                "position": {
                  "description": "Display order, 0-indexed.",
                  "example": 0,
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "name",
                "values"
              ],
              "additionalProperties": false,
              "description": "A product option (e.g. \"Size\" or \"Color\"). Combines with sibling options to form variant `optionValues` maps."
            }
          },
          "variants": {
            "description": "Purchasable SKUs generated from the option matrix.",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Platform-specific variant identifier.",
                  "example": "var_wk2026_blk"
                },
                "productId": {
                  "description": "Parent Product.id.",
                  "example": "prod_wk2026",
                  "type": "string"
                },
                "sku": {
                  "description": "Stock-keeping unit.",
                  "example": "WK-2026",
                  "type": "string"
                },
                "barcode": {
                  "description": "Barcode (UPC, EAN, ISBN).",
                  "example": "0123456789012",
                  "type": "string"
                },
                "title": {
                  "description": "Variant title, typically a concatenation of option values.",
                  "example": "Black",
                  "type": "string"
                },
                "price": {
                  "type": "object",
                  "properties": {
                    "amount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991,
                      "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                      "example": 7999
                    },
                    "currency": {
                      "$ref": "#/components/schemas/ISO4217",
                      "example": "USD"
                    }
                  },
                  "required": [
                    "amount",
                    "currency"
                  ],
                  "additionalProperties": false,
                  "description": "Selling price."
                },
                "compareAtPrice": {
                  "description": "Original / compare-at price for strikethrough display.",
                  "type": "object",
                  "properties": {
                    "amount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991,
                      "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                      "example": 7999
                    },
                    "currency": {
                      "$ref": "#/components/schemas/ISO4217",
                      "example": "USD"
                    }
                  },
                  "required": [
                    "amount",
                    "currency"
                  ],
                  "additionalProperties": false
                },
                "weight": {
                  "description": "Weight in `weightUnit` (defaults to grams per Shopify convention).",
                  "example": 850,
                  "type": "number",
                  "minimum": 0
                },
                "weightUnit": {
                  "example": "g",
                  "type": "string",
                  "enum": [
                    "g",
                    "kg",
                    "oz",
                    "lb"
                  ],
                  "description": "Unit of measure for product / variant weight."
                },
                "inventoryItemId": {
                  "description": "Shopify-style link from a variant to its inventory item.",
                  "example": "invitem_wk2026_blk",
                  "type": "string"
                },
                "optionValues": {
                  "description": "Map of option name → selected value, e.g. `{ color: \"red\", size: \"M\" }`.",
                  "example": {
                    "Color": "Black"
                  },
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "type": "string"
                  }
                },
                "taxable": {
                  "description": "Whether taxes apply at checkout.",
                  "example": true,
                  "type": "boolean"
                },
                "requiresShipping": {
                  "description": "`false` for digital goods.",
                  "example": true,
                  "type": "boolean"
                },
                "position": {
                  "description": "Display order within the product, 0-indexed.",
                  "example": 0,
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "metadata": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {},
                  "description": "Complete unmodified raw platform response.",
                  "example": {
                    "variantPlatformId": "gid://shopify/ProductVariant/var_wk2026_blk"
                  }
                }
              },
              "required": [
                "id",
                "price",
                "metadata"
              ],
              "additionalProperties": false,
              "description": "A purchasable SKU belonging to a product. First-class so it can be listed, fetched, and mutated directly."
            }
          },
          "images": {
            "description": "Product imagery.",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "example": "img_wk2026_hero",
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "minLength": 1,
                  "description": "Hosted image URL or absolute path.",
                  "example": "https://cdn.acme.example/products/wireless-keyboard.jpg"
                },
                "alt": {
                  "example": "Wireless Keyboard",
                  "type": "string"
                },
                "width": {
                  "example": 1200,
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "height": {
                  "example": 800,
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "position": {
                  "description": "Display order, 0-indexed.",
                  "example": 0,
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "url"
              ],
              "additionalProperties": false
            }
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "publishedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "description": "Complete unmodified raw platform response.",
            "example": {
              "productPlatformId": "gid://shopify/Product/prod_wk2026"
            }
          }
        },
        "required": [
          "id",
          "title",
          "metadata"
        ],
        "additionalProperties": false,
        "description": "A catalog product with one or more purchasable variants."
      },
      "EcommerceProductStatusSchema": {
        "type": "string",
        "enum": [
          "ACTIVE",
          "ARCHIVED",
          "DRAFT"
        ],
        "description": "Storefront visibility state."
      },
      "EcommerceProductVariantSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Platform-specific variant identifier.",
            "example": "var_wk2026_blk"
          },
          "productId": {
            "description": "Parent Product.id.",
            "example": "prod_wk2026",
            "type": "string"
          },
          "sku": {
            "description": "Stock-keeping unit.",
            "example": "WK-2026",
            "type": "string"
          },
          "barcode": {
            "description": "Barcode (UPC, EAN, ISBN).",
            "example": "0123456789012",
            "type": "string"
          },
          "title": {
            "description": "Variant title, typically a concatenation of option values.",
            "example": "Black",
            "type": "string"
          },
          "price": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 7999
              },
              "currency": {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ],
            "additionalProperties": false,
            "description": "Selling price."
          },
          "compareAtPrice": {
            "description": "Original / compare-at price for strikethrough display.",
            "type": "object",
            "properties": {
              "amount": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 7999
              },
              "currency": {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ],
            "additionalProperties": false
          },
          "weight": {
            "description": "Weight in `weightUnit` (defaults to grams per Shopify convention).",
            "example": 850,
            "type": "number",
            "minimum": 0
          },
          "weightUnit": {
            "example": "g",
            "type": "string",
            "enum": [
              "g",
              "kg",
              "oz",
              "lb"
            ],
            "description": "Unit of measure for product / variant weight."
          },
          "inventoryItemId": {
            "description": "Shopify-style link from a variant to its inventory item.",
            "example": "invitem_wk2026_blk",
            "type": "string"
          },
          "optionValues": {
            "description": "Map of option name → selected value, e.g. `{ color: \"red\", size: \"M\" }`.",
            "example": {
              "Color": "Black"
            },
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "taxable": {
            "description": "Whether taxes apply at checkout.",
            "example": true,
            "type": "boolean"
          },
          "requiresShipping": {
            "description": "`false` for digital goods.",
            "example": true,
            "type": "boolean"
          },
          "position": {
            "description": "Display order within the product, 0-indexed.",
            "example": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "description": "Complete unmodified raw platform response.",
            "example": {
              "variantPlatformId": "gid://shopify/ProductVariant/var_wk2026_blk"
            }
          }
        },
        "required": [
          "id",
          "price",
          "metadata"
        ],
        "additionalProperties": false,
        "description": "A purchasable SKU belonging to a product. First-class so it can be listed, fetched, and mutated directly."
      },
      "EcommerceRefundLineItemSchema": {
        "type": "object",
        "properties": {
          "lineItemId": {
            "type": "string",
            "example": "li_1"
          },
          "quantity": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "example": 1
          },
          "amount": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 7999
              },
              "currency": {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "lineItemId",
          "quantity"
        ],
        "additionalProperties": false
      },
      "EcommerceRefundSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "ref_1042"
          },
          "orderId": {
            "type": "string",
            "example": "ord_1042"
          },
          "amount": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 7999
              },
              "currency": {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ],
            "additionalProperties": false
          },
          "reason": {
            "example": "Customer changed mind",
            "type": "string"
          },
          "note": {
            "example": "Refunded one keyboard.",
            "type": "string"
          },
          "restock": {
            "example": true,
            "type": "boolean"
          },
          "refundLineItems": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "lineItemId": {
                  "type": "string",
                  "example": "li_1"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "example": 1
                },
                "amount": {
                  "type": "object",
                  "properties": {
                    "amount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991,
                      "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                      "example": 7999
                    },
                    "currency": {
                      "$ref": "#/components/schemas/ISO4217",
                      "example": "USD"
                    }
                  },
                  "required": [
                    "amount",
                    "currency"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "lineItemId",
                "quantity"
              ],
              "additionalProperties": false
            }
          },
          "transactionIds": {
            "example": [
              "txn_1042"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "processedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "example": {
              "refundPlatformId": "gid://shopify/Refund/ref_1042"
            }
          }
        },
        "required": [
          "id",
          "orderId",
          "metadata"
        ],
        "additionalProperties": false
      },
      "EcommerceTaxLineSchema": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "example": "CA State Tax"
          },
          "rate": {
            "type": "number",
            "minimum": 0,
            "description": "Decimal tax rate (e.g. 0.07 for 7%) — adapter convention may differ.",
            "example": 0.0875
          },
          "amount": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 7999
              },
              "currency": {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "title",
          "rate",
          "amount"
        ],
        "additionalProperties": false
      },
      "EcommerceTransactionKindSchema": {
        "type": "string",
        "enum": [
          "AUTHORIZATION",
          "CAPTURE",
          "SALE",
          "REFUND",
          "VOID",
          "unknown"
        ]
      },
      "EcommerceTransactionSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "txn_1042"
          },
          "orderId": {
            "example": "ord_1042",
            "type": "string"
          },
          "kind": {
            "example": "SALE",
            "type": "string",
            "enum": [
              "AUTHORIZATION",
              "CAPTURE",
              "SALE",
              "REFUND",
              "VOID",
              "unknown"
            ]
          },
          "status": {
            "example": "SUCCESS",
            "type": "string",
            "enum": [
              "PENDING",
              "SUCCESS",
              "FAILURE",
              "ERROR",
              "unknown"
            ]
          },
          "amount": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 7999
              },
              "currency": {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ],
            "additionalProperties": false
          },
          "gateway": {
            "example": "shopify_payments",
            "type": "string"
          },
          "authorizationCode": {
            "example": "AUTH123456",
            "type": "string"
          },
          "parentTransactionId": {
            "example": null,
            "type": "string"
          },
          "errorCode": {
            "example": null,
            "type": "string"
          },
          "errorMessage": {
            "example": null,
            "type": "string"
          },
          "processedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "example": {
              "transactionPlatformId": "gid://shopify/OrderTransaction/txn_1042"
            }
          }
        },
        "required": [
          "id",
          "metadata"
        ],
        "additionalProperties": false
      },
      "EcommerceTransactionStatusSchema": {
        "type": "string",
        "enum": [
          "PENDING",
          "SUCCESS",
          "FAILURE",
          "ERROR",
          "unknown"
        ]
      },
      "EcommerceWebhookActionSchema": {
        "type": "string",
        "enum": [
          "created",
          "updated",
          "deleted",
          "unknown"
        ]
      },
      "EcommerceWebhookEventSchema": {
        "type": "object",
        "properties": {
          "id": {
            "example": "evt_ord1042_created",
            "type": "string"
          },
          "platform": {
            "type": "string",
            "example": "shopify"
          },
          "type": {
            "type": "string",
            "example": "orders.created"
          },
          "resourceType": {
            "type": "string",
            "enum": [
              "products",
              "variants",
              "collections",
              "locations",
              "orders",
              "customers",
              "fulfillments",
              "refunds",
              "transactions",
              "inventory_levels",
              "discounts",
              "unknown"
            ],
            "example": "orders"
          },
          "action": {
            "type": "string",
            "enum": [
              "created",
              "updated",
              "deleted",
              "unknown"
            ],
            "example": "created"
          },
          "resourceId": {
            "type": "string",
            "example": "ord_1042"
          },
          "tenantId": {
            "example": "acme-industries",
            "type": "string"
          },
          "connectionId": {
            "example": "3f1c2d4e-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
            "type": "string"
          },
          "payload": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {},
            "example": {
              "id": "ord_1042",
              "name": "#1042",
              "financial_status": "paid"
            }
          }
        },
        "required": [
          "platform",
          "type",
          "resourceType",
          "action",
          "resourceId",
          "payload"
        ],
        "additionalProperties": false
      },
      "EcommerceWebhookResourceTypeSchema": {
        "type": "string",
        "enum": [
          "products",
          "variants",
          "collections",
          "locations",
          "orders",
          "customers",
          "fulfillments",
          "refunds",
          "transactions",
          "inventory_levels",
          "discounts",
          "unknown"
        ]
      },
      "EcommerceWeightUnitSchema": {
        "type": "string",
        "enum": [
          "g",
          "kg",
          "oz",
          "lb"
        ],
        "description": "Unit of measure for product / variant weight."
      },
      "EcommerceInventoryAdjustRequest": {
        "type": "object",
        "required": [
          "variantId",
          "locationId",
          "delta"
        ],
        "properties": {
          "variantId": {
            "type": "string",
            "description": "ID of the variant to adjust.",
            "example": "var_wk2026_blk"
          },
          "locationId": {
            "type": "string",
            "description": "ID of the location holding the stock.",
            "example": "loc_sfo1"
          },
          "delta": {
            "type": "integer",
            "description": "Signed delta to apply to the current available quantity. Positive to add stock, negative to subtract.",
            "example": -10
          }
        }
      },
      "EcommerceInventorySetRequest": {
        "type": "object",
        "required": [
          "variantId",
          "locationId",
          "available"
        ],
        "properties": {
          "variantId": {
            "type": "string",
            "description": "ID of the variant to update.",
            "example": "var_wk2026_blk"
          },
          "locationId": {
            "type": "string",
            "description": "ID of the location holding the stock.",
            "example": "loc_sfo1"
          },
          "available": {
            "type": "integer",
            "minimum": 0,
            "description": "Absolute available quantity to set.",
            "example": 240
          }
        }
      },
      "EcommerceOrderCancelRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "description": "Optional free-text or adapter-specific cancellation reason.",
            "example": "customer_request"
          }
        }
      },
      "EcommerceSyncJob": {
        "type": "object",
        "description": "Background sync job. Created by `POST /v1/{vertical}/sync`.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "sync_1042"
          },
          "vertical": {
            "type": "string",
            "example": "accounting"
          },
          "connectionId": {
            "type": "string",
            "format": "uuid",
            "example": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90"
          },
          "platform": {
            "type": "string",
            "example": "xero"
          },
          "tenantId": {
            "type": "string",
            "nullable": true,
            "example": "acme"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed"
            ],
            "example": "completed"
          },
          "progress": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "object",
              "properties": {
                "synced": {
                  "type": "integer",
                  "example": 128
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "running",
                    "completed",
                    "skipped",
                    "failed"
                  ],
                  "example": "completed"
                },
                "error": {
                  "type": "string",
                  "example": "rate limited by upstream"
                }
              }
            }
          },
          "error": {
            "type": "string",
            "nullable": true,
            "example": null
          },
          "callbackUrl": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "example": "https://hooks.acme.example/sync"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "startedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ],
            "example": "2026-01-15T09:30:00Z"
          },
          "completedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ],
            "example": "2026-02-01T14:20:00Z"
          },
          "origin": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "manual",
              "api",
              "connect",
              "boot",
              "schedule",
              null
            ],
            "description": "Why the job was queued: `api` (POST /v1/{vertical}/sync), `manual` (the admin console), `connect` (right after a Connect Link), `boot` (DATA_STORE_AUTO_SYNC_ON_BOOT) or `schedule` (the connection's sync schedule). Null on jobs queued before this field existed.",
            "example": "schedule"
          }
        },
        "required": [
          "id",
          "vertical",
          "connectionId",
          "platform",
          "status",
          "createdAt"
        ]
      },
      "LogisticsSyncJob": {
        "type": "object",
        "description": "Background sync job. Created by `POST /v1/{vertical}/sync`.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "sync_1042"
          },
          "vertical": {
            "type": "string",
            "example": "accounting"
          },
          "connectionId": {
            "type": "string",
            "format": "uuid",
            "example": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90"
          },
          "platform": {
            "type": "string",
            "example": "xero"
          },
          "tenantId": {
            "type": "string",
            "nullable": true,
            "example": "acme"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed"
            ],
            "example": "completed"
          },
          "progress": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "object",
              "properties": {
                "synced": {
                  "type": "integer",
                  "example": 128
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "running",
                    "completed",
                    "skipped",
                    "failed"
                  ],
                  "example": "completed"
                },
                "error": {
                  "type": "string",
                  "example": "rate limited by upstream"
                }
              }
            }
          },
          "error": {
            "type": "string",
            "nullable": true,
            "example": null
          },
          "callbackUrl": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "example": "https://hooks.acme.example/sync"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "startedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ],
            "example": "2026-01-15T09:30:00Z"
          },
          "completedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ],
            "example": "2026-02-01T14:20:00Z"
          },
          "origin": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "manual",
              "api",
              "connect",
              "boot",
              "schedule",
              null
            ],
            "description": "Why the job was queued: `api` (POST /v1/{vertical}/sync), `manual` (the admin console), `connect` (right after a Connect Link), `boot` (DATA_STORE_AUTO_SYNC_ON_BOOT) or `schedule` (the connection's sync schedule). Null on jobs queued before this field existed.",
            "example": "schedule"
          }
        },
        "required": [
          "id",
          "vertical",
          "connectionId",
          "platform",
          "status",
          "createdAt"
        ]
      },
      "LogisticsProvider": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "description": "Unique adapter identifier",
            "example": "shippo"
          },
          "name": {
            "type": "string",
            "example": "Shippo"
          },
          "category": {
            "type": "string",
            "enum": [
              "global_carrier",
              "integration_platform",
              "north_america",
              "europe",
              "apac",
              "latam",
              "africa_mena",
              "tms_visibility",
              "ocean_carrier",
              "container_visibility",
              "last_mile_crowdsourced",
              "last_mile_orchestration",
              "wms_3pl"
            ],
            "example": "integration_platform"
          },
          "authType": {
            "type": "string",
            "enum": [
              "oauth2",
              "api_key",
              "basic",
              "session"
            ],
            "example": "api_key"
          },
          "website": {
            "type": "string",
            "format": "uri",
            "example": "https://goshippo.com"
          },
          "logo": {
            "description": "Base64-encoded SVG logo, or null if not yet added",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "LogisticsShipment": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Platform-specific shipment identifier.",
            "example": "shp_1042",
            "type": "string"
          },
          "status": {
            "example": "IN_TRANSIT",
            "type": "string",
            "enum": [
              "PENDING",
              "LABEL_CREATED",
              "IN_TRANSIT",
              "OUT_FOR_DELIVERY",
              "DELIVERED",
              "EXCEPTION",
              "RETURNED",
              "CANCELLED",
              "UNKNOWN"
            ],
            "description": "Canonical shipment lifecycle state. Carriers map their own statuses onto these values."
          },
          "trackingNumber": {
            "description": "Carrier-issued tracking number for the shipment.",
            "example": "1Z999AA10123456784",
            "type": "string"
          },
          "carrierId": {
            "description": "Carrier.id the shipment is booked with.",
            "example": "ups",
            "type": "string"
          },
          "serviceCode": {
            "description": "Carrier service level code (e.g. `USPS_PRIORITY`, `UPS_GROUND`).",
            "example": "ups_ground",
            "type": "string"
          },
          "warehouseId": {
            "description": "Warehouse.id the shipment is dispatched from.",
            "example": "wh_sfo1",
            "type": "string"
          },
          "originAddress": {
            "description": "Ship-from address.",
            "type": "object",
            "properties": {
              "name": {
                "description": "Recipient or sender contact name.",
                "example": "Jane Doe",
                "type": "string"
              },
              "company": {
                "description": "Company name.",
                "example": "Acme Industries",
                "type": "string"
              },
              "street1": {
                "description": "Street address, line 1.",
                "example": "2500 Market Street",
                "type": "string"
              },
              "street2": {
                "description": "Street address, line 2 (unit, suite).",
                "example": "Suite 300",
                "type": "string"
              },
              "city": {
                "description": "City or locality.",
                "example": "San Francisco",
                "type": "string"
              },
              "state": {
                "description": "State, province, or region.",
                "example": "CA",
                "type": "string"
              },
              "postalCode": {
                "description": "ZIP or postal code.",
                "example": "94114",
                "type": "string"
              },
              "country": {
                "$ref": "#/components/schemas/ISO3166",
                "example": "US"
              },
              "phone": {
                "example": "+14155550123",
                "type": "string"
              },
              "email": {
                "example": "jane.doe@acme.example",
                "type": "string",
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              }
            },
            "additionalProperties": false
          },
          "destinationAddress": {
            "description": "Ship-to address.",
            "type": "object",
            "properties": {
              "name": {
                "description": "Recipient or sender contact name.",
                "example": "Jane Doe",
                "type": "string"
              },
              "company": {
                "description": "Company name.",
                "example": "Acme Industries",
                "type": "string"
              },
              "street1": {
                "description": "Street address, line 1.",
                "example": "2500 Market Street",
                "type": "string"
              },
              "street2": {
                "description": "Street address, line 2 (unit, suite).",
                "example": "Suite 300",
                "type": "string"
              },
              "city": {
                "description": "City or locality.",
                "example": "San Francisco",
                "type": "string"
              },
              "state": {
                "description": "State, province, or region.",
                "example": "CA",
                "type": "string"
              },
              "postalCode": {
                "description": "ZIP or postal code.",
                "example": "94114",
                "type": "string"
              },
              "country": {
                "$ref": "#/components/schemas/ISO3166",
                "example": "US"
              },
              "phone": {
                "example": "+14155550123",
                "type": "string"
              },
              "email": {
                "example": "jane.doe@acme.example",
                "type": "string",
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              }
            },
            "additionalProperties": false
          },
          "returnAddress": {
            "description": "Return address if distinct from origin.",
            "type": "object",
            "properties": {
              "name": {
                "description": "Recipient or sender contact name.",
                "example": "Jane Doe",
                "type": "string"
              },
              "company": {
                "description": "Company name.",
                "example": "Acme Industries",
                "type": "string"
              },
              "street1": {
                "description": "Street address, line 1.",
                "example": "2500 Market Street",
                "type": "string"
              },
              "street2": {
                "description": "Street address, line 2 (unit, suite).",
                "example": "Suite 300",
                "type": "string"
              },
              "city": {
                "description": "City or locality.",
                "example": "San Francisco",
                "type": "string"
              },
              "state": {
                "description": "State, province, or region.",
                "example": "CA",
                "type": "string"
              },
              "postalCode": {
                "description": "ZIP or postal code.",
                "example": "94114",
                "type": "string"
              },
              "country": {
                "$ref": "#/components/schemas/ISO3166",
                "example": "US"
              },
              "phone": {
                "example": "+14155550123",
                "type": "string"
              },
              "email": {
                "example": "jane.doe@acme.example",
                "type": "string",
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              }
            },
            "additionalProperties": false
          },
          "packages": {
            "description": "Individual packages / cartons in the shipment.",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "example": "pkg_1042",
                  "type": "string"
                },
                "trackingNumber": {
                  "description": "Carrier-issued tracking number.",
                  "example": "1Z999AA10123456784",
                  "type": "string"
                },
                "weight": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "type": "number",
                      "minimum": 0,
                      "description": "Weight value, non-negative.",
                      "example": 1.2
                    },
                    "unit": {
                      "type": "string",
                      "enum": [
                        "oz",
                        "lb",
                        "g",
                        "kg"
                      ],
                      "example": "lb"
                    }
                  },
                  "required": [
                    "value",
                    "unit"
                  ],
                  "additionalProperties": false
                },
                "dimensions": {
                  "type": "object",
                  "properties": {
                    "length": {
                      "type": "number",
                      "minimum": 0,
                      "example": 12
                    },
                    "width": {
                      "type": "number",
                      "minimum": 0,
                      "example": 6
                    },
                    "height": {
                      "type": "number",
                      "minimum": 0,
                      "example": 2
                    },
                    "unit": {
                      "type": "string",
                      "enum": [
                        "in",
                        "cm"
                      ],
                      "example": "in"
                    }
                  },
                  "required": [
                    "length",
                    "width",
                    "height",
                    "unit"
                  ],
                  "additionalProperties": false
                },
                "reference": {
                  "example": "ORD-1042",
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          },
          "totalWeight": {
            "description": "Sum of package weights.",
            "type": "object",
            "properties": {
              "value": {
                "type": "number",
                "minimum": 0,
                "description": "Weight value, non-negative.",
                "example": 1.2
              },
              "unit": {
                "type": "string",
                "enum": [
                  "oz",
                  "lb",
                  "g",
                  "kg"
                ],
                "example": "lb"
              }
            },
            "required": [
              "value",
              "unit"
            ],
            "additionalProperties": false
          },
          "dimensions": {
            "description": "Overall shipment dimensions.",
            "type": "object",
            "properties": {
              "length": {
                "type": "number",
                "minimum": 0,
                "example": 12
              },
              "width": {
                "type": "number",
                "minimum": 0,
                "example": 6
              },
              "height": {
                "type": "number",
                "minimum": 0,
                "example": 2
              },
              "unit": {
                "type": "string",
                "enum": [
                  "in",
                  "cm"
                ],
                "example": "in"
              }
            },
            "required": [
              "length",
              "width",
              "height",
              "unit"
            ],
            "additionalProperties": false
          },
          "estimatedDeliveryAt": {
            "$ref": "#/components/schemas/ISO8601",
            "description": "ETA at the destination.",
            "example": "2026-02-01T14:20:00Z"
          },
          "actualDeliveryAt": {
            "$ref": "#/components/schemas/ISO8601",
            "description": "Actual delivery timestamp.",
            "example": "2026-02-01T14:20:00Z"
          },
          "labelUrl": {
            "description": "URL of the generated shipping label (PDF or PNG).",
            "example": "https://labels.acme.example/shp_1042.pdf",
            "type": "string",
            "format": "uri"
          },
          "cost": {
            "description": "Billed or quoted cost of the shipment.",
            "type": "object",
            "properties": {
              "amount": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 1200
              },
              "currency": {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ],
            "additionalProperties": false
          },
          "reference": {
            "description": "Customer-facing reference (PO number, order ID).",
            "example": "ORD-1042",
            "type": "string"
          },
          "notes": {
            "description": "Free-form notes attached to the shipment.",
            "example": "Leave at front desk.",
            "type": "string"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "description": "Platform timestamp when the record was created.",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "description": "Platform timestamp of the last modification.",
            "example": "2026-02-01T14:20:00Z"
          },
          "mode": {
            "example": "parcel",
            "type": "string",
            "enum": [
              "parcel",
              "ltl",
              "ftl",
              "ocean",
              "air",
              "rail",
              "unknown"
            ],
            "description": "Transport mode for the shipment. Parcel adapters typically leave this unset; ocean, air, and freight adapters should populate it so consumers can filter and apply mode-specific UI."
          },
          "ocean": {
            "type": "object",
            "properties": {
              "containerNumber": {
                "description": "ISO 6346 container identifier.",
                "example": "MSCU1234567",
                "type": "string"
              },
              "containerType": {
                "description": "Container size/type code (e.g. `40HC`, `20GP`, `45HC`).",
                "example": "40HC",
                "type": "string"
              },
              "bookingNumber": {
                "description": "Carrier booking reference.",
                "example": "BK-1042",
                "type": "string"
              },
              "billOfLadingNumber": {
                "description": "Bill of Lading (B/L) number.",
                "example": "BL-1042",
                "type": "string"
              },
              "vesselName": {
                "description": "Vessel the container is loaded on.",
                "example": "MV Acme Star",
                "type": "string"
              },
              "voyageNumber": {
                "description": "Voyage code for the vessel.",
                "example": "V042E",
                "type": "string"
              },
              "shippingLine": {
                "description": "Carrier / shipping line name.",
                "example": "Acme Ocean Line",
                "type": "string"
              },
              "portOfLoading": {
                "description": "Origin port — UN/LOCODE preferred.",
                "example": "CNSHA",
                "type": "string"
              },
              "portOfDischarge": {
                "description": "Destination port — UN/LOCODE preferred.",
                "example": "USLAX",
                "type": "string"
              },
              "estimatedDeparture": {
                "$ref": "#/components/schemas/ISO8601",
                "description": "ETD from the port of loading.",
                "example": "2026-01-15T09:30:00Z"
              },
              "estimatedArrival": {
                "$ref": "#/components/schemas/ISO8601",
                "description": "ETA to the port of discharge.",
                "example": "2026-02-01T14:20:00Z"
              },
              "actualDeparture": {
                "$ref": "#/components/schemas/ISO8601",
                "description": "Actual departure timestamp.",
                "example": "2026-01-15T09:30:00Z"
              },
              "actualArrival": {
                "$ref": "#/components/schemas/ISO8601",
                "description": "Actual arrival timestamp.",
                "example": "2026-02-01T14:20:00Z"
              },
              "sealNumber": {
                "description": "Container seal identifier.",
                "example": "SL-998877",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "description": "Ocean-specific shipment fields. Populated by ocean carrier and container visibility adapters. Left undefined for parcel / air / ground shipments."
          },
          "metadata": {
            "description": "Complete unmodified raw platform response.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false,
        "description": "A parcel, freight, or ocean shipment moving from origin to destination."
      },
      "LogisticsOrder": {
        "type": "object",
        "properties": {
          "id": {
            "example": "ord_1042",
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
          },
          "status": {
            "example": "SHIPPED",
            "type": "string",
            "enum": [
              "PENDING",
              "PROCESSING",
              "ON_HOLD",
              "AWAITING_SHIPMENT",
              "SHIPPED",
              "DELIVERED",
              "CANCELLED",
              "RETURNED",
              "unknown"
            ]
          },
          "orderNumber": {
            "example": "ORD-1042",
            "type": "string"
          },
          "customerId": {
            "example": "cus_4Qm2Xa9Lr",
            "type": "string"
          },
          "warehouseId": {
            "example": "wh_sfo1",
            "type": "string"
          },
          "shipmentIds": {
            "example": [
              "shp_8f3a2b9c4d"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "originAddress": {
            "type": "object",
            "properties": {
              "name": {
                "description": "Recipient or sender contact name.",
                "example": "Jane Doe",
                "type": "string"
              },
              "company": {
                "description": "Company name.",
                "example": "Acme Industries",
                "type": "string"
              },
              "street1": {
                "description": "Street address, line 1.",
                "example": "2500 Market Street",
                "type": "string"
              },
              "street2": {
                "description": "Street address, line 2 (unit, suite).",
                "example": "Suite 300",
                "type": "string"
              },
              "city": {
                "description": "City or locality.",
                "example": "San Francisco",
                "type": "string"
              },
              "state": {
                "description": "State, province, or region.",
                "example": "CA",
                "type": "string"
              },
              "postalCode": {
                "description": "ZIP or postal code.",
                "example": "94114",
                "type": "string"
              },
              "country": {
                "$ref": "#/components/schemas/ISO3166",
                "example": "US"
              },
              "phone": {
                "example": "+14155550123",
                "type": "string"
              },
              "email": {
                "example": "jane.doe@acme.example",
                "type": "string",
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              }
            },
            "additionalProperties": false
          },
          "destinationAddress": {
            "type": "object",
            "properties": {
              "name": {
                "description": "Recipient or sender contact name.",
                "example": "Jane Doe",
                "type": "string"
              },
              "company": {
                "description": "Company name.",
                "example": "Acme Industries",
                "type": "string"
              },
              "street1": {
                "description": "Street address, line 1.",
                "example": "2500 Market Street",
                "type": "string"
              },
              "street2": {
                "description": "Street address, line 2 (unit, suite).",
                "example": "Suite 300",
                "type": "string"
              },
              "city": {
                "description": "City or locality.",
                "example": "San Francisco",
                "type": "string"
              },
              "state": {
                "description": "State, province, or region.",
                "example": "CA",
                "type": "string"
              },
              "postalCode": {
                "description": "ZIP or postal code.",
                "example": "94114",
                "type": "string"
              },
              "country": {
                "$ref": "#/components/schemas/ISO3166",
                "example": "US"
              },
              "phone": {
                "example": "+14155550123",
                "type": "string"
              },
              "email": {
                "example": "jane.doe@acme.example",
                "type": "string",
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              }
            },
            "additionalProperties": false
          },
          "lineItems": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "example": "li_1042",
                      "type": "string"
                    },
                    "sku": {
                      "description": "Stock-keeping unit.",
                      "example": "KB-MECH-87",
                      "type": "string"
                    },
                    "name": {
                      "example": "Mechanical Keyboard",
                      "type": "string"
                    },
                    "description": {
                      "example": "Mechanical keyboard, tactile switches.",
                      "type": "string"
                    },
                    "quantity": {
                      "example": 1,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "unitAmount": {
                      "example": 7999,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "totalAmount": {
                      "example": 7999,
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991,
                          "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                          "example": 125000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "weight": {
                      "type": "object",
                      "properties": {
                        "value": {
                          "type": "number",
                          "minimum": 0,
                          "description": "Weight value, non-negative.",
                          "example": 1.2
                        },
                        "unit": {
                          "type": "string",
                          "enum": [
                            "oz",
                            "lb",
                            "g",
                            "kg"
                          ],
                          "example": "lb"
                        }
                      },
                      "required": [
                        "value",
                        "unit"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "subtotalAmount": {
            "example": 7999,
            "type": "number",
            "minimum": 0
          },
          "taxAmount": {
            "example": 700,
            "type": "number",
            "minimum": 0
          },
          "shippingAmount": {
            "example": 1200,
            "type": "number",
            "minimum": 0
          },
          "discountAmount": {
            "example": 0,
            "type": "number",
            "minimum": 0
          },
          "totalAmount": {
            "example": 9899,
            "type": "number",
            "minimum": 0
          },
          "notes": {
            "example": "Leave at front desk.",
            "type": "string"
          },
          "requestedServiceCode": {
            "example": "ups_ground",
            "type": "string"
          },
          "orderAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "shippedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "deliveredAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "cancelledAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": null
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "LogisticsCarrier": {
        "type": "object",
        "properties": {
          "id": {
            "example": "ups",
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
          },
          "name": {
            "example": "UPS",
            "type": "string"
          },
          "code": {
            "example": "ups",
            "type": "string"
          },
          "trackingUrlTemplate": {
            "example": "https://www.ups.com/track?tracknum={trackingNumber}",
            "type": "string"
          },
          "services": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "Carrier service-level code (e.g. `USPS_PRIORITY`).",
                  "example": "ups_ground"
                },
                "name": {
                  "example": "UPS Ground",
                  "type": "string"
                },
                "transitDaysMin": {
                  "description": "Minimum transit time in days.",
                  "example": 1,
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "transitDaysMax": {
                  "description": "Maximum transit time in days.",
                  "example": 5,
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "isGuaranteed": {
                  "example": false,
                  "type": "boolean"
                }
              },
              "required": [
                "code"
              ],
              "additionalProperties": false
            }
          },
          "isActive": {
            "example": true,
            "type": "boolean"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "LogisticsWarehouse": {
        "type": "object",
        "properties": {
          "id": {
            "example": "wh_sfo1",
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
          },
          "name": {
            "example": "SF Warehouse",
            "type": "string"
          },
          "code": {
            "example": "SFO1",
            "type": "string"
          },
          "address": {
            "type": "object",
            "properties": {
              "name": {
                "description": "Recipient or sender contact name.",
                "example": "Jane Doe",
                "type": "string"
              },
              "company": {
                "description": "Company name.",
                "example": "Acme Industries",
                "type": "string"
              },
              "street1": {
                "description": "Street address, line 1.",
                "example": "2500 Market Street",
                "type": "string"
              },
              "street2": {
                "description": "Street address, line 2 (unit, suite).",
                "example": "Suite 300",
                "type": "string"
              },
              "city": {
                "description": "City or locality.",
                "example": "San Francisco",
                "type": "string"
              },
              "state": {
                "description": "State, province, or region.",
                "example": "CA",
                "type": "string"
              },
              "postalCode": {
                "description": "ZIP or postal code.",
                "example": "94114",
                "type": "string"
              },
              "country": {
                "$ref": "#/components/schemas/ISO3166",
                "example": "US"
              },
              "phone": {
                "example": "+14155550123",
                "type": "string"
              },
              "email": {
                "example": "jane.doe@acme.example",
                "type": "string",
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              }
            },
            "additionalProperties": false
          },
          "isActive": {
            "example": true,
            "type": "boolean"
          },
          "timezone": {
            "description": "IANA tz database identifier (e.g. `America/New_York`).",
            "example": "America/Los_Angeles",
            "type": "string"
          },
          "cutoffTime": {
            "description": "Daily cut-off time for same-day pickup, local to `timezone`.",
            "example": "17:00",
            "type": "string",
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "LogisticsTrackingEvent": {
        "type": "object",
        "properties": {
          "id": {
            "example": "trk_1042",
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
          },
          "shipmentId": {
            "example": "shp_1042",
            "type": "string"
          },
          "trackingNumber": {
            "example": "1Z999AA10123456784",
            "type": "string"
          },
          "carrierId": {
            "example": "ups",
            "type": "string"
          },
          "status": {
            "example": "IN_TRANSIT",
            "type": "string",
            "enum": [
              "PRE_TRANSIT",
              "IN_TRANSIT",
              "OUT_FOR_DELIVERY",
              "DELIVERED",
              "AVAILABLE_FOR_PICKUP",
              "RETURN_TO_SENDER",
              "FAILURE",
              "UNKNOWN"
            ]
          },
          "description": {
            "example": "Departed facility",
            "type": "string"
          },
          "location": {
            "type": "object",
            "properties": {
              "name": {
                "description": "Recipient or sender contact name.",
                "example": "Jane Doe",
                "type": "string"
              },
              "company": {
                "description": "Company name.",
                "example": "Acme Industries",
                "type": "string"
              },
              "street1": {
                "description": "Street address, line 1.",
                "example": "2500 Market Street",
                "type": "string"
              },
              "street2": {
                "description": "Street address, line 2 (unit, suite).",
                "example": "Suite 300",
                "type": "string"
              },
              "city": {
                "description": "City or locality.",
                "example": "San Francisco",
                "type": "string"
              },
              "state": {
                "description": "State, province, or region.",
                "example": "CA",
                "type": "string"
              },
              "postalCode": {
                "description": "ZIP or postal code.",
                "example": "94114",
                "type": "string"
              },
              "country": {
                "$ref": "#/components/schemas/ISO3166",
                "example": "US"
              },
              "phone": {
                "example": "+14155550123",
                "type": "string"
              },
              "email": {
                "example": "jane.doe@acme.example",
                "type": "string",
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              }
            },
            "additionalProperties": false
          },
          "occurredAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "LogisticsRate": {
        "type": "object",
        "properties": {
          "id": {
            "example": "rate_1042",
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
          },
          "carrierId": {
            "example": "ups",
            "type": "string"
          },
          "serviceCode": {
            "example": "ups_ground",
            "type": "string"
          },
          "serviceName": {
            "example": "UPS Ground",
            "type": "string"
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "totalAmount": {
            "example": 1200,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "retailAmount": {
            "example": 1500,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "transitDays": {
            "example": 3,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "estimatedDeliveryAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "isGuaranteedDelivery": {
            "example": false,
            "type": "boolean"
          },
          "deliveryDays": {
            "example": 3,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "LogisticsLabel": {
        "type": "object",
        "properties": {
          "id": {
            "example": "lbl_1042",
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
          },
          "shipmentId": {
            "example": "shp_1042",
            "type": "string"
          },
          "trackingNumber": {
            "example": "1Z999AA10123456784",
            "type": "string"
          },
          "carrierId": {
            "example": "ups",
            "type": "string"
          },
          "serviceCode": {
            "example": "ups_ground",
            "type": "string"
          },
          "format": {
            "example": "PDF",
            "type": "string",
            "enum": [
              "PDF",
              "PNG",
              "ZPL",
              "EPL2",
              "unknown"
            ]
          },
          "status": {
            "example": "CREATED",
            "type": "string",
            "enum": [
              "CREATED",
              "USED",
              "REFUNDED",
              "VOIDED",
              "unknown"
            ]
          },
          "url": {
            "description": "Hosted label URL (PDF or PNG).",
            "example": "https://labels.acme.example/shp_1042.pdf",
            "type": "string",
            "format": "uri"
          },
          "base64": {
            "description": "Base64-encoded label content (when not hosted).",
            "example": "JVBERi0xLjQKJ...",
            "type": "string"
          },
          "cost": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 1200
              },
              "currency": {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ],
            "additionalProperties": false
          },
          "refundAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": null
          },
          "voidedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": null
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "LogisticsManifest": {
        "type": "object",
        "properties": {
          "id": {
            "example": "mfst_1042",
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars."
          },
          "carrierId": {
            "example": "ups",
            "type": "string"
          },
          "warehouseId": {
            "example": "wh_sfo1",
            "type": "string"
          },
          "manifestNumber": {
            "example": "MAN-1042",
            "type": "string"
          },
          "status": {
            "example": "SUBMITTED",
            "type": "string",
            "enum": [
              "OPEN",
              "CLOSED",
              "SUBMITTED",
              "ACCEPTED",
              "unknown"
            ]
          },
          "shipmentIds": {
            "example": [
              "shp_8f3a2b9c4d"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "labelCount": {
            "description": "Number of labels included in the manifest.",
            "example": 1,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "submittedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "additionalProperties": false
      },
      "LogisticsPickup": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
            "example": "pkup_1042"
          },
          "confirmationNumber": {
            "description": "Carrier-issued confirmation — UPS PRN, FedEx pickupConfirmationCode, USPS confirmationNumber, DHL dispatchConfirmationNumber. Often the same string as `id`.",
            "example": "2929602E9CP",
            "type": "string"
          },
          "carrierId": {
            "example": "ups",
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "SCHEDULED",
              "CANCELLED",
              "FAILED",
              "unknown"
            ],
            "example": "SCHEDULED"
          },
          "address": {
            "description": "Where the carrier collects.",
            "type": "object",
            "properties": {
              "name": {
                "description": "Recipient or sender contact name.",
                "example": "Jane Doe",
                "type": "string"
              },
              "company": {
                "description": "Company name.",
                "example": "Acme Industries",
                "type": "string"
              },
              "street1": {
                "description": "Street address, line 1.",
                "example": "2500 Market Street",
                "type": "string"
              },
              "street2": {
                "description": "Street address, line 2 (unit, suite).",
                "example": "Suite 300",
                "type": "string"
              },
              "city": {
                "description": "City or locality.",
                "example": "San Francisco",
                "type": "string"
              },
              "state": {
                "description": "State, province, or region.",
                "example": "CA",
                "type": "string"
              },
              "postalCode": {
                "description": "ZIP or postal code.",
                "example": "94114",
                "type": "string"
              },
              "country": {
                "$ref": "#/components/schemas/ISO3166",
                "example": "US"
              },
              "phone": {
                "example": "+14155550123",
                "type": "string"
              },
              "email": {
                "example": "jane.doe@acme.example",
                "type": "string",
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              }
            },
            "additionalProperties": false
          },
          "readyAt": {
            "$ref": "#/components/schemas/ISO8601",
            "description": "Earliest time the packages are ready for collection.",
            "example": "2026-01-15T09:30:00Z"
          },
          "closeAt": {
            "$ref": "#/components/schemas/ISO8601",
            "description": "Latest time the carrier may still collect — the close of the pickup window.",
            "example": "2026-01-15T17:00:00Z"
          },
          "shipmentIds": {
            "description": "Shipments the pickup covers. Label / transaction ids ride here on platforms that schedule by label rather than by shipment — the same reading `shippo/transform/manifest.ts` makes of `transactions[]`.",
            "example": [
              "shp_8f3a2b9c4d"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "instructions": {
            "description": "Free-text note for the driver.",
            "example": "Ring the bell at the loading dock.",
            "type": "string"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "id",
          "status"
        ],
        "additionalProperties": false
      },
      "LogisticsWebhookEvent": {
        "type": "object",
        "properties": {
          "platform": {
            "type": "string",
            "example": "ups"
          },
          "type": {
            "type": "string",
            "example": "shipment.updated"
          },
          "resourceType": {
            "type": "string",
            "enum": [
              "shipment",
              "order",
              "carrier",
              "warehouse",
              "tracking_event",
              "rate",
              "label",
              "manifest",
              "pickup"
            ],
            "example": "shipment"
          },
          "action": {
            "type": "string",
            "enum": [
              "created",
              "updated",
              "deleted",
              "cancelled"
            ],
            "example": "updated"
          },
          "resourceId": {
            "example": "shp_1042",
            "type": "string"
          },
          "tenantId": {
            "example": "acme-industries",
            "type": "string"
          },
          "payload": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "platform",
          "type",
          "resourceType",
          "action",
          "payload"
        ],
        "additionalProperties": false
      },
      "PaymentsAddressSchema": {
        "type": "object",
        "properties": {
          "line1": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "example": "2500 Market Street"
              },
              {
                "type": "null"
              }
            ]
          },
          "line2": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "example": "Suite 300"
              },
              {
                "type": "null"
              }
            ]
          },
          "city": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120,
                "example": "San Francisco"
              },
              {
                "type": "null"
              }
            ]
          },
          "region": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120,
                "example": "CA"
              },
              {
                "type": "null"
              }
            ]
          },
          "postalCode": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40,
                "example": "94114"
              },
              {
                "type": "null"
              }
            ]
          },
          "country": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO3166",
                "example": "US"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "PaymentsBalanceTransactionSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "txn_1042"
          },
          "externalId": {
            "type": "string",
            "example": "txn_1042"
          },
          "type": {
            "type": "string",
            "enum": [
              "charge",
              "refund",
              "payout",
              "adjustment",
              "fee",
              "dispute",
              "transfer",
              "application_fee",
              "other",
              "unknown"
            ],
            "example": "charge"
          },
          "amount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Gross amount in minor units (can be negative).",
            "example": 125000
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "fee": {
            "description": "Total fee in minor units.",
            "example": 3925,
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "feeDetails": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "amount": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "example": 3925
                },
                "currency": {
                  "$ref": "#/components/schemas/ISO4217",
                  "example": "USD"
                },
                "type": {
                  "type": "string",
                  "description": "Gateway fee classifier (e.g. `stripe_fee`, `application_fee`).",
                  "example": "stripe_fee"
                },
                "description": {
                  "example": "Stripe processing fee",
                  "type": "string"
                }
              },
              "required": [
                "amount",
                "currency",
                "type"
              ],
              "additionalProperties": false
            }
          },
          "net": {
            "example": 121075,
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "sourceId": {
            "description": "Foreign key to charge / refund / payout / dispute.",
            "example": "ch_1042",
            "type": "string"
          },
          "sourceType": {
            "example": "charge",
            "type": "string"
          },
          "availableOn": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "description": {
            "example": "Invoice INV-1042",
            "type": "string"
          },
          "gateway": {
            "type": "string",
            "example": "stripe"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "type",
          "amount",
          "currency",
          "gateway",
          "metadata"
        ],
        "additionalProperties": false
      },
      "PaymentsBalanceTransactionTypeSchema": {
        "type": "string",
        "enum": [
          "charge",
          "refund",
          "payout",
          "adjustment",
          "fee",
          "dispute",
          "transfer",
          "application_fee",
          "other",
          "unknown"
        ]
      },
      "PaymentsBillingIntervalSchema": {
        "type": "string",
        "enum": [
          "day",
          "week",
          "month",
          "year"
        ]
      },
      "PaymentsChargeSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
            "example": "ch_1042"
          },
          "externalId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
            "example": "ch_1042"
          },
          "amount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Gross charge amount in minor units.",
            "example": 125000
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "amountRefunded": {
            "example": 0,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "amountCaptured": {
            "example": 125000,
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 125000
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "succeeded",
              "failed",
              "refunded",
              "partially_refunded",
              "disputed",
              "cancelled",
              "unknown"
            ],
            "example": "succeeded"
          },
          "captured": {
            "example": true,
            "type": "boolean"
          },
          "capturedAt": {
            "example": "2026-01-15T09:30:00Z",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601",
                "example": "2026-01-15T09:30:00Z"
              },
              {
                "type": "null"
              }
            ]
          },
          "customerId": {
            "example": "cus_4Qm2Xa9Lr",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                "example": "acme-industries"
              },
              {
                "type": "null"
              }
            ]
          },
          "paymentMethodId": {
            "example": "pm_1042",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                "example": "acme-industries"
              },
              {
                "type": "null"
              }
            ]
          },
          "invoiceId": {
            "example": "inv_1042",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                "example": "acme-industries"
              },
              {
                "type": "null"
              }
            ]
          },
          "subscriptionId": {
            "example": "sub_1042",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                "example": "acme-industries"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "example": "Invoice INV-1042",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000,
                "description": "Long-form free text. Max 2000 chars.",
                "example": "Industrial supplies and equipment."
              },
              {
                "type": "null"
              }
            ]
          },
          "statementDescriptor": {
            "example": "ACME INV-1042",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "failureCode": {
            "example": null,
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ]
          },
          "failureMessage": {
            "example": null,
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "receiptUrl": {
            "example": "https://pay.stripe.com/receipts/ch_1042",
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "receiptEmail": {
            "example": "jane.doe@acme.example",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 320,
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
                "description": "RFC 5321 email address. Max 320 chars.",
                "example": "jane.doe@acme.example"
              },
              {
                "type": "null"
              }
            ]
          },
          "refundIds": {
            "example": [
              "re_1042"
            ],
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
              "example": "acme-industries"
            }
          },
          "disputeIds": {
            "example": [],
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
              "example": "acme-industries"
            }
          },
          "gateway": {
            "type": "string",
            "maxLength": 64,
            "example": "stripe"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "createdAt": {
            "example": "2026-01-15T09:30:00Z",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601",
                "example": "2026-01-15T09:30:00Z"
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "example": "2026-02-01T14:20:00Z",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601",
                "example": "2026-01-15T09:30:00Z"
              },
              {
                "type": "null"
              }
            ]
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "amount",
          "currency",
          "status",
          "gateway",
          "metadata"
        ],
        "additionalProperties": false
      },
      "PaymentsChargeStatusSchema": {
        "type": "string",
        "enum": [
          "pending",
          "succeeded",
          "failed",
          "refunded",
          "partially_refunded",
          "disputed",
          "cancelled",
          "unknown"
        ]
      },
      "PaymentsCollectionMethodSchema": {
        "type": "string",
        "enum": [
          "charge_automatically",
          "send_invoice",
          "unknown"
        ]
      },
      "PaymentsCustomerSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
            "example": "cus_4Qm2Xa9Lr"
          },
          "externalId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Gateway-assigned identifier (e.g. Stripe `cus_…`).",
            "example": "cus_4Qm2Xa9Lr"
          },
          "email": {
            "example": "jane.doe@acme.example",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 320,
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
                "description": "RFC 5321 email address. Max 320 chars.",
                "example": "jane.doe@acme.example"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "example": "Jane Doe",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "description": "Display name (display label or title). Max 255 chars.",
                "example": "Acme Industries"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "example": "+14155550123",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "defaultPaymentMethodId": {
            "example": "pm_1042",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "description": "Upstream platform identifier. Required, non-empty. Max 256 chars.",
                "example": "acme-industries"
              },
              {
                "type": "null"
              }
            ]
          },
          "billingAddress": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "line1": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255,
                        "example": "2500 Market Street"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "line2": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255,
                        "example": "Suite 300"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "city": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120,
                        "example": "San Francisco"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "region": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120,
                        "example": "CA"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postalCode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 40,
                        "example": "94114"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/ISO3166",
                        "example": "US"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "shippingAddress": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "line1": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255,
                        "example": "2500 Market Street"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "line2": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 255,
                        "example": "Suite 300"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "city": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120,
                        "example": "San Francisco"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "region": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120,
                        "example": "CA"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postalCode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 40,
                        "example": "94114"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/ISO3166",
                        "example": "US"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "description": "Default settlement currency for this customer.",
            "example": "USD",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              },
              {
                "type": "null"
              }
            ]
          },
          "balance": {
            "example": 0,
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "delinquent": {
            "example": false,
            "type": "boolean"
          },
          "description": {
            "example": "Invoice INV-1042",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000,
                "description": "Long-form free text. Max 2000 chars.",
                "example": "Industrial supplies and equipment."
              },
              {
                "type": "null"
              }
            ]
          },
          "gateway": {
            "type": "string",
            "maxLength": 64,
            "description": "Adapter slug, e.g. `stripe`.",
            "example": "stripe"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "createdAt": {
            "example": "2026-01-15T09:30:00Z",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601",
                "example": "2026-01-15T09:30:00Z"
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "example": "2026-02-01T14:20:00Z",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601",
                "example": "2026-01-15T09:30:00Z"
              },
              {
                "type": "null"
              }
            ]
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "gateway",
          "metadata"
        ],
        "additionalProperties": false
      },
      "PaymentsDisputeReasonSchema": {
        "type": "string",
        "enum": [
          "duplicate",
          "fraudulent",
          "subscription_cancelled",
          "product_not_received",
          "product_unacceptable",
          "credit_not_processed",
          "general",
          "unrecognized",
          "other",
          "unknown"
        ]
      },
      "PaymentsDisputeSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "dp_1042"
          },
          "externalId": {
            "type": "string",
            "example": "dp_1042"
          },
          "chargeId": {
            "type": "string",
            "example": "ch_1042"
          },
          "amount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "example": 125000
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "status": {
            "type": "string",
            "enum": [
              "warning_needs_response",
              "warning_under_review",
              "warning_closed",
              "needs_response",
              "under_review",
              "won",
              "lost",
              "charge_refunded",
              "unknown"
            ],
            "example": "won"
          },
          "reason": {
            "example": "fraudulent",
            "type": "string",
            "enum": [
              "duplicate",
              "fraudulent",
              "subscription_cancelled",
              "product_not_received",
              "product_unacceptable",
              "credit_not_processed",
              "general",
              "unrecognized",
              "other",
              "unknown"
            ]
          },
          "evidenceDueBy": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "network": {
            "description": "Card network, e.g. `visa`, `mastercard`.",
            "example": "visa",
            "type": "string"
          },
          "gateway": {
            "type": "string",
            "example": "stripe"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "chargeId",
          "amount",
          "currency",
          "status",
          "gateway",
          "metadata"
        ],
        "additionalProperties": false
      },
      "PaymentsDisputeStatusSchema": {
        "type": "string",
        "enum": [
          "warning_needs_response",
          "warning_under_review",
          "warning_closed",
          "needs_response",
          "under_review",
          "won",
          "lost",
          "charge_refunded",
          "unknown"
        ]
      },
      "PaymentsFeeSchema": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "example": 3925
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "type": {
            "type": "string",
            "description": "Gateway fee classifier (e.g. `stripe_fee`, `application_fee`).",
            "example": "stripe_fee"
          },
          "description": {
            "example": "Stripe processing fee",
            "type": "string"
          }
        },
        "required": [
          "amount",
          "currency",
          "type"
        ],
        "additionalProperties": false
      },
      "PaymentsInvoiceLineItemSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "il_1042"
          },
          "externalId": {
            "type": "string",
            "example": "il_1042"
          },
          "invoiceId": {
            "type": "string",
            "example": "inv_1042"
          },
          "description": {
            "example": "Invoice INV-1042",
            "type": "string"
          },
          "quantity": {
            "example": 1,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "unitAmount": {
            "example": 125000,
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "amount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "example": 125000
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "priceId": {
            "example": "price_1042",
            "type": "string"
          },
          "productId": {
            "example": "prod_1042",
            "type": "string"
          },
          "subscriptionId": {
            "example": "sub_1042",
            "type": "string"
          },
          "periodStart": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "periodEnd": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "proration": {
            "example": false,
            "type": "boolean"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "externalId",
          "invoiceId",
          "amount",
          "currency",
          "metadata"
        ],
        "additionalProperties": false
      },
      "PaymentsInvoiceSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "inv_1042"
          },
          "externalId": {
            "type": "string",
            "example": "inv_1042"
          },
          "number": {
            "description": "Display number / human-readable invoice number.",
            "example": "INV-1042",
            "type": "string"
          },
          "customerId": {
            "example": "cus_4Qm2Xa9Lr",
            "type": "string"
          },
          "subscriptionId": {
            "example": "sub_1042",
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "open",
              "paid",
              "void",
              "uncollectible",
              "unknown"
            ],
            "example": "paid"
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "subtotal": {
            "example": 125000,
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "tax": {
            "example": 0,
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "total": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "example": 125000
          },
          "amountDue": {
            "example": 0,
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "amountPaid": {
            "example": 125000,
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "amountRemaining": {
            "example": 0,
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "dueDate": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "paidAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "periodStart": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "periodEnd": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "hostedInvoiceUrl": {
            "example": "https://pay.stripe.com/invoice/inv_1042",
            "type": "string",
            "format": "uri"
          },
          "invoicePdfUrl": {
            "example": "https://pay.stripe.com/invoice/inv_1042/pdf",
            "type": "string",
            "format": "uri"
          },
          "lineItemIds": {
            "example": [
              "il_1042"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "gateway": {
            "type": "string",
            "example": "stripe"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "status",
          "currency",
          "total",
          "gateway",
          "metadata"
        ],
        "additionalProperties": false
      },
      "PaymentsInvoiceStatusSchema": {
        "type": "string",
        "enum": [
          "draft",
          "open",
          "paid",
          "void",
          "uncollectible",
          "unknown"
        ]
      },
      "PaymentsMoneySchema": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Amount in integer minor units (e.g. cents). May be negative for credits / refunds.",
            "example": 125000
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          }
        },
        "required": [
          "amount",
          "currency"
        ],
        "additionalProperties": false
      },
      "PaymentsPaymentMethodSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "pm_1042"
          },
          "externalId": {
            "type": "string",
            "example": "pm_1042"
          },
          "customerId": {
            "example": "cus_4Qm2Xa9Lr",
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "card",
              "bank_account",
              "wallet",
              "bnpl",
              "a2a",
              "mandate",
              "other",
              "unknown"
            ],
            "example": "card"
          },
          "brand": {
            "description": "Card brand (e.g. `visa`) or wallet name (e.g. `apple_pay`).",
            "example": "visa",
            "type": "string"
          },
          "last4": {
            "example": "4242",
            "type": "string"
          },
          "expMonth": {
            "example": 12,
            "type": "integer",
            "minimum": 1,
            "maximum": 12
          },
          "expYear": {
            "example": 2028,
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "holderName": {
            "example": "Jane Doe",
            "type": "string"
          },
          "bankName": {
            "example": "Acme Bank",
            "type": "string"
          },
          "isDefault": {
            "example": true,
            "type": "boolean"
          },
          "fingerprint": {
            "description": "Gateway de-duplication fingerprint when available.",
            "example": "fp_8Hk2Wd",
            "type": "string"
          },
          "gateway": {
            "type": "string",
            "example": "stripe"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "type",
          "gateway",
          "metadata"
        ],
        "additionalProperties": false
      },
      "PaymentsPaymentMethodTypeSchema": {
        "type": "string",
        "enum": [
          "card",
          "bank_account",
          "wallet",
          "bnpl",
          "a2a",
          "mandate",
          "other",
          "unknown"
        ]
      },
      "PaymentsPayoutMethodSchema": {
        "type": "string",
        "enum": [
          "standard",
          "instant",
          "unknown"
        ]
      },
      "PaymentsPayoutSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "po_1042"
          },
          "externalId": {
            "type": "string",
            "example": "po_1042"
          },
          "amount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "example": 125000
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "in_transit",
              "paid",
              "failed",
              "cancelled",
              "unknown"
            ],
            "example": "paid"
          },
          "method": {
            "example": "standard",
            "type": "string",
            "enum": [
              "standard",
              "instant",
              "unknown"
            ]
          },
          "arrivalDate": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "destinationLast4": {
            "example": "4242",
            "type": "string"
          },
          "statementDescriptor": {
            "example": "ACME PAYOUT",
            "type": "string"
          },
          "failureCode": {
            "example": null,
            "type": "string"
          },
          "failureMessage": {
            "example": null,
            "type": "string"
          },
          "gateway": {
            "type": "string",
            "example": "stripe"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "amount",
          "currency",
          "status",
          "gateway",
          "metadata"
        ],
        "additionalProperties": false
      },
      "PaymentsPayoutStatusSchema": {
        "type": "string",
        "enum": [
          "pending",
          "in_transit",
          "paid",
          "failed",
          "cancelled",
          "unknown"
        ]
      },
      "PaymentsPlanSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "plan_1042"
          },
          "externalId": {
            "type": "string",
            "example": "plan_1042"
          },
          "productId": {
            "example": "prod_1042",
            "type": "string"
          },
          "nickname": {
            "example": "Acme Monthly",
            "type": "string"
          },
          "active": {
            "example": true,
            "type": "boolean"
          },
          "amount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "example": 125000
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "interval": {
            "type": "string",
            "enum": [
              "day",
              "week",
              "month",
              "year"
            ],
            "example": "month"
          },
          "intervalCount": {
            "example": 1,
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "trialPeriodDays": {
            "example": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "gateway": {
            "type": "string",
            "example": "stripe"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "amount",
          "currency",
          "interval",
          "gateway",
          "metadata"
        ],
        "additionalProperties": false
      },
      "PaymentsPriceSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "price_1042"
          },
          "externalId": {
            "type": "string",
            "example": "price_1042"
          },
          "productId": {
            "type": "string",
            "example": "prod_1042"
          },
          "nickname": {
            "example": "Acme Monthly",
            "type": "string"
          },
          "active": {
            "example": true,
            "type": "boolean"
          },
          "unitAmount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Price per unit in minor units.",
            "example": 125000
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "type": {
            "type": "string",
            "enum": [
              "recurring",
              "one_time"
            ],
            "example": "recurring"
          },
          "interval": {
            "example": "month",
            "type": "string",
            "enum": [
              "day",
              "week",
              "month",
              "year"
            ]
          },
          "intervalCount": {
            "example": 1,
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "trialPeriodDays": {
            "example": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "gateway": {
            "type": "string",
            "example": "stripe"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "productId",
          "unitAmount",
          "currency",
          "type",
          "gateway",
          "metadata"
        ],
        "additionalProperties": false
      },
      "PaymentsProductSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "prod_1042"
          },
          "externalId": {
            "type": "string",
            "example": "prod_1042"
          },
          "name": {
            "type": "string",
            "example": "Acme Industries Subscription"
          },
          "description": {
            "example": "Invoice INV-1042",
            "type": "string"
          },
          "active": {
            "example": true,
            "type": "boolean"
          },
          "gateway": {
            "type": "string",
            "example": "stripe"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "name",
          "gateway",
          "metadata"
        ],
        "additionalProperties": false
      },
      "PaymentsRefundReasonSchema": {
        "type": "string",
        "enum": [
          "requested_by_customer",
          "duplicate",
          "fraudulent",
          "expired_uncaptured_charge",
          "other",
          "unknown"
        ]
      },
      "PaymentsRefundSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "re_1042"
          },
          "externalId": {
            "type": "string",
            "example": "re_1042"
          },
          "chargeId": {
            "type": "string",
            "example": "ch_1042"
          },
          "amount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "example": 125000
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "succeeded",
              "failed",
              "cancelled",
              "unknown"
            ],
            "example": "succeeded"
          },
          "reason": {
            "example": "requested_by_customer",
            "type": "string",
            "enum": [
              "requested_by_customer",
              "duplicate",
              "fraudulent",
              "expired_uncaptured_charge",
              "other",
              "unknown"
            ]
          },
          "failureReason": {
            "example": null,
            "type": "string"
          },
          "receiptNumber": {
            "example": "1042-0001",
            "type": "string"
          },
          "gateway": {
            "type": "string",
            "example": "stripe"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "chargeId",
          "amount",
          "currency",
          "status",
          "gateway",
          "metadata"
        ],
        "additionalProperties": false
      },
      "PaymentsRefundStatusSchema": {
        "type": "string",
        "enum": [
          "pending",
          "succeeded",
          "failed",
          "cancelled",
          "unknown"
        ]
      },
      "PaymentsSubscriptionItemSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "si_1042"
          },
          "priceId": {
            "example": "price_1042",
            "type": "string"
          },
          "productId": {
            "example": "prod_1042",
            "type": "string"
          },
          "quantity": {
            "example": 1,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "amount": {
            "description": "Unit amount in minor units.",
            "example": 125000,
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": false
      },
      "PaymentsSubscriptionSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "sub_1042"
          },
          "externalId": {
            "type": "string",
            "example": "sub_1042"
          },
          "customerId": {
            "type": "string",
            "example": "cus_4Qm2Xa9Lr"
          },
          "status": {
            "type": "string",
            "enum": [
              "trialing",
              "active",
              "past_due",
              "cancelled",
              "expired",
              "paused",
              "incomplete",
              "unknown"
            ],
            "example": "active"
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "example": "si_1042"
                },
                "priceId": {
                  "example": "price_1042",
                  "type": "string"
                },
                "productId": {
                  "example": "prod_1042",
                  "type": "string"
                },
                "quantity": {
                  "example": 1,
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "amount": {
                  "description": "Unit amount in minor units.",
                  "example": 125000,
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "metadata": {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "id"
              ],
              "additionalProperties": false
            }
          },
          "currentPeriodStart": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "currentPeriodEnd": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "billingAnchor": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "trialStart": {
            "$ref": "#/components/schemas/ISO8601",
            "example": null
          },
          "trialEnd": {
            "$ref": "#/components/schemas/ISO8601",
            "example": null
          },
          "cancelAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": null
          },
          "cancelledAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": null
          },
          "cancelAtPeriodEnd": {
            "example": false,
            "type": "boolean"
          },
          "collectionMethod": {
            "example": "charge_automatically",
            "type": "string",
            "enum": [
              "charge_automatically",
              "send_invoice",
              "unknown"
            ]
          },
          "dunningState": {
            "example": null,
            "type": "string"
          },
          "defaultPaymentMethodId": {
            "example": "pm_1042",
            "type": "string"
          },
          "latestInvoiceId": {
            "example": "inv_1042",
            "type": "string"
          },
          "gateway": {
            "type": "string",
            "example": "stripe"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "customerId",
          "status",
          "items",
          "gateway",
          "metadata"
        ],
        "additionalProperties": false
      },
      "PaymentsSubscriptionStatusSchema": {
        "type": "string",
        "enum": [
          "trialing",
          "active",
          "past_due",
          "cancelled",
          "expired",
          "paused",
          "incomplete",
          "unknown"
        ]
      },
      "PaymentsWebhookActionSchema": {
        "type": "string",
        "enum": [
          "created",
          "updated",
          "deleted",
          "succeeded",
          "failed",
          "cancelled",
          "refunded",
          "paid",
          "voided",
          "disputed",
          "finalized",
          "unknown"
        ]
      },
      "PaymentsWebhookEventSchema": {
        "type": "object",
        "properties": {
          "id": {
            "example": "evt_1042",
            "type": "string"
          },
          "platform": {
            "type": "string",
            "description": "Adapter slug, e.g. `stripe`.",
            "example": "stripe"
          },
          "type": {
            "type": "string",
            "description": "Dot-notation event identifier, e.g. `charge.succeeded`.",
            "example": "charge.succeeded"
          },
          "resourceType": {
            "type": "string",
            "enum": [
              "charges",
              "refunds",
              "customers",
              "payment_methods",
              "subscriptions",
              "invoices",
              "invoice_line_items",
              "payouts",
              "disputes",
              "plans",
              "prices",
              "products",
              "balance_transactions",
              "mandates",
              "unknown"
            ],
            "example": "charges"
          },
          "action": {
            "type": "string",
            "enum": [
              "created",
              "updated",
              "deleted",
              "succeeded",
              "failed",
              "cancelled",
              "refunded",
              "paid",
              "voided",
              "disputed",
              "finalized",
              "unknown"
            ],
            "example": "succeeded"
          },
          "resourceId": {
            "type": "string",
            "example": "ch_1042"
          },
          "tenantId": {
            "example": "acme-industries",
            "type": "string"
          },
          "connectionId": {
            "example": "conn_4Qm2Xa9Lr",
            "type": "string"
          },
          "externalAccountId": {
            "example": "acct_1A2B3C",
            "type": "string"
          },
          "payload": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "platform",
          "type",
          "resourceType",
          "action",
          "resourceId",
          "payload"
        ],
        "additionalProperties": false
      },
      "PaymentsWebhookResourceTypeSchema": {
        "type": "string",
        "enum": [
          "charges",
          "refunds",
          "customers",
          "payment_methods",
          "subscriptions",
          "invoices",
          "invoice_line_items",
          "payouts",
          "disputes",
          "plans",
          "prices",
          "products",
          "balance_transactions",
          "mandates",
          "unknown"
        ]
      },
      "PaymentsChargeCaptureRequest": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer",
            "description": "Amount to capture in minor units. Defaults to the full authorisation.",
            "example": 125000
          }
        }
      },
      "PaymentsSubscriptionCancelRequest": {
        "type": "object",
        "properties": {
          "atPeriodEnd": {
            "type": "boolean",
            "description": "When true, schedule the cancellation for the end of the current billing period.",
            "example": true
          }
        }
      },
      "PaymentsDisputeEvidenceRequest": {
        "type": "object",
        "description": "Free-form bag of gateway-specific evidence fields (varies per platform).",
        "additionalProperties": true
      },
      "PaymentsSyncJob": {
        "type": "object",
        "description": "Background sync job. Created by `POST /v1/{vertical}/sync`.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "sync_1042"
          },
          "vertical": {
            "type": "string",
            "example": "accounting"
          },
          "connectionId": {
            "type": "string",
            "format": "uuid",
            "example": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90"
          },
          "platform": {
            "type": "string",
            "example": "xero"
          },
          "tenantId": {
            "type": "string",
            "nullable": true,
            "example": "acme"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed"
            ],
            "example": "completed"
          },
          "progress": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "object",
              "properties": {
                "synced": {
                  "type": "integer",
                  "example": 128
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "running",
                    "completed",
                    "skipped",
                    "failed"
                  ],
                  "example": "completed"
                },
                "error": {
                  "type": "string",
                  "example": "rate limited by upstream"
                }
              }
            }
          },
          "error": {
            "type": "string",
            "nullable": true,
            "example": null
          },
          "callbackUrl": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "example": "https://hooks.acme.example/sync"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "startedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ],
            "example": "2026-01-15T09:30:00Z"
          },
          "completedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ],
            "example": "2026-02-01T14:20:00Z"
          },
          "origin": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "manual",
              "api",
              "connect",
              "boot",
              "schedule",
              null
            ],
            "description": "Why the job was queued: `api` (POST /v1/{vertical}/sync), `manual` (the admin console), `connect` (right after a Connect Link), `boot` (DATA_STORE_AUTO_SYNC_ON_BOOT) or `schedule` (the connection's sync schedule). Null on jobs queued before this field existed.",
            "example": "schedule"
          }
        },
        "required": [
          "id",
          "vertical",
          "connectionId",
          "platform",
          "status",
          "createdAt"
        ]
      },
      "DocsignAuditTrailEntrySchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "audit_env_1042_completed"
          },
          "externalId": {
            "type": "string",
            "example": "audit_env_1042_completed"
          },
          "envelopeId": {
            "type": "string",
            "example": "env_1042"
          },
          "occurredAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "eventType": {
            "type": "string",
            "enum": [
              "created",
              "sent",
              "viewed",
              "signed",
              "declined",
              "voided",
              "completed",
              "auto_reminded",
              "delivery_failed",
              "authenticated",
              "expired",
              "corrected",
              "reassigned",
              "other",
              "unknown"
            ],
            "example": "completed"
          },
          "description": {
            "type": "string",
            "description": "Short, platform-supplied human-readable description.",
            "example": "Envelope completed"
          },
          "actorId": {
            "description": "Signer or sender id; undefined for system events.",
            "example": "signer_jane",
            "type": "string"
          },
          "actorEmail": {
            "example": "jane.doe@acme.example",
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "actorName": {
            "example": "Jane Doe",
            "type": "string"
          },
          "actorIp": {
            "example": "203.0.113.10",
            "type": "string"
          },
          "platform": {
            "type": "string",
            "example": "docusign"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "envelopeId",
          "occurredAt",
          "eventType",
          "description",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "DocsignAuditTrailEventTypeSchema": {
        "type": "string",
        "enum": [
          "created",
          "sent",
          "viewed",
          "signed",
          "declined",
          "voided",
          "completed",
          "auto_reminded",
          "delivery_failed",
          "authenticated",
          "expired",
          "corrected",
          "reassigned",
          "other",
          "unknown"
        ]
      },
      "DocsignDocumentSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "doc_msa"
          },
          "externalId": {
            "type": "string",
            "example": "doc_msa"
          },
          "envelopeId": {
            "type": "string",
            "example": "env_1042"
          },
          "name": {
            "type": "string",
            "example": "Master Services Agreement.pdf"
          },
          "sizeBytes": {
            "example": 248320,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "pageCount": {
            "example": 12,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "mimeType": {
            "description": "e.g. application/pdf",
            "example": "application/pdf",
            "type": "string"
          },
          "order": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Position within the envelope; 0-indexed.",
            "example": 0
          },
          "platform": {
            "type": "string",
            "example": "docusign"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "envelopeId",
          "name",
          "order",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "DocsignEnvelopeSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "env_1042"
          },
          "externalId": {
            "type": "string",
            "example": "env_1042"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "sent",
              "delivered",
              "completed",
              "declined",
              "voided",
              "expired",
              "unknown"
            ],
            "example": "completed"
          },
          "subject": {
            "type": "string",
            "example": "Master Services Agreement — Acme Industries"
          },
          "message": {
            "description": "Sender-supplied email message body; included as plain text.",
            "example": "Please review and sign.",
            "type": "string"
          },
          "senderId": {
            "example": "usr_olivia",
            "type": "string"
          },
          "senderEmail": {
            "example": "olivia.admin@northwind.example",
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "senderName": {
            "example": "Olivia Admin",
            "type": "string"
          },
          "signingOrder": {
            "type": "string",
            "enum": [
              "parallel",
              "sequential"
            ],
            "example": "sequential"
          },
          "signerIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Ordered for sequential, unordered for parallel.",
            "example": [
              "signer_jane"
            ]
          },
          "documentIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "doc_msa"
            ]
          },
          "templateId": {
            "example": "tmpl_msa",
            "type": "string"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "sentAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "deliveredAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "completedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "declinedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "voidedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "expiresAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "platform": {
            "type": "string",
            "example": "docusign"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "status",
          "subject",
          "signingOrder",
          "signerIds",
          "documentIds",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "DocsignEnvelopeStatusSchema": {
        "type": "string",
        "enum": [
          "draft",
          "sent",
          "delivered",
          "completed",
          "declined",
          "voided",
          "expired",
          "unknown"
        ]
      },
      "DocsignSignerRoleSchema": {
        "type": "string",
        "enum": [
          "signer",
          "cc",
          "in_person_signer",
          "witness",
          "editor",
          "approver",
          "unknown"
        ]
      },
      "DocsignSignerSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "signer_jane"
          },
          "externalId": {
            "type": "string",
            "example": "signer_jane"
          },
          "envelopeId": {
            "type": "string",
            "example": "env_1042"
          },
          "email": {
            "example": "jane.doe@acme.example",
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "name": {
            "type": "string",
            "example": "Jane Doe"
          },
          "role": {
            "type": "string",
            "enum": [
              "signer",
              "cc",
              "in_person_signer",
              "witness",
              "editor",
              "approver",
              "unknown"
            ],
            "example": "signer"
          },
          "status": {
            "type": "string",
            "enum": [
              "created",
              "sent",
              "delivered",
              "signed",
              "declined",
              "auto_responded",
              "unknown"
            ],
            "example": "signed"
          },
          "routingOrder": {
            "description": "1-indexed; only meaningful when envelope.signingOrder = sequential.",
            "example": 1,
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "sentAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "deliveredAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "signedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "declinedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "declineReason": {
            "example": "Terms require legal review",
            "type": "string"
          },
          "platform": {
            "type": "string",
            "example": "docusign"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "envelopeId",
          "name",
          "role",
          "status",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "DocsignSignerStatusSchema": {
        "type": "string",
        "enum": [
          "created",
          "sent",
          "delivered",
          "signed",
          "declined",
          "auto_responded",
          "unknown"
        ]
      },
      "DocsignSigningOrderSchema": {
        "type": "string",
        "enum": [
          "parallel",
          "sequential"
        ]
      },
      "DocsignTemplateSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "tmpl_msa"
          },
          "externalId": {
            "type": "string",
            "example": "tmpl_msa"
          },
          "name": {
            "type": "string",
            "example": "Master Services Agreement"
          },
          "description": {
            "example": "Standard MSA template for new customers",
            "type": "string"
          },
          "signerRoles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Role names defined on the template.",
            "example": [
              "Signer"
            ]
          },
          "documentCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "example": 1
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "platform": {
            "type": "string",
            "example": "docusign"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "name",
          "signerRoles",
          "documentCount",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "DocsignWebhookActionSchema": {
        "type": "string",
        "enum": [
          "created",
          "sent",
          "delivered",
          "viewed",
          "signed",
          "declined",
          "completed",
          "voided",
          "expired",
          "updated",
          "deleted",
          "unknown"
        ]
      },
      "DocsignWebhookEventSchema": {
        "type": "object",
        "properties": {
          "id": {
            "example": "evt_env_1042_completed",
            "type": "string"
          },
          "platform": {
            "type": "string",
            "example": "docusign"
          },
          "type": {
            "type": "string",
            "example": "envelope.completed"
          },
          "resourceType": {
            "type": "string",
            "enum": [
              "envelopes",
              "signers",
              "documents",
              "audit_trail_entries",
              "templates",
              "unknown"
            ],
            "example": "envelopes"
          },
          "action": {
            "type": "string",
            "enum": [
              "created",
              "sent",
              "delivered",
              "viewed",
              "signed",
              "declined",
              "completed",
              "voided",
              "expired",
              "updated",
              "deleted",
              "unknown"
            ],
            "example": "completed"
          },
          "resourceId": {
            "type": "string",
            "example": "env_1042"
          },
          "envelopeId": {
            "example": "env_1042",
            "type": "string"
          },
          "payload": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "platform",
          "type",
          "resourceType",
          "action",
          "resourceId",
          "payload"
        ],
        "additionalProperties": false
      },
      "DocsignWebhookResourceTypeSchema": {
        "type": "string",
        "enum": [
          "envelopes",
          "signers",
          "documents",
          "audit_trail_entries",
          "templates",
          "unknown"
        ]
      },
      "DocsignVoidEnvelopeRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "description": "Human-readable reason recorded on the audit trail.",
            "example": "Superseded by a new agreement."
          }
        }
      },
      "DocsignSyncJob": {
        "type": "object",
        "description": "Background sync job. Created by `POST /v1/{vertical}/sync`.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "sync_1042"
          },
          "vertical": {
            "type": "string",
            "example": "accounting"
          },
          "connectionId": {
            "type": "string",
            "format": "uuid",
            "example": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90"
          },
          "platform": {
            "type": "string",
            "example": "xero"
          },
          "tenantId": {
            "type": "string",
            "nullable": true,
            "example": "acme"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed"
            ],
            "example": "completed"
          },
          "progress": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "object",
              "properties": {
                "synced": {
                  "type": "integer",
                  "example": 128
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "running",
                    "completed",
                    "skipped",
                    "failed"
                  ],
                  "example": "completed"
                },
                "error": {
                  "type": "string",
                  "example": "rate limited by upstream"
                }
              }
            }
          },
          "error": {
            "type": "string",
            "nullable": true,
            "example": null
          },
          "callbackUrl": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "example": "https://hooks.acme.example/sync"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "startedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ],
            "example": "2026-01-15T09:30:00Z"
          },
          "completedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ],
            "example": "2026-02-01T14:20:00Z"
          },
          "origin": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "manual",
              "api",
              "connect",
              "boot",
              "schedule",
              null
            ],
            "description": "Why the job was queued: `api` (POST /v1/{vertical}/sync), `manual` (the admin console), `connect` (right after a Connect Link), `boot` (DATA_STORE_AUTO_SYNC_ON_BOOT) or `schedule` (the connection's sync schedule). Null on jobs queued before this field existed.",
            "example": "schedule"
          }
        },
        "required": [
          "id",
          "vertical",
          "connectionId",
          "platform",
          "status",
          "createdAt"
        ]
      },
      "ProjectsCommentSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "cmt_1042"
          },
          "externalId": {
            "type": "string",
            "example": "cmt_1042"
          },
          "taskId": {
            "example": "task_1042",
            "type": "string"
          },
          "projectId": {
            "example": "proj_1042",
            "type": "string"
          },
          "authorId": {
            "type": "string",
            "example": "usr_jane"
          },
          "body": {
            "type": "string",
            "example": "Scheduled for Monday 10am."
          },
          "mentions": {
            "type": "array",
            "items": {
              "type": "string",
              "example": "usr_olivia"
            },
            "description": "Referenced user ids."
          },
          "attachmentCount": {
            "description": "Derived count. Attachment content is not part of the canonical schema; only the count is surfaced.",
            "example": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "platform": {
            "type": "string",
            "example": "asana"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "authorId",
          "body",
          "mentions",
          "createdAt",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "ProjectsProjectSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "proj_1042"
          },
          "externalId": {
            "type": "string",
            "example": "proj_1042"
          },
          "workspaceId": {
            "type": "string",
            "example": "ws_acme"
          },
          "name": {
            "type": "string",
            "example": "Acme Onboarding"
          },
          "description": {
            "example": "Onboard Acme Industries onto the platform.",
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived",
              "completed",
              "on_hold",
              "unknown"
            ],
            "example": "active"
          },
          "ownerId": {
            "example": "usr_jane",
            "type": "string"
          },
          "startDate": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "endDate": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-15T17:00:00Z"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "platform": {
            "type": "string",
            "example": "asana"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "workspaceId",
          "name",
          "status",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "ProjectsProjectStatusSchema": {
        "type": "string",
        "enum": [
          "active",
          "archived",
          "completed",
          "on_hold",
          "unknown"
        ]
      },
      "ProjectsTagSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "tag_onboarding"
          },
          "externalId": {
            "type": "string",
            "example": "tag_onboarding"
          },
          "workspaceId": {
            "type": "string",
            "example": "ws_acme"
          },
          "name": {
            "type": "string",
            "example": "Phase 1 — Setup"
          },
          "color": {
            "example": "#4f46e5",
            "type": "string"
          },
          "platform": {
            "type": "string",
            "example": "asana"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "workspaceId",
          "name",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "ProjectsTaskPrioritySchema": {
        "type": "string",
        "enum": [
          "low",
          "medium",
          "high",
          "urgent",
          "unknown"
        ]
      },
      "ProjectsTaskSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "task_1042"
          },
          "externalId": {
            "type": "string",
            "example": "task_1042"
          },
          "projectId": {
            "type": "string",
            "example": "proj_1042"
          },
          "parentId": {
            "description": "Flat-with-parent-pointer hierarchy. Jira: epic→story→subtask via parentId chain. Asana: subtask. Linear: sub-issue.",
            "example": "proj_1042",
            "type": "string"
          },
          "title": {
            "type": "string",
            "example": "Kickoff call"
          },
          "description": {
            "description": "Ticket body. Included verbatim.",
            "example": "Onboard Acme Industries onto the platform.",
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "in_progress",
              "in_review",
              "closed",
              "cancelled",
              "unknown"
            ],
            "example": "in_progress"
          },
          "priority": {
            "example": "high",
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high",
              "urgent",
              "unknown"
            ]
          },
          "dueDate": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-15T17:00:00Z"
          },
          "assigneeIds": {
            "type": "array",
            "items": {
              "type": "string",
              "example": "usr_jane"
            }
          },
          "tagIds": {
            "type": "array",
            "items": {
              "type": "string",
              "example": "tag_onboarding"
            }
          },
          "subtaskCount": {
            "description": "Derived count.",
            "example": 3,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "platform": {
            "type": "string",
            "example": "asana"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            },
            "description": "Platform-specific level semantics live here under metadata.platformType ('epic'/'story'/'subtask'/'subissue'/etc.)."
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "projectId",
          "title",
          "status",
          "assigneeIds",
          "tagIds",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "ProjectsTaskStatusSchema": {
        "type": "string",
        "enum": [
          "open",
          "in_progress",
          "in_review",
          "closed",
          "cancelled",
          "unknown"
        ]
      },
      "ProjectsUserSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "usr_jane"
          },
          "externalId": {
            "type": "string",
            "example": "usr_jane"
          },
          "email": {
            "example": "jane.doe@acme.example",
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "name": {
            "type": "string",
            "example": "Jane Doe"
          },
          "workspaceIds": {
            "type": "array",
            "items": {
              "type": "string",
              "example": "ws_acme"
            }
          },
          "platform": {
            "type": "string",
            "example": "asana"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "name",
          "workspaceIds",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "ProjectsWebhookActionSchema": {
        "type": "string",
        "enum": [
          "created",
          "updated",
          "deleted",
          "assigned",
          "unassigned",
          "completed",
          "reopened",
          "commented",
          "mentioned",
          "unknown"
        ]
      },
      "ProjectsWebhookEventSchema": {
        "type": "object",
        "properties": {
          "id": {
            "example": "evt_1042",
            "type": "string"
          },
          "platform": {
            "type": "string",
            "example": "asana"
          },
          "type": {
            "type": "string",
            "example": "task.updated"
          },
          "resourceType": {
            "type": "string",
            "enum": [
              "projects",
              "tasks",
              "comments",
              "tags",
              "workspaces",
              "users",
              "unknown"
            ],
            "example": "tasks"
          },
          "action": {
            "type": "string",
            "enum": [
              "created",
              "updated",
              "deleted",
              "assigned",
              "unassigned",
              "completed",
              "reopened",
              "commented",
              "mentioned",
              "unknown"
            ],
            "example": "updated"
          },
          "resourceId": {
            "type": "string",
            "example": "task_1042"
          },
          "projectId": {
            "example": "proj_1042",
            "type": "string"
          },
          "payload": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "platform",
          "type",
          "resourceType",
          "action",
          "resourceId",
          "payload"
        ],
        "additionalProperties": false
      },
      "ProjectsWebhookResourceTypeSchema": {
        "type": "string",
        "enum": [
          "projects",
          "tasks",
          "comments",
          "tags",
          "workspaces",
          "users",
          "unknown"
        ]
      },
      "ProjectsWorkspaceSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "ws_acme"
          },
          "externalId": {
            "type": "string",
            "example": "ws_acme"
          },
          "name": {
            "type": "string",
            "example": "Acme Industries"
          },
          "memberCount": {
            "example": 12,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "platform": {
            "type": "string",
            "example": "asana"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "name",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "ProjectsSyncJob": {
        "type": "object",
        "description": "Background sync job. Created by `POST /v1/{vertical}/sync`.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "sync_1042"
          },
          "vertical": {
            "type": "string",
            "example": "accounting"
          },
          "connectionId": {
            "type": "string",
            "format": "uuid",
            "example": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90"
          },
          "platform": {
            "type": "string",
            "example": "xero"
          },
          "tenantId": {
            "type": "string",
            "nullable": true,
            "example": "acme"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed"
            ],
            "example": "completed"
          },
          "progress": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "object",
              "properties": {
                "synced": {
                  "type": "integer",
                  "example": 128
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "running",
                    "completed",
                    "skipped",
                    "failed"
                  ],
                  "example": "completed"
                },
                "error": {
                  "type": "string",
                  "example": "rate limited by upstream"
                }
              }
            }
          },
          "error": {
            "type": "string",
            "nullable": true,
            "example": null
          },
          "callbackUrl": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "example": "https://hooks.acme.example/sync"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "startedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ],
            "example": "2026-01-15T09:30:00Z"
          },
          "completedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ],
            "example": "2026-02-01T14:20:00Z"
          },
          "origin": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "manual",
              "api",
              "connect",
              "boot",
              "schedule",
              null
            ],
            "description": "Why the job was queued: `api` (POST /v1/{vertical}/sync), `manual` (the admin console), `connect` (right after a Connect Link), `boot` (DATA_STORE_AUTO_SYNC_ON_BOOT) or `schedule` (the connection's sync schedule). Null on jobs queued before this field existed.",
            "example": "schedule"
          }
        },
        "required": [
          "id",
          "vertical",
          "connectionId",
          "platform",
          "status",
          "createdAt"
        ]
      },
      "CustomerSupportAuthorTypeSchema": {
        "type": "string",
        "enum": [
          "contact",
          "user",
          "system",
          "unknown"
        ]
      },
      "CustomerSupportChannelSchema": {
        "type": "string",
        "enum": [
          "email",
          "chat",
          "voice",
          "social",
          "web",
          "sms",
          "api",
          "other",
          "unknown"
        ]
      },
      "CustomerSupportContactSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "cnt_jane"
          },
          "externalId": {
            "type": "string",
            "example": "cnt_jane"
          },
          "email": {
            "example": "jane.doe@acme.example",
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "name": {
            "type": "string",
            "example": "Jane Doe"
          },
          "phone": {
            "example": "+14155550123",
            "type": "string"
          },
          "organizationId": {
            "example": "org_acme",
            "type": "string"
          },
          "platform": {
            "type": "string",
            "example": "zendesk"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "name",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "CustomerSupportMacroSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "mac_login_reset"
          },
          "externalId": {
            "type": "string",
            "example": "mac_login_reset"
          },
          "title": {
            "type": "string",
            "example": "Login / password reset"
          },
          "body": {
            "type": "string",
            "example": "Hi, please try resetting your password again using the link below."
          },
          "category": {
            "example": "Account access",
            "type": "string"
          },
          "platform": {
            "type": "string",
            "example": "zendesk"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "title",
          "body",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "CustomerSupportMessageSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "msg_1042"
          },
          "externalId": {
            "type": "string",
            "example": "msg_1042"
          },
          "ticketId": {
            "type": "string",
            "example": "tkt_1042"
          },
          "authorId": {
            "type": "string",
            "example": "cnt_jane"
          },
          "authorType": {
            "type": "string",
            "enum": [
              "contact",
              "user",
              "system",
              "unknown"
            ],
            "example": "contact"
          },
          "body": {
            "type": "string",
            "example": "I can't access my account after the password reset."
          },
          "type": {
            "type": "string",
            "enum": [
              "public",
              "internal",
              "unknown"
            ],
            "example": "public"
          },
          "attachmentCount": {
            "description": "Derived count. Attachment CONTENT is not on the canonical schema.",
            "example": 1,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "platform": {
            "type": "string",
            "example": "zendesk"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "ticketId",
          "authorId",
          "authorType",
          "body",
          "type",
          "createdAt",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "CustomerSupportMessageTypeSchema": {
        "type": "string",
        "enum": [
          "public",
          "internal",
          "unknown"
        ]
      },
      "CustomerSupportTagSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "tag_login"
          },
          "externalId": {
            "type": "string",
            "example": "tag_login"
          },
          "name": {
            "type": "string",
            "example": "login"
          },
          "color": {
            "example": "#e53935",
            "type": "string"
          },
          "platform": {
            "type": "string",
            "example": "zendesk"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "name",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "CustomerSupportTeamSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "team_support"
          },
          "externalId": {
            "type": "string",
            "example": "team_support"
          },
          "name": {
            "type": "string",
            "example": "Support"
          },
          "memberCount": {
            "example": 12,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "platform": {
            "type": "string",
            "example": "zendesk"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "name",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "CustomerSupportTicketPrioritySchema": {
        "type": "string",
        "enum": [
          "low",
          "normal",
          "high",
          "urgent",
          "unknown"
        ]
      },
      "CustomerSupportTicketSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "tkt_1042"
          },
          "externalId": {
            "type": "string",
            "example": "tkt_1042"
          },
          "number": {
            "example": "1042",
            "type": "string"
          },
          "subject": {
            "type": "string",
            "example": "Unable to log in"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "pending",
              "in_progress",
              "on_hold",
              "resolved",
              "closed",
              "unknown"
            ],
            "example": "open"
          },
          "priority": {
            "example": "high",
            "type": "string",
            "enum": [
              "low",
              "normal",
              "high",
              "urgent",
              "unknown"
            ]
          },
          "channel": {
            "type": "string",
            "enum": [
              "email",
              "chat",
              "voice",
              "social",
              "web",
              "sms",
              "api",
              "other",
              "unknown"
            ],
            "example": "email"
          },
          "requesterId": {
            "type": "string",
            "example": "cnt_jane"
          },
          "assigneeId": {
            "example": "usr_olivia",
            "type": "string"
          },
          "teamId": {
            "example": "team_support",
            "type": "string"
          },
          "tagIds": {
            "type": "array",
            "items": {
              "type": "string",
              "example": "tag_login"
            }
          },
          "parentTicketId": {
            "description": "Optional parent reference for ticket merging (Zendesk) / sub-tickets (Salesforce Service Cloud). Most platforms unused.",
            "example": "tkt_1000",
            "type": "string"
          },
          "satisfactionRating": {
            "description": "Normalised 1-5 rating. Raw scale + free-text response refused at schema level.",
            "example": 5,
            "type": "integer",
            "minimum": 1,
            "maximum": 5
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "resolvedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "closedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "platform": {
            "type": "string",
            "example": "zendesk"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "subject",
          "status",
          "channel",
          "requesterId",
          "tagIds",
          "createdAt",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "CustomerSupportTicketStatusSchema": {
        "type": "string",
        "enum": [
          "open",
          "pending",
          "in_progress",
          "on_hold",
          "resolved",
          "closed",
          "unknown"
        ]
      },
      "CustomerSupportUserSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "usr_olivia"
          },
          "externalId": {
            "type": "string",
            "example": "usr_olivia"
          },
          "email": {
            "example": "olivia.admin@northwind.example",
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "name": {
            "type": "string",
            "example": "Olivia Admin"
          },
          "role": {
            "example": "agent",
            "type": "string"
          },
          "teamIds": {
            "type": "array",
            "items": {
              "type": "string",
              "example": "team_support"
            }
          },
          "platform": {
            "type": "string",
            "example": "zendesk"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "name",
          "teamIds",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "CustomerSupportWebhookActionSchema": {
        "type": "string",
        "enum": [
          "created",
          "updated",
          "deleted",
          "assigned",
          "unassigned",
          "resolved",
          "reopened",
          "closed",
          "commented",
          "mentioned",
          "rated",
          "unknown"
        ]
      },
      "CustomerSupportWebhookEventSchema": {
        "type": "object",
        "properties": {
          "id": {
            "example": "evt_1042",
            "type": "string"
          },
          "platform": {
            "type": "string",
            "example": "zendesk"
          },
          "type": {
            "type": "string",
            "example": "ticket.created"
          },
          "resourceType": {
            "type": "string",
            "enum": [
              "tickets",
              "messages",
              "contacts",
              "users",
              "tags",
              "teams",
              "macros",
              "unknown"
            ],
            "example": "tickets"
          },
          "action": {
            "type": "string",
            "enum": [
              "created",
              "updated",
              "deleted",
              "assigned",
              "unassigned",
              "resolved",
              "reopened",
              "closed",
              "commented",
              "mentioned",
              "rated",
              "unknown"
            ],
            "example": "created"
          },
          "resourceId": {
            "type": "string",
            "example": "tkt_1042"
          },
          "ticketId": {
            "example": "tkt_1042",
            "type": "string"
          },
          "payload": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "platform",
          "type",
          "resourceType",
          "action",
          "resourceId",
          "payload"
        ],
        "additionalProperties": false
      },
      "CustomerSupportWebhookResourceTypeSchema": {
        "type": "string",
        "enum": [
          "tickets",
          "messages",
          "contacts",
          "users",
          "tags",
          "teams",
          "macros",
          "unknown"
        ]
      },
      "CustomerSupportSyncJob": {
        "type": "object",
        "description": "Background sync job. Created by `POST /v1/{vertical}/sync`.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "sync_1042"
          },
          "vertical": {
            "type": "string",
            "example": "accounting"
          },
          "connectionId": {
            "type": "string",
            "format": "uuid",
            "example": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90"
          },
          "platform": {
            "type": "string",
            "example": "xero"
          },
          "tenantId": {
            "type": "string",
            "nullable": true,
            "example": "acme"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed"
            ],
            "example": "completed"
          },
          "progress": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "object",
              "properties": {
                "synced": {
                  "type": "integer",
                  "example": 128
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "running",
                    "completed",
                    "skipped",
                    "failed"
                  ],
                  "example": "completed"
                },
                "error": {
                  "type": "string",
                  "example": "rate limited by upstream"
                }
              }
            }
          },
          "error": {
            "type": "string",
            "nullable": true,
            "example": null
          },
          "callbackUrl": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "example": "https://hooks.acme.example/sync"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "startedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ],
            "example": "2026-01-15T09:30:00Z"
          },
          "completedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ],
            "example": "2026-02-01T14:20:00Z"
          },
          "origin": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "manual",
              "api",
              "connect",
              "boot",
              "schedule",
              null
            ],
            "description": "Why the job was queued: `api` (POST /v1/{vertical}/sync), `manual` (the admin console), `connect` (right after a Connect Link), `boot` (DATA_STORE_AUTO_SYNC_ON_BOOT) or `schedule` (the connection's sync schedule). Null on jobs queued before this field existed.",
            "example": "schedule"
          }
        },
        "required": [
          "id",
          "vertical",
          "connectionId",
          "platform",
          "status",
          "createdAt"
        ]
      },
      "InventoryAddressSchema": {
        "type": "object",
        "properties": {
          "line1": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "example": "2500 Market Street"
              },
              {
                "type": "null"
              }
            ]
          },
          "line2": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "example": "Suite 300"
              },
              {
                "type": "null"
              }
            ]
          },
          "city": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120,
                "example": "San Francisco"
              },
              {
                "type": "null"
              }
            ]
          },
          "region": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120,
                "example": "CA"
              },
              {
                "type": "null"
              }
            ]
          },
          "postalCode": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40,
                "example": "94114"
              },
              {
                "type": "null"
              }
            ]
          },
          "country": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO3166",
                "example": "US"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "InventoryLocationSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "loc_sfo1"
          },
          "externalId": {
            "type": "string",
            "example": "loc_sfo1"
          },
          "name": {
            "type": "string",
            "example": "SF Warehouse"
          },
          "code": {
            "example": "SFO1",
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "warehouse",
              "store",
              "virtual",
              "transit",
              "supplier",
              "unknown"
            ],
            "example": "warehouse"
          },
          "parentLocationId": {
            "description": "For hierarchy (warehouse → zone → bin). Flat-with-parent-pointer pattern.",
            "example": "loc_sfo1",
            "type": "string"
          },
          "address": {
            "type": "object",
            "properties": {
              "line1": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255,
                    "example": "2500 Market Street"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "line2": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 255,
                    "example": "Suite 300"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "city": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120,
                    "example": "San Francisco"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "region": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 120,
                    "example": "CA"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "postalCode": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 40,
                    "example": "94114"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "country": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ISO3166",
                    "example": "US"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          "isActive": {
            "type": "boolean",
            "example": true
          },
          "platform": {
            "type": "string",
            "example": "cin7"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "name",
          "type",
          "isActive",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "InventoryLocationTypeSchema": {
        "type": "string",
        "enum": [
          "warehouse",
          "store",
          "virtual",
          "transit",
          "supplier",
          "unknown"
        ]
      },
      "InventoryMoneySchema": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
            "example": 4999
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          }
        },
        "required": [
          "amount",
          "currency"
        ],
        "additionalProperties": false
      },
      "InventoryProductSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "item_wk2026"
          },
          "externalId": {
            "type": "string",
            "example": "item_wk2026"
          },
          "sku": {
            "type": "string",
            "example": "WK-2026"
          },
          "name": {
            "type": "string",
            "example": "Wireless Keyboard"
          },
          "description": {
            "example": "Bluetooth wireless keyboard, US layout.",
            "type": "string"
          },
          "upc": {
            "example": "0123456789012",
            "type": "string"
          },
          "isbn": {
            "example": "9780000000000",
            "type": "string"
          },
          "brand": {
            "example": "Keyboards Inc",
            "type": "string"
          },
          "category": {
            "example": "Peripherals",
            "type": "string"
          },
          "unitOfMeasure": {
            "example": "each",
            "type": "string",
            "enum": [
              "each",
              "kg",
              "lb",
              "litre",
              "oz",
              "metre",
              "unit",
              "unknown"
            ]
          },
          "weightGrams": {
            "example": 450,
            "type": "number"
          },
          "dimensionsCm": {
            "type": "object",
            "properties": {
              "length": {
                "example": 44,
                "type": "number"
              },
              "width": {
                "example": 13,
                "type": "number"
              },
              "height": {
                "example": 3,
                "type": "number"
              }
            },
            "additionalProperties": false
          },
          "cost": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 4999
              },
              "currency": {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ],
            "additionalProperties": false
          },
          "retailPrice": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Integer monetary amount in minor units (e.g. cents). `null` = upstream did not report; `0` = upstream reported zero; key-omitted = upstream did not supply this field.",
                "example": 4999
              },
              "currency": {
                "$ref": "#/components/schemas/ISO4217",
                "example": "USD"
              }
            },
            "required": [
              "amount",
              "currency"
            ],
            "additionalProperties": false
          },
          "isActive": {
            "type": "boolean",
            "example": true
          },
          "isTrackingEnabled": {
            "example": true,
            "type": "boolean"
          },
          "parentProductId": {
            "description": "For variants: parent product id. Master products have parentProductId: undefined.",
            "example": "item_wk2026",
            "type": "string"
          },
          "supplierIds": {
            "type": "array",
            "items": {
              "type": "string",
              "example": "sup_1042"
            }
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "platform": {
            "type": "string",
            "example": "cin7"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "sku",
          "name",
          "isActive",
          "supplierIds",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "InventoryPurchaseOrderLineSchema": {
        "type": "object",
        "properties": {
          "productId": {
            "type": "string",
            "example": "item_wk2026"
          },
          "quantityOrdered": {
            "type": "number",
            "example": 200
          },
          "quantityReceived": {
            "example": 100,
            "type": "number"
          },
          "unitCost": {
            "example": 2500,
            "type": "number"
          },
          "lineTotal": {
            "example": 500000,
            "type": "number"
          }
        },
        "required": [
          "productId",
          "quantityOrdered"
        ],
        "additionalProperties": false
      },
      "InventoryPurchaseOrderSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "po_1042"
          },
          "externalId": {
            "type": "string",
            "example": "po_1042"
          },
          "number": {
            "example": "PO-1042",
            "type": "string"
          },
          "supplierId": {
            "type": "string",
            "example": "sup_1042"
          },
          "destinationLocationId": {
            "example": "loc_sfo1",
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "sent",
              "partially_received",
              "received",
              "closed",
              "cancelled",
              "unknown"
            ],
            "example": "sent"
          },
          "currency": {
            "$ref": "#/components/schemas/ISO4217",
            "example": "USD"
          },
          "subtotalAmount": {
            "example": 500000,
            "type": "number"
          },
          "totalAmount": {
            "example": 500000,
            "type": "number"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "productId": {
                  "type": "string",
                  "example": "item_wk2026"
                },
                "quantityOrdered": {
                  "type": "number",
                  "example": 200
                },
                "quantityReceived": {
                  "example": 100,
                  "type": "number"
                },
                "unitCost": {
                  "example": 2500,
                  "type": "number"
                },
                "lineTotal": {
                  "example": 500000,
                  "type": "number"
                }
              },
              "required": [
                "productId",
                "quantityOrdered"
              ],
              "additionalProperties": false
            }
          },
          "expectedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "orderedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "receivedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "platform": {
            "type": "string",
            "example": "cin7"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "supplierId",
          "status",
          "lines",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "InventoryPurchaseOrderStatusSchema": {
        "type": "string",
        "enum": [
          "draft",
          "sent",
          "partially_received",
          "received",
          "closed",
          "cancelled",
          "unknown"
        ]
      },
      "InventoryStockAdjustmentLineSchema": {
        "type": "object",
        "properties": {
          "productId": {
            "type": "string",
            "example": "item_wk2026"
          },
          "deltaQuantity": {
            "type": "number",
            "example": -10
          },
          "countedQuantity": {
            "example": 240,
            "type": "number"
          },
          "notes": {
            "example": "sale",
            "type": "string"
          }
        },
        "required": [
          "productId",
          "deltaQuantity"
        ],
        "additionalProperties": false
      },
      "InventoryStockAdjustmentReasonSchema": {
        "type": "string",
        "enum": [
          "cycle_count",
          "damage",
          "theft",
          "lost",
          "found",
          "expiration",
          "correction",
          "other",
          "unknown"
        ]
      },
      "InventoryStockAdjustmentSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "adj_1042"
          },
          "externalId": {
            "type": "string",
            "example": "adj_1042"
          },
          "locationId": {
            "type": "string",
            "example": "loc_sfo1"
          },
          "reason": {
            "type": "string",
            "enum": [
              "cycle_count",
              "damage",
              "theft",
              "lost",
              "found",
              "expiration",
              "correction",
              "other",
              "unknown"
            ],
            "example": "correction"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "productId": {
                  "type": "string",
                  "example": "item_wk2026"
                },
                "deltaQuantity": {
                  "type": "number",
                  "example": -10
                },
                "countedQuantity": {
                  "example": 240,
                  "type": "number"
                },
                "notes": {
                  "example": "sale",
                  "type": "string"
                }
              },
              "required": [
                "productId",
                "deltaQuantity"
              ],
              "additionalProperties": false
            }
          },
          "adjustedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "adjustedBy": {
            "example": "Jane Doe",
            "type": "string"
          },
          "platform": {
            "type": "string",
            "example": "cin7"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "locationId",
          "reason",
          "lines",
          "adjustedAt",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "InventoryStockLevelSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "item_wk2026:loc_sfo1"
          },
          "externalId": {
            "example": "item_wk2026:loc_sfo1",
            "type": "string"
          },
          "productId": {
            "type": "string",
            "example": "item_wk2026"
          },
          "locationId": {
            "type": "string",
            "example": "loc_sfo1"
          },
          "quantityOnHand": {
            "type": "number",
            "example": 250
          },
          "quantityAvailable": {
            "description": "on-hand minus committed",
            "example": 240,
            "type": "number"
          },
          "quantityCommitted": {
            "description": "allocated to open orders",
            "example": 10,
            "type": "number"
          },
          "quantityIncoming": {
            "description": "expected from open POs",
            "example": 100,
            "type": "number"
          },
          "quantityOutgoing": {
            "description": "committed to fulfilment",
            "example": 10,
            "type": "number"
          },
          "reorderPoint": {
            "example": 50,
            "type": "number"
          },
          "reorderQuantity": {
            "example": 200,
            "type": "number"
          },
          "lastCountedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "lots": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "lot": {
                  "type": "string",
                  "example": "LOT-2026-01"
                },
                "quantity": {
                  "type": "number",
                  "example": 250
                },
                "expiresAt": {
                  "$ref": "#/components/schemas/ISO8601",
                  "example": "2026-02-01T14:20:00Z"
                }
              },
              "required": [
                "lot",
                "quantity"
              ],
              "additionalProperties": false
            }
          },
          "platform": {
            "type": "string",
            "example": "cin7"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "productId",
          "locationId",
          "quantityOnHand",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "InventoryStockTransferLineSchema": {
        "type": "object",
        "properties": {
          "productId": {
            "type": "string",
            "example": "item_wk2026"
          },
          "quantity": {
            "type": "number",
            "example": 50
          },
          "quantityReceived": {
            "example": 50,
            "type": "number"
          }
        },
        "required": [
          "productId",
          "quantity"
        ],
        "additionalProperties": false
      },
      "InventoryStockTransferSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "tr_1042"
          },
          "externalId": {
            "type": "string",
            "example": "tr_1042"
          },
          "number": {
            "example": "TR-1042",
            "type": "string"
          },
          "fromLocationId": {
            "type": "string",
            "example": "loc_sfo1"
          },
          "toLocationId": {
            "type": "string",
            "example": "loc_nyc1"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "in_transit",
              "completed",
              "cancelled",
              "unknown"
            ],
            "example": "in_transit"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "productId": {
                  "type": "string",
                  "example": "item_wk2026"
                },
                "quantity": {
                  "type": "number",
                  "example": 50
                },
                "quantityReceived": {
                  "example": 50,
                  "type": "number"
                }
              },
              "required": [
                "productId",
                "quantity"
              ],
              "additionalProperties": false
            }
          },
          "shippedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "receivedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "platform": {
            "type": "string",
            "example": "cin7"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "fromLocationId",
          "toLocationId",
          "status",
          "lines",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "InventoryStockTransferStatusSchema": {
        "type": "string",
        "enum": [
          "draft",
          "in_transit",
          "completed",
          "cancelled",
          "unknown"
        ]
      },
      "InventorySupplierSchema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "sup_1042"
          },
          "externalId": {
            "type": "string",
            "example": "sup_1042"
          },
          "name": {
            "type": "string",
            "example": "Keyboards Inc"
          },
          "email": {
            "example": "orders@keyboards.example",
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "phone": {
            "example": "+14155550199",
            "type": "string"
          },
          "defaultCurrency": {
            "example": "USD",
            "type": "string"
          },
          "defaultLeadTimeDays": {
            "example": 14,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "isActive": {
            "type": "boolean",
            "example": true
          },
          "platform": {
            "type": "string",
            "example": "cin7"
          },
          "metadata": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "raw": {}
        },
        "required": [
          "id",
          "externalId",
          "name",
          "isActive",
          "platform",
          "metadata"
        ],
        "additionalProperties": false
      },
      "InventoryUnitOfMeasureSchema": {
        "type": "string",
        "enum": [
          "each",
          "kg",
          "lb",
          "litre",
          "oz",
          "metre",
          "unit",
          "unknown"
        ]
      },
      "InventoryWebhookActionSchema": {
        "type": "string",
        "enum": [
          "created",
          "updated",
          "deleted",
          "received",
          "transferred",
          "adjusted",
          "restocked",
          "low_stock",
          "unknown"
        ]
      },
      "InventoryWebhookEventSchema": {
        "type": "object",
        "properties": {
          "id": {
            "example": "evt_stock_wk2026_updated",
            "type": "string"
          },
          "platform": {
            "type": "string",
            "example": "cin7"
          },
          "type": {
            "type": "string",
            "example": "stock-levels.updated"
          },
          "resourceType": {
            "type": "string",
            "enum": [
              "products",
              "stock-levels",
              "locations",
              "suppliers",
              "purchase-orders",
              "stock-transfers",
              "stock-adjustments",
              "unknown"
            ],
            "example": "stock-levels"
          },
          "action": {
            "type": "string",
            "enum": [
              "created",
              "updated",
              "deleted",
              "received",
              "transferred",
              "adjusted",
              "restocked",
              "low_stock",
              "unknown"
            ],
            "example": "updated"
          },
          "resourceId": {
            "type": "string",
            "example": "item_wk2026:loc_sfo1"
          },
          "productId": {
            "example": "item_wk2026",
            "type": "string"
          },
          "locationId": {
            "example": "loc_sfo1",
            "type": "string"
          },
          "payload": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "platform",
          "type",
          "resourceType",
          "action",
          "resourceId",
          "payload"
        ],
        "additionalProperties": false
      },
      "InventoryWebhookResourceTypeSchema": {
        "type": "string",
        "enum": [
          "products",
          "stock-levels",
          "locations",
          "suppliers",
          "purchase-orders",
          "stock-transfers",
          "stock-adjustments",
          "unknown"
        ]
      },
      "InventorySyncJob": {
        "type": "object",
        "description": "Background sync job. Created by `POST /v1/{vertical}/sync`.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "sync_1042"
          },
          "vertical": {
            "type": "string",
            "example": "accounting"
          },
          "connectionId": {
            "type": "string",
            "format": "uuid",
            "example": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90"
          },
          "platform": {
            "type": "string",
            "example": "xero"
          },
          "tenantId": {
            "type": "string",
            "nullable": true,
            "example": "acme"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed"
            ],
            "example": "completed"
          },
          "progress": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "object",
              "properties": {
                "synced": {
                  "type": "integer",
                  "example": 128
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "running",
                    "completed",
                    "skipped",
                    "failed"
                  ],
                  "example": "completed"
                },
                "error": {
                  "type": "string",
                  "example": "rate limited by upstream"
                }
              }
            }
          },
          "error": {
            "type": "string",
            "nullable": true,
            "example": null
          },
          "callbackUrl": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "example": "https://hooks.acme.example/sync"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "startedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ],
            "example": "2026-01-15T09:30:00Z"
          },
          "completedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ],
            "example": "2026-02-01T14:20:00Z"
          },
          "origin": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "manual",
              "api",
              "connect",
              "boot",
              "schedule",
              null
            ],
            "description": "Why the job was queued: `api` (POST /v1/{vertical}/sync), `manual` (the admin console), `connect` (right after a Connect Link), `boot` (DATA_STORE_AUTO_SYNC_ON_BOOT) or `schedule` (the connection's sync schedule). Null on jobs queued before this field existed.",
            "example": "schedule"
          }
        },
        "required": [
          "id",
          "vertical",
          "connectionId",
          "platform",
          "status",
          "createdAt"
        ]
      },
      "Connection": {
        "type": "object",
        "required": [
          "id",
          "vertical",
          "platform",
          "status",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90"
          },
          "vertical": {
            "$ref": "#/components/schemas/Vertical"
          },
          "platform": {
            "type": "string",
            "example": "xero"
          },
          "tenantId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The OAuth provider's tenant id (e.g. Xero org id). Distinct from `ownerTenantId`.",
            "example": "acme"
          },
          "ownerTenantId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Deployment tenant that owns this connection. Set at OAuth-callback time when a Connect Link session was used; null for connections created via admin tooling.",
            "example": "acme"
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "example": "Acme — Xero"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked"
            ],
            "example": "active"
          },
          "expiresAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ],
            "example": "2026-02-01T14:20:00Z"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-02-01T14:20:00Z"
          },
          "syncMode": {
            "type": "string",
            "enum": [
              "default",
              "custom",
              "trigger_only",
              "once"
            ],
            "description": "How often the connection's data is re-synced: `default` (every deployment interval, the `data_store.sync.default_interval_minutes` runtime setting), `custom` (every `syncIntervalMinutes`), `trigger_only` (only when a sync is requested — never automatically, not even when connected) or `once` (one automatic sync when connected, then only on request).",
            "example": "default"
          },
          "syncIntervalMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 15,
            "maximum": 43200,
            "description": "Minutes between syncs for a `custom` schedule; null for every other mode.",
            "example": null
          }
        }
      },
      "AdminConnection": {
        "description": "A connection as the operator routes (`/admin/connections*`) return it: `Connection` plus the state of its sync schedule.",
        "allOf": [
          {
            "$ref": "#/components/schemas/Connection"
          },
          {
            "type": "object",
            "required": [
              "sync"
            ],
            "properties": {
              "sync": {
                "description": "The sync schedule as the scheduler sees it. Null in `passthrough` mode, where nothing syncs — and on the reply to a write whose sync state could not be read afterwards (the write itself succeeded).",
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ConnectionSyncState"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          }
        ]
      },
      "ConnectionSyncState": {
        "type": "object",
        "description": "A connection's sync schedule and history, computed exactly as the sync scheduler computes it. Times are epoch milliseconds.",
        "required": [
          "mode",
          "intervalMinutes",
          "effectiveIntervalMinutes",
          "defaultIntervalMinutes",
          "lastSyncedAt",
          "lastAttemptAt",
          "lastStatus",
          "consecutiveFailures",
          "active",
          "nextSyncAt",
          "pausedReason"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "default",
              "custom",
              "trigger_only",
              "once"
            ],
            "example": "default"
          },
          "intervalMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The connection's own interval; null unless `mode` is `custom`.",
            "example": null
          },
          "effectiveIntervalMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The interval that applies: the custom one, or the deployment's for `default`. Null for modes that never repeat (`trigger_only`, `once`).",
            "example": 360
          },
          "defaultIntervalMinutes": {
            "type": "integer",
            "description": "The deployment interval (`data_store.sync.default_interval_minutes`), so a console can label the Default choice.",
            "example": 360
          },
          "lastSyncedAt": {
            "type": [
              "integer",
              "null"
            ],
            "description": "When the newest completed sync finished. Null when none has.",
            "example": 1790000000000
          },
          "lastAttemptAt": {
            "type": [
              "integer",
              "null"
            ],
            "description": "When the newest finished sync, completed or failed, finished.",
            "example": 1790000000000
          },
          "lastStatus": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "completed",
              "failed",
              null
            ],
            "description": "That sync's outcome.",
            "example": "completed"
          },
          "consecutiveFailures": {
            "type": "integer",
            "minimum": 0,
            "description": "Failed syncs since the newest completed one. A failed sync is retried after 15 minutes, doubling per failure, never later than the interval.",
            "example": 0
          },
          "active": {
            "type": "boolean",
            "description": "A sync is pending or running now.",
            "example": false
          },
          "nextSyncAt": {
            "type": [
              "integer",
              "null"
            ],
            "description": "When the scheduler will next enqueue a sync. Null when it never will on its own right now: trigger only, a spent one-time sync, a sync in flight, or paused.",
            "example": 1790021600000
          },
          "pausedReason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "needs_reauthorization",
              "platform_error",
              null
            ],
            "description": "Why an automatic schedule is on hold: `needs_reauthorization` (the customer must re-authorize) or `platform_error` (the operator must fix the platform's OAuth client). Null when it is not.",
            "example": null
          }
        }
      },
      "SyncSchedule": {
        "type": "object",
        "required": [
          "mode"
        ],
        "additionalProperties": false,
        "description": "A connection's sync schedule. `intervalMinutes` belongs to `custom` and only to `custom`: it is required there and refused with any other mode.",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "default",
              "custom",
              "trigger_only",
              "once"
            ],
            "description": "`default` — every deployment interval. `custom` — every `intervalMinutes`. `trigger_only` — never automatically; only the admin \"Sync now\" or `POST /v1/{vertical}/sync`. `once` — one automatic sync when connected, then only on request.",
            "example": "custom"
          },
          "intervalMinutes": {
            "type": "integer",
            "minimum": 15,
            "maximum": 43200,
            "description": "Minutes between syncs, 15 minutes to 30 days. Required with `custom`; refused with any other mode.",
            "example": 60
          }
        }
      },
      "Customer": {
        "type": "object",
        "required": [
          "id",
          "tenantId",
          "email",
          "createdAt",
          "updatedAt"
        ],
        "description": "External customer record owned by your tenant. Connections completed via Connect Link are joined back to this record so you can list a customer's integrations.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "cus_4Qm2Xa9Lr"
          },
          "tenantId": {
            "type": "string",
            "description": "Set automatically from the calling API key — body-supplied tenantId is ignored.",
            "example": "acme"
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "jane.doe@acme.example"
          },
          "displayName": {
            "type": [
              "string",
              "null"
            ],
            "example": "Jane Doe"
          },
          "externalReference": {
            "type": [
              "string",
              "null"
            ],
            "description": "Free-form pointer back to your own system (CRM ID, billing ID, etc.).",
            "example": "acme-industries"
          },
          "pii": {
            "description": "Decrypted PII. Only present when the request used `?include_pii=true` AND the API key has the `customers:read_pii` scope.",
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "firstName": {
                "type": "string",
                "example": "Jane"
              },
              "lastName": {
                "type": "string",
                "example": "Doe"
              },
              "personalIdNumber": {
                "type": "string",
                "example": "000-00-0000"
              },
              "phone": {
                "$ref": "#/components/schemas/E164"
              },
              "address": {
                "type": "object",
                "properties": {
                  "line1": {
                    "type": "string",
                    "example": "2500 Market Street"
                  },
                  "line2": {
                    "type": "string",
                    "example": "Suite 300"
                  },
                  "city": {
                    "type": "string",
                    "example": "San Francisco"
                  },
                  "region": {
                    "type": "string",
                    "example": "CA"
                  },
                  "postalCode": {
                    "type": "string",
                    "example": "94114"
                  },
                  "country": {
                    "$ref": "#/components/schemas/ISO3166",
                    "example": "US"
                  }
                }
              }
            }
          },
          "createdAt": {
            "type": "integer",
            "description": "Epoch ms.",
            "example": 1768469400000
          },
          "updatedAt": {
            "type": "integer",
            "description": "Epoch ms.",
            "example": 1769955600000
          }
        }
      },
      "ConnectLink": {
        "type": "object",
        "required": [
          "id",
          "token",
          "url",
          "expiresAt"
        ],
        "description": "Hosted Connect Link session. Send the `url` to the customer; once they authorise, a connection is created and tagged back to this customer.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "cl_8f3a2b9c4d"
          },
          "token": {
            "type": "string",
            "description": "URL-safe token embedded in `url`. Treat as secret.",
            "example": "cl_8f3a2b9c4d"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "example": "https://connect.northwind.example/cl_8f3a2b9c4d"
          },
          "label": {
            "type": "string",
            "example": "Acme onboarding"
          },
          "endUserId": {
            "type": "string",
            "format": "uuid",
            "example": "cus_4Qm2Xa9Lr"
          },
          "allowedVerticals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Vertical"
            },
            "example": [
              "accounting"
            ]
          },
          "allowedPlatforms": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "vertical",
                "slug"
              ],
              "properties": {
                "vertical": {
                  "$ref": "#/components/schemas/Vertical"
                },
                "slug": {
                  "type": "string",
                  "description": "Adapter slug. See the `PlatformSlug` schema for the full list.",
                  "example": "xero"
                }
              }
            }
          },
          "redirectUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "example": "https://app.acme.example/integrations/done"
          },
          "expiresAt": {
            "type": "integer",
            "description": "Epoch ms.",
            "example": 1769955600000
          },
          "consumedAt": {
            "type": [
              "integer",
              "null"
            ],
            "example": 1769955600000
          },
          "connectionId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "example": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "consumed",
              "expired"
            ],
            "example": "active"
          }
        }
      },
      "ApiKey": {
        "type": "object",
        "required": [
          "id",
          "tenantId",
          "prefix",
          "scopes",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "key_1042"
          },
          "tenantId": {
            "type": "string",
            "example": "acme"
          },
          "prefix": {
            "type": "string",
            "description": "First 12 chars of the plaintext, used for indexed lookup. Display-only — not a credential.",
            "example": "osk_acme_8f3a"
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "example": "Production key"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "customers:read",
              "connections:read"
            ]
          },
          "createdAt": {
            "type": "integer",
            "example": 1768469400000
          },
          "lastUsedAt": {
            "type": [
              "integer",
              "null"
            ],
            "example": 1769955600000
          },
          "revokedAt": {
            "type": [
              "integer",
              "null"
            ],
            "example": null
          }
        }
      },
      "ApiKeyMint": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ApiKey"
          },
          {
            "type": "object",
            "required": [
              "plaintext"
            ],
            "properties": {
              "plaintext": {
                "type": "string",
                "description": "The bearer token (`osk_…`). Returned exactly once at mint time and never refetchable — store it now.",
                "example": "osk_acme_8f3a2b9c4d5e6f7a8b9c0d1e2f3a4b5c"
              }
            }
          }
        ]
      },
      "WebhookSubscription": {
        "type": "object",
        "required": [
          "id",
          "tenantId",
          "url",
          "events",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "whs_1042"
          },
          "tenantId": {
            "type": "string",
            "example": "acme"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "example": "https://hooks.acme.example/opensteward"
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "description": "Human-friendly name for the subscription, or null when it has none. Purely descriptive — nothing routes on it.",
            "example": "Billing service"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "`*` for all, exact event names, or prefix wildcards like `customer.*`.",
            "example": [
              "customer.created"
            ]
          },
          "createdAt": {
            "type": "integer",
            "example": 1768469400000
          },
          "lastFiredAt": {
            "type": [
              "integer",
              "null"
            ],
            "example": 1769955600000
          },
          "lastStatus": {
            "type": [
              "integer",
              "null"
            ],
            "description": "HTTP status code from the most recent delivery, or null if delivery failed at the network layer.",
            "example": 200
          },
          "lastError": {
            "type": [
              "string",
              "null"
            ],
            "example": null
          },
          "format": {
            "type": "string",
            "enum": [
              "opensteward",
              "slack",
              "teams",
              "flat"
            ],
            "description": "Payload shape POSTed to this endpoint. `opensteward` is the signed event envelope, `slack` renders Slack blocks, `teams` renders an Adaptive Card for a Teams Workflows URL, and `flat` is a one-level object with dotted keys.",
            "example": "opensteward"
          },
          "headerNames": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Names of the custom headers sent with each delivery. Values are stored encrypted and are never returned by the API.",
            "example": [
              "X-Api-Key"
            ]
          }
        }
      },
      "WebhookTestResult": {
        "type": "object",
        "required": [
          "id",
          "ok",
          "status",
          "format"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "whs_1042"
          },
          "ok": {
            "type": "boolean",
            "description": "True when the receiver answered 2xx. False means the destination rejected the payload or could not be reached.",
            "example": true
          },
          "status": {
            "type": [
              "integer",
              "null"
            ],
            "description": "HTTP status the receiver returned, or null when the request never completed.",
            "example": 200
          },
          "format": {
            "type": "string",
            "enum": [
              "opensteward",
              "slack",
              "teams",
              "flat"
            ],
            "description": "Format the test payload was rendered in.",
            "example": "slack"
          },
          "sentBody": {
            "type": "string",
            "description": "The exact bytes sent, so the payload can be inspected. Synthetic, and carries no secret.",
            "example": "{\"text\":\"Test event from OpenSteward\"}"
          },
          "error": {
            "type": "string",
            "description": "Why the request never completed, when it did not.",
            "example": "getaddrinfo ENOTFOUND hooks.example"
          }
        }
      },
      "WebhookSubscriptionWithSecret": {
        "allOf": [
          {
            "$ref": "#/components/schemas/WebhookSubscription"
          },
          {
            "type": "object",
            "required": [
              "secret"
            ],
            "properties": {
              "secret": {
                "type": "string",
                "description": "Shared secret (hex). Returned exactly once on create — used by the receiver to HMAC-verify deliveries.",
                "example": "whsec_8f3a2b9c4d5e6f"
              }
            }
          }
        ]
      },
      "WebhookDelivery": {
        "type": "object",
        "required": [
          "id",
          "subscriptionId",
          "eventId",
          "eventType",
          "url",
          "status",
          "attempts",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "whd_8f3a2b9c4d"
          },
          "subscriptionId": {
            "type": "string",
            "format": "uuid",
            "example": "whs_1042"
          },
          "eventId": {
            "type": "string",
            "format": "uuid",
            "description": "Mirrored in the X-OI-Event-Id header so receivers can dedupe across retries.",
            "example": "evt_8f3a2b9c4d"
          },
          "eventType": {
            "type": "string",
            "example": "customer.created"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "example": "https://hooks.acme.example/opensteward"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "delivered",
              "dead"
            ],
            "example": "delivered"
          },
          "attempts": {
            "type": "integer",
            "example": 1
          },
          "nextAttemptAt": {
            "type": "integer",
            "example": 1769955600000
          },
          "deliveredAt": {
            "type": [
              "integer",
              "null"
            ],
            "example": 1769955600000
          },
          "lastStatus": {
            "type": [
              "integer",
              "null"
            ],
            "example": 200
          },
          "lastError": {
            "type": [
              "string",
              "null"
            ],
            "example": null
          },
          "createdAt": {
            "type": "integer",
            "example": 1768469400000
          }
        }
      },
      "Platform": {
        "type": "object",
        "required": [
          "slug",
          "vertical",
          "name"
        ],
        "description": "A platform that the integration-server can connect to. The `auth_type` field tells you which `/auth/{vertical}/{platform}/connect` variant to use: `oauth2` / `oauth2_cc` → GET (browser redirect); `api_key` / `basic` / `session` / `local` → POST (JSON body with credentials).",
        "properties": {
          "slug": {
            "type": "string",
            "description": "Stable URL-safe identifier (e.g. `fortnox`, `shopify`, `fedex`). Used in path params throughout the API.",
            "example": "xero"
          },
          "vertical": {
            "$ref": "#/components/schemas/Vertical"
          },
          "name": {
            "type": "string",
            "description": "Display name (e.g. `Fortnox`, `Shopify`).",
            "example": "Xero"
          },
          "description": {
            "type": "string",
            "example": "Cloud accounting for small business."
          },
          "website": {
            "type": "string",
            "format": "uri",
            "example": "https://www.xero.com"
          },
          "category": {
            "type": "string",
            "example": "accounting"
          },
          "auth_type": {
            "type": "string",
            "enum": [
              "oauth2",
              "oauth2_cc",
              "api_key",
              "basic",
              "session",
              "local"
            ],
            "description": "Authentication mechanism this platform requires. Determines whether to use GET or POST on `/auth/{vertical}/{platform}/connect`. Values: `oauth2` (standard authorization-code OAuth, GET), `oauth2_cc` (OAuth client-credentials, GET), `api_key` (long-lived API key, POST), `basic` (HTTP Basic, POST), `session` (cookie-based session, POST), `local` (no upstream — fixture/test platforms).",
            "example": "oauth2"
          },
          "auth_label": {
            "type": "string",
            "description": "Human-readable label for the auth mechanism — shown on the admin /platforms page (`OAuth 2.0`, `API Key`, etc.).",
            "example": "OAuth 2.0"
          },
          "hq_country": {
            "$ref": "#/components/schemas/ISO3166"
          },
          "docs_url": {
            "type": "string",
            "format": "uri",
            "example": "https://developer.xero.com"
          },
          "pricing_url": {
            "type": "string",
            "format": "uri",
            "example": "https://www.xero.com/pricing"
          },
          "primary_color": {
            "$ref": "#/components/schemas/HexColor"
          },
          "founded_year": {
            "type": "integer",
            "example": 2006
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether this platform is enabled on this deployment. When `false`, the platform ships with the binary but the operator has not configured / activated it — `/auth/{vertical}/{platform}/connect` will return 403/404. When `true`, end-user connections can be initiated. Resolved at request time from the deployment's AdapterSettingsStore.",
            "example": true
          },
          "unsupported": {
            "type": "object",
            "description": "Present when the platform is listed and viewable but cannot be enabled or connected — e.g. its OAuth client must be registered inside each customer's own instance, or no public API exists. When set, `/auth/{vertical}/{platform}/connect` and `/admin/platforms/{vertical}/{slug}/enable` refuse with `400 PLATFORM_UNSUPPORTED` carrying this same `reason`/`issueUrl`; existing connections keep working. Absent when the platform is fully supported.",
            "required": [
              "reason"
            ],
            "properties": {
              "reason": {
                "type": "string",
                "description": "Why the platform cannot be connected today.",
                "example": "OAuth client must be registered inside each customer's own instance."
              },
              "issueUrl": {
                "type": "string",
                "format": "uri",
                "description": "Tracking issue for adding support, when one exists.",
                "example": "https://example.com/issues/123"
              }
            }
          }
        }
      },
      "AdapterRow": {
        "type": "object",
        "required": [
          "vertical",
          "slug",
          "enabled",
          "hasConfig"
        ],
        "properties": {
          "vertical": {
            "type": "string",
            "example": "accounting"
          },
          "slug": {
            "type": "string",
            "example": "xero"
          },
          "enabled": {
            "type": "boolean",
            "example": true
          },
          "hasConfig": {
            "type": "boolean",
            "example": true
          },
          "unsupported": {
            "type": "object",
            "description": "Present when the platform is listed and viewable but cannot be enabled or connected. See `Platform.unsupported`. Absent when the platform is fully supported.",
            "required": [
              "reason"
            ],
            "properties": {
              "reason": {
                "type": "string",
                "example": "OAuth client must be registered inside each customer's own instance."
              },
              "issueUrl": {
                "type": "string",
                "format": "uri",
                "example": "https://example.com/issues/123"
              }
            }
          }
        }
      },
      "SyncJob": {
        "type": "object",
        "description": "Background sync job. Created by `POST /v1/{vertical}/sync`.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "sync_1042"
          },
          "vertical": {
            "type": "string",
            "example": "accounting"
          },
          "connectionId": {
            "type": "string",
            "format": "uuid",
            "example": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90"
          },
          "platform": {
            "type": "string",
            "example": "xero"
          },
          "tenantId": {
            "type": [
              "string",
              "null"
            ],
            "example": "acme"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "running",
              "completed",
              "failed"
            ],
            "example": "completed"
          },
          "progress": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": "object",
              "properties": {
                "synced": {
                  "type": "integer",
                  "example": 128
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "running",
                    "completed",
                    "skipped",
                    "failed"
                  ],
                  "example": "completed"
                },
                "error": {
                  "type": "string",
                  "example": "rate limited by upstream"
                }
              }
            }
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "example": null
          },
          "callbackUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "example": "https://hooks.acme.example/sync"
          },
          "createdAt": {
            "$ref": "#/components/schemas/ISO8601",
            "example": "2026-01-15T09:30:00Z"
          },
          "startedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ],
            "example": "2026-01-15T09:30:00Z"
          },
          "completedAt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ISO8601"
              },
              {
                "type": "null"
              }
            ],
            "example": "2026-02-01T14:20:00Z"
          }
        },
        "required": [
          "id",
          "vertical",
          "connectionId",
          "platform",
          "status",
          "createdAt"
        ]
      },
      "WebhookEvent": {
        "type": "object",
        "required": [
          "platform",
          "type",
          "resourceId"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Upstream event ID, when provided.",
            "example": "whs_1042"
          },
          "platform": {
            "type": "string",
            "description": "Adapter slug (e.g. `fortnox`).",
            "example": "xero"
          },
          "type": {
            "type": "string",
            "description": "Dot-notation `resource.action`, e.g. `invoice.created`.",
            "example": "customer.created"
          },
          "resourceId": {
            "type": "string",
            "description": "Upstream resource identifier.",
            "example": "cus_4Qm2Xa9Lr"
          },
          "resourceType": {
            "type": "string",
            "description": "Canonical resource category per vertical.",
            "example": "customer"
          },
          "action": {
            "type": "string",
            "enum": [
              "created",
              "updated",
              "deleted",
              "unknown"
            ],
            "example": "created"
          },
          "tenantId": {
            "type": [
              "string",
              "null"
            ],
            "example": "acme"
          },
          "connectionId": {
            "type": "string",
            "format": "uuid",
            "description": "Populated during fan-out when the (vertical, platform, tenantId) tuple matches a stored connection.",
            "example": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90"
          },
          "payload": {
            "type": "object",
            "additionalProperties": true,
            "description": "Verbatim upstream payload — not filtered."
          }
        }
      },
      "WebhookForwardEnvelope": {
        "type": "object",
        "required": [
          "events"
        ],
        "description": "Body POSTed to `webhooks.callbackUrl` when the unified service forwards normalised events.",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEvent"
            },
            "example": [
              {
                "id": "whs_1042",
                "platform": "xero",
                "type": "customer.created",
                "resourceId": "cus_4Qm2Xa9Lr",
                "resourceType": "customer",
                "action": "created",
                "tenantId": "acme",
                "connectionId": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90"
              }
            ]
          }
        }
      },
      "InboundEvent": {
        "type": "object",
        "required": [
          "seq",
          "id",
          "vertical",
          "platform",
          "eventType",
          "resourceType",
          "action",
          "resourceId",
          "receivedAt"
        ],
        "properties": {
          "seq": {
            "type": "integer",
            "format": "int64",
            "description": "Monotonic per-tenant cursor. Page with `?after_seq=<seq>`.",
            "example": 1
          },
          "id": {
            "type": "string",
            "description": "Event id.",
            "example": "evt_8sd3k2"
          },
          "tenantId": {
            "type": [
              "string",
              "null"
            ],
            "example": "acme"
          },
          "vertical": {
            "$ref": "#/components/schemas/Vertical"
          },
          "platform": {
            "type": "string",
            "description": "Adapter slug.",
            "example": "xero"
          },
          "connectionId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The connection the event was fanned out to, when resolved.",
            "example": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90"
          },
          "eventType": {
            "type": "string",
            "description": "Dot-notation `resource.action`.",
            "example": "invoice.created"
          },
          "resourceType": {
            "type": "string",
            "example": "invoices"
          },
          "action": {
            "type": "string",
            "enum": [
              "created",
              "updated",
              "deleted",
              "unknown"
            ],
            "example": "created"
          },
          "resourceId": {
            "type": "string",
            "example": "inv_1042"
          },
          "receivedAt": {
            "type": "integer",
            "format": "int64",
            "description": "Epoch milliseconds the event was verified and stored.",
            "example": 1767225600000
          },
          "payload": {
            "type": "object",
            "additionalProperties": true,
            "description": "Verbatim upstream payload — not filtered."
          }
        }
      },
      "SandboxConnection": {
        "type": "object",
        "required": [
          "id",
          "vertical",
          "platform",
          "label",
          "tenantId"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Derived from (tenant, vertical). Stable for a tenant, and the value every sandbox request passes as `connection_id`.",
            "example": "ed57733f-b65b-56fc-93a9-5654d3183944"
          },
          "vertical": {
            "$ref": "#/components/schemas/Vertical"
          },
          "platform": {
            "type": "string",
            "enum": [
              "sandbox"
            ],
            "description": "Always `sandbox` — no real adapter is constructed on this path.",
            "example": "sandbox"
          },
          "label": {
            "type": "string",
            "example": "accounting sandbox"
          },
          "tenantId": {
            "type": "string",
            "example": "default"
          }
        }
      },
      "Capabilities": {
        "type": "object",
        "required": [
          "verticals"
        ],
        "description": "What this deployment serves to your credential. Carries no license details.",
        "properties": {
          "verticals": {
            "type": "array",
            "description": "Verticals whose `/v1/{vertical}/*` routes answer here, sorted: every vertical the server runs that its license includes. Any other vertical answers 403 `LICENSE_FEATURE_NOT_ENTITLED`.",
            "items": {
              "$ref": "#/components/schemas/Vertical"
            },
            "example": [
              "accounting",
              "crm",
              "payments"
            ]
          }
        }
      },
      "CalendarDate": {
        "type": "string",
        "format": "date",
        "description": "Calendar date (`YYYY-MM-DD`) with no time component, because the source has none. Fields typed as a date-or-date-time carry this form when the platform states a date rather than an instant — Xero reports an invoice date as `2026-09-01`, and rendering that as `2026-09-01T00:00:00Z` invents a time and a zone, which shows the previous day to any consumer east of UTC.",
        "example": "2026-02-01"
      },
      "ISO8601": {
        "type": "string",
        "format": "date-time",
        "description": "ISO 8601 date-time with timezone offset (e.g. `2026-05-24T22:00:00.000Z`). Adapters normalize all timestamps to this format at the edge.",
        "example": "2026-01-15T09:30:00Z"
      },
      "ISO3166": {
        "type": "string",
        "pattern": "^[A-Z]{2}$",
        "enum": [
          "AD",
          "AE",
          "AF",
          "AG",
          "AI",
          "AL",
          "AM",
          "AO",
          "AQ",
          "AR",
          "AS",
          "AT",
          "AU",
          "AW",
          "AX",
          "AZ",
          "BA",
          "BB",
          "BD",
          "BE",
          "BF",
          "BG",
          "BH",
          "BI",
          "BJ",
          "BL",
          "BM",
          "BN",
          "BO",
          "BQ",
          "BR",
          "BS",
          "BT",
          "BV",
          "BW",
          "BY",
          "BZ",
          "CA",
          "CC",
          "CD",
          "CF",
          "CG",
          "CH",
          "CI",
          "CK",
          "CL",
          "CM",
          "CN",
          "CO",
          "CR",
          "CU",
          "CV",
          "CW",
          "CX",
          "CY",
          "CZ",
          "DE",
          "DJ",
          "DK",
          "DM",
          "DO",
          "DZ",
          "EC",
          "EE",
          "EG",
          "EH",
          "ER",
          "ES",
          "ET",
          "FI",
          "FJ",
          "FK",
          "FM",
          "FO",
          "FR",
          "GA",
          "GB",
          "GD",
          "GE",
          "GF",
          "GG",
          "GH",
          "GI",
          "GL",
          "GM",
          "GN",
          "GP",
          "GQ",
          "GR",
          "GS",
          "GT",
          "GU",
          "GW",
          "GY",
          "HK",
          "HM",
          "HN",
          "HR",
          "HT",
          "HU",
          "ID",
          "IE",
          "IL",
          "IM",
          "IN",
          "IO",
          "IQ",
          "IR",
          "IS",
          "IT",
          "JE",
          "JM",
          "JO",
          "JP",
          "KE",
          "KG",
          "KH",
          "KI",
          "KM",
          "KN",
          "KP",
          "KR",
          "KW",
          "KY",
          "KZ",
          "LA",
          "LB",
          "LC",
          "LI",
          "LK",
          "LR",
          "LS",
          "LT",
          "LU",
          "LV",
          "LY",
          "MA",
          "MC",
          "MD",
          "ME",
          "MF",
          "MG",
          "MH",
          "MK",
          "ML",
          "MM",
          "MN",
          "MO",
          "MP",
          "MQ",
          "MR",
          "MS",
          "MT",
          "MU",
          "MV",
          "MW",
          "MX",
          "MY",
          "MZ",
          "NA",
          "NC",
          "NE",
          "NF",
          "NG",
          "NI",
          "NL",
          "NO",
          "NP",
          "NR",
          "NU",
          "NZ",
          "OM",
          "PA",
          "PE",
          "PF",
          "PG",
          "PH",
          "PK",
          "PL",
          "PM",
          "PN",
          "PR",
          "PS",
          "PT",
          "PW",
          "PY",
          "QA",
          "RE",
          "RO",
          "RS",
          "RU",
          "RW",
          "SA",
          "SB",
          "SC",
          "SD",
          "SE",
          "SG",
          "SH",
          "SI",
          "SJ",
          "SK",
          "SL",
          "SM",
          "SN",
          "SO",
          "SR",
          "SS",
          "ST",
          "SV",
          "SX",
          "SY",
          "SZ",
          "TC",
          "TD",
          "TF",
          "TG",
          "TH",
          "TJ",
          "TK",
          "TL",
          "TM",
          "TN",
          "TO",
          "TR",
          "TT",
          "TV",
          "TW",
          "TZ",
          "UA",
          "UG",
          "UM",
          "US",
          "UY",
          "UZ",
          "VA",
          "VC",
          "VE",
          "VG",
          "VI",
          "VN",
          "VU",
          "WF",
          "WS",
          "YE",
          "YT",
          "ZA",
          "ZM",
          "ZW"
        ],
        "description": "ISO 3166-1 alpha-2 country code (e.g. `US`, `GB`, `JP`).",
        "example": "US"
      },
      "ISO4217": {
        "type": "string",
        "pattern": "^[A-Z]{3}$",
        "enum": [
          "AED",
          "AFN",
          "ALL",
          "AMD",
          "ANG",
          "AOA",
          "ARS",
          "AUD",
          "AWG",
          "AZN",
          "BAM",
          "BBD",
          "BDT",
          "BGN",
          "BHD",
          "BIF",
          "BMD",
          "BND",
          "BOB",
          "BOV",
          "BRL",
          "BSD",
          "BTN",
          "BWP",
          "BYN",
          "BZD",
          "CAD",
          "CDF",
          "CHE",
          "CHF",
          "CHW",
          "CLF",
          "CLP",
          "CNY",
          "COP",
          "COU",
          "CRC",
          "CUC",
          "CUP",
          "CVE",
          "CZK",
          "DJF",
          "DKK",
          "DOP",
          "DZD",
          "EGP",
          "ERN",
          "ETB",
          "EUR",
          "FJD",
          "FKP",
          "GBP",
          "GEL",
          "GHS",
          "GIP",
          "GMD",
          "GNF",
          "GTQ",
          "GYD",
          "HKD",
          "HNL",
          "HTG",
          "HUF",
          "IDR",
          "ILS",
          "INR",
          "IQD",
          "IRR",
          "ISK",
          "JMD",
          "JOD",
          "JPY",
          "KES",
          "KGS",
          "KHR",
          "KMF",
          "KPW",
          "KRW",
          "KWD",
          "KYD",
          "KZT",
          "LAK",
          "LBP",
          "LKR",
          "LRD",
          "LSL",
          "LYD",
          "MAD",
          "MDL",
          "MGA",
          "MKD",
          "MMK",
          "MNT",
          "MOP",
          "MRU",
          "MUR",
          "MVR",
          "MWK",
          "MXN",
          "MXV",
          "MYR",
          "MZN",
          "NAD",
          "NGN",
          "NIO",
          "NOK",
          "NPR",
          "NZD",
          "OMR",
          "PAB",
          "PEN",
          "PGK",
          "PHP",
          "PKR",
          "PLN",
          "PYG",
          "QAR",
          "RON",
          "RSD",
          "RUB",
          "RWF",
          "SAR",
          "SBD",
          "SCR",
          "SDG",
          "SEK",
          "SGD",
          "SHP",
          "SLE",
          "SOS",
          "SRD",
          "SSP",
          "STN",
          "SVC",
          "SYP",
          "SZL",
          "THB",
          "TJS",
          "TMT",
          "TND",
          "TOP",
          "TRY",
          "TTD",
          "TWD",
          "TZS",
          "UAH",
          "UGX",
          "USD",
          "USN",
          "UYI",
          "UYU",
          "UYW",
          "UZS",
          "VED",
          "VES",
          "VND",
          "VUV",
          "WST",
          "XAF",
          "XAG",
          "XAU",
          "XBA",
          "XBB",
          "XBC",
          "XBD",
          "XCD",
          "XDR",
          "XOF",
          "XPD",
          "XPF",
          "XPT",
          "XSU",
          "XTS",
          "XUA",
          "XXX",
          "YER",
          "ZAR",
          "ZMW",
          "ZWL"
        ],
        "description": "ISO 4217 three-letter currency code (e.g. `USD`, `EUR`, `JPY`).",
        "example": "USD"
      },
      "HexColor": {
        "type": "string",
        "pattern": "^#[0-9A-Fa-f]{6}$",
        "description": "CSS3 six-digit hex RGB colour (e.g. `#FF7A59`).",
        "example": "#1D4ED8"
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Bad Request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "validation": {
                "summary": "Schema validation failure",
                "value": {
                  "code": "VALIDATION",
                  "description": "Request body failed validation: `email` must be a valid email address.",
                  "type": "validation"
                }
              },
              "connectionIdRequired": {
                "summary": "Missing connection_id",
                "value": {
                  "code": "CONNECTION_ID_REQUIRED",
                  "description": "The `connection_id` query parameter is required.",
                  "type": "validation"
                }
              },
              "connectionIdInvalid": {
                "summary": "Malformed connection_id",
                "value": {
                  "code": "CONNECTION_ID_INVALID",
                  "description": "`connection_id` is not a valid UUID.",
                  "type": "validation"
                }
              }
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Unauthorized.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "unauthenticated": {
                "summary": "Missing / invalid API key",
                "value": {
                  "code": "UNAUTHENTICATED",
                  "description": "Missing or invalid API key. Provide a Bearer token in the Authorization header.",
                  "type": "auth"
                }
              }
            }
          }
        }
      },
      "NotFound": {
        "description": "Not Found.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "connectionNotFound": {
                "summary": "Unknown connection",
                "value": {
                  "code": "CONNECTION_NOT_FOUND",
                  "description": "No connection found for the given id.",
                  "type": "not_found"
                }
              },
              "customerNotFound": {
                "summary": "Unknown customer",
                "value": {
                  "code": "CUSTOMER_NOT_FOUND",
                  "description": "No customer found for the given id.",
                  "type": "not_found"
                }
              }
            }
          }
        }
      },
      "Forbidden": {
        "description": "Forbidden.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "insufficientScope": {
                "summary": "API key lacks the required scope",
                "value": {
                  "code": "INSUFFICIENT_SCOPE",
                  "description": "This API key is missing required scope 'customers:read'.",
                  "type": "auth"
                }
              },
              "licenseFeatureNotEntitled": {
                "summary": "Vertical (or MCP) not included in the license",
                "value": {
                  "code": "LICENSE_FEATURE_NOT_ENTITLED",
                  "description": "This deployment's license does not include 'vertical:accounting'. See https://opensteward.dev/license",
                  "type": "license"
                }
              },
              "licenseLimitExceeded": {
                "summary": "Connection beyond the license limit (writes only)",
                "value": {
                  "code": "LICENSE_LIMIT_EXCEEDED",
                  "description": "Connection 1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90 is read-only: this deployment has 6 connections and its license allows 5. Reads and syncs still work; nothing was deleted. To free a slot: export a connection's data, delete it, then reconnect. For more connections: https://opensteward.dev/license",
                  "type": "license"
                }
              },
              "licenseExpired": {
                "summary": "License lapsed past its 30-day grace period (not returned by this release)",
                "value": {
                  "code": "LICENSE_EXPIRED",
                  "description": "Renew at https://opensteward.dev/license",
                  "type": "license"
                }
              }
            }
          }
        }
      },
      "NotImplemented": {
        "description": "Not Implemented.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "webhookHandlerNotFound": {
                "summary": "No verifier wired for this (vertical, platform)",
                "value": {
                  "code": "WEBHOOK_HANDLER_NOT_FOUND",
                  "description": "No webhook handler for logistics/no-such-platform.",
                  "type": "not_implemented"
                }
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "osk_…",
        "description": "Tenant-scoped developer API key. Send as `Authorization: Bearer <key>`.\n\nMint a key via the admin UI (Admin → API keys → Mint key) or the CLI:\n`pnpm --filter integration-server mint-api-key --tenant <id> [--label <label>]`.\n\nEach key carries a list of scopes. **Vertical access uses a two-axis model**:\n- *Touch axis* (always required): `*`, `vertical:<v>`, `vertical:read`, or `vertical:write` controls **which** verticals the key can see.\n- *Verb axis* (only on POST/PATCH/PUT/DELETE): `*` or `vertical:write` controls **whether** the key can mutate vertical data.\n\nCustomers / connections / connect-links use a flat `:read` / `:write` split. Common scopes:\n- `*` — full access.\n- `customers:read`, `customers:write`, `customers:read_pii` — customer management + PII reveal.\n- `connections:read`, `connections:write` — list / mutate connections.\n- `connect-links:write` — spawn hosted Connect Link sessions.\n- `vertical:read` — GET on every `/v1/{vertical}/*`.\n- `vertical:write` — required for any non-GET on `/v1/{vertical}/*`.\n- `vertical:accounting` / `vertical:crm` / `vertical:ecommerce` / `vertical:logistics` / `vertical:payments` / `vertical:docsign` / `vertical:projects` / `vertical:customer-support` / `vertical:inventory` — touch-axis access to one specific vertical.\n\nSee [/guides/dev-api.md §3](https://docs.opensteward.dev/dev-api/#3-scopes) for the full scope reference, examples, and the \"safe default\" mint preset (everything except `vertical:write`).\n\nA request without the required scope returns `403 INSUFFICIENT_SCOPE`."
      },
      "OAuth2Bearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "OIDC bearer token issued by an identity provider the operator has registered, accepted on the same `/v1/*` surface as `ApiKeyAuth`. Send as `Authorization: Bearer <jwt>`.\n\nOff unless the operator has enabled it (`auth.dev_oauth_enabled`) and registered an issuer under Admin → OAuth clients. When it is off, a JWT is refused with `403 OAUTH_DISABLED`; when API keys are off, an `osk_` key is refused with `403 API_KEYS_DISABLED`.\n\nGet the token from the operator's IdP — Keycloak, Auth0, Okta and Entra ID ship as presets, and any issuer publishing an OpenID discovery document works. OpenSteward only verifies: it never mints these tokens and holds no client secret.\n\nThe token resolves to the **same scope vocabulary** as a dev key — the two-axis vertical model, `customers:*`, `mcp:read` and the rest — so a route requiring `vertical:write` requires it identically here. Where those scopes come from is the operator's choice per issuer: from a registered client row, from the token's own scope claim, or from the row narrowed by the claim.\n\nEvery verification failure answers `401 UNAUTHENTICATED` with the same body, deliberately: distinguishing a bad signature from an unregistered client would enumerate the operator's service accounts. The reason is in the deployment's logs.\n\nThis scheme is not declared with a `tokenUrl`, because the spec is static and deterministic while the token endpoint differs per deployment. Ask the operator for their issuer and audience."
      },
      "AdminSecret": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Admin-Secret",
        "description": "Operator-only secret for `/admin/*` and a small number of platform-management routes. **Distinct from a developer key** — never give the admin secret to an external integrator.\n\nThe value is the `ADMIN_SECRET` env var on the integration-server. Used for: enabling/disabling platforms, setting platform OAuth credentials, listing every adapter across verticals, deleting any connection by UUID. End-user / developer flows should use a Bearer dev key instead."
      }
    },
    "parameters": {
      "IdempotencyKeyParam": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "Opaque client-generated token (UUIDv4 recommended). When supplied on POST/PATCH/PUT/DELETE, the server caches the response for 24h keyed by `(tenant, method, route, key)`, once authentication and the license checks have let the request through. Retrying the same request (URL including query, and body) with the same key replays the original response (`Idempotency-Replayed: true`); reusing the key with a different URL or body returns `422` with `Idempotency-Key-Conflict: true`; a concurrent retry while the first is in-flight returns `409` with `Retry-After`. A refusal (`401`, `403`, `409`, `429`, or any `LICENSE_*` error) is never cached, so a retry is checked again.",
        "schema": {
          "type": "string",
          "maxLength": 255
        }
      },
      "ConnectionIdParam": {
        "name": "connection_id",
        "in": "query",
        "required": true,
        "description": "UUID of the stored connection to use. On the live surface it is returned by the OAuth callback (`GET /auth/{vertical}/{platform}/callback`) — store it against your end-user record and pass it on every `/v1/{vertical}/*` request. **In test mode**, get one from `GET /test/v1/connections` (one per vertical, deterministic — start there).",
        "schema": {
          "type": "string",
          "format": "uuid",
          "example": "1b9d6bcd-bf5c-4a3e-9b2a-2f4e8c7d1a90"
        }
      },
      "IdParam": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "Platform-specific resource ID.",
        "schema": {
          "type": "string"
        }
      },
      "PageParam": {
        "name": "page",
        "in": "query",
        "required": false,
        "description": "Page number, 1-based: page N starts after (N − 1) × `meta.limit` rows. A missing page, or one that is not a decimal number of at least 1, is the first page.",
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "LimitParam": {
        "name": "limit",
        "in": "query",
        "required": false,
        "description": "Records per page, at most 500. On `/v1/{vertical}/*` lists it defaults to 100 and is also capped at the platform's page maximum where the adapter declares one; `meta.limit` reports the page size served.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500
        }
      },
      "UpdatedAfterParam": {
        "name": "updated_after",
        "in": "query",
        "required": false,
        "description": "Only return records modified at or after this ISO 8601 timestamp. Filters on each record's `updatedAt`, which every entity returns — so the correct watermark for an incremental poll is `max(updatedAt)` across the records you just received, NOT your own clock at request time. Using your clock loses any record modified while the request was in flight; a safety margin re-fetches a window and is a guess in both directions. The boundary is INCLUSIVE, and some platforms compare at second granularity (Xero does), so passing back `max(updatedAt)` re-delivers the records at that timestamp. That is deliberate: skipping past them would silently drop anything modified in the same second. Make your consumer idempotent — upsert by `id` — rather than advancing the watermark to exclude them.",
        "schema": {
          "$ref": "#/components/schemas/ISO8601"
        }
      },
      "SearchParam": {
        "name": "search",
        "in": "query",
        "required": false,
        "description": "Adapter-defined free-text search.",
        "schema": {
          "type": "string"
        }
      },
      "IsLiveParam": {
        "name": "is_live",
        "in": "query",
        "required": false,
        "description": "Set to `true` to bypass the local DB cache and fetch fresh from the upstream platform. Fresh result is still written back to cache. No-op in `passthrough` mode.",
        "schema": {
          "type": "string",
          "enum": [
            "true",
            "false"
          ]
        }
      },
      "IncludePiiParam": {
        "name": "include_pii",
        "in": "query",
        "required": false,
        "description": "When `true`, response `data.pii` is populated with the decrypted record. Requires the `customers:read_pii` scope.",
        "schema": {
          "type": "string",
          "enum": [
            "true",
            "false"
          ]
        }
      }
    },
    "headers": {
      "XRequestId": {
        "description": "Per-request trace id. Echoes the inbound `X-Request-Id` when supplied; otherwise the server generates one. Quote this when contacting support — every log line carries the same id under `requestId`.",
        "schema": {
          "type": "string"
        }
      },
      "XRateLimitLimit": {
        "description": "Rate-limit ceiling for the current window (requests).",
        "schema": {
          "type": "integer"
        }
      },
      "XRateLimitRemaining": {
        "description": "Requests remaining in the current rate-limit window.",
        "schema": {
          "type": "integer"
        }
      },
      "XRateLimitReset": {
        "description": "Seconds until the rate-limit window resets.",
        "schema": {
          "type": "integer"
        }
      },
      "IdempotencyReplayed": {
        "description": "Present on cached replays of an `Idempotency-Key`-bearing request — value is always `true`. Absent on first execution.",
        "schema": {
          "type": "string",
          "enum": [
            "true"
          ]
        }
      },
      "IdempotencyKeyConflict": {
        "description": "Present on the `422` response when the same `Idempotency-Key` is reused with a different request URL or body. Value is always `true`.",
        "schema": {
          "type": "string",
          "enum": [
            "true"
          ]
        }
      },
      "RetryAfter": {
        "description": "Suggested backoff in seconds. Returned on `409 idempotency_in_flight` and on rate-limit-exceeded responses.",
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      }
    }
  },
  "tags": [
    {
      "name": "Accounting",
      "description": "Accounting vertical — connection-scoped resources under /v1/accounting/*.\n\n**Resources**\n\n- `providers` — Static metadata about enabled accounting platforms.\n- `organizations` — Authenticated tenant organisation profile. Read-only.\n- `invoices` — Customer invoices (accounts receivable). Full CRUD.\n- `bills` — Supplier bills (accounts payable). Full CRUD.\n- `contacts` — Customers and suppliers. Full CRUD.\n- `accounts` — Chart-of-accounts general ledger accounts. Read-only.\n- `journals` — General ledger journal batches. List, get, create.\n- `transactions` — Bank/payment transactions. Read-only.\n- `taxrates` — Tax rates. Read-only.\n- `expenses` — Employee expenses. List, get, create.\n- `creditmemos` — Credit notes. List, get, create.\n- `quotes` — Quotes / estimates — a priced offer made before any obligation exists. List and get; read-only. Not an invoice: nothing is owed until a quote is accepted and converted, so there is no paid, balance or due-date arithmetic on this resource.\n- `orders` — Generic orders — the union view across a platform's order-like documents. List, get, create. **On platforms that model no separate sales order (Fortnox), `orders` and `salesorders` read the SAME upstream resource** and will return the same records; `orders` adds a `type` discriminator. Do not sum both, or you will double-count. **Xero has no sales-order entity at all** — `salesorders` is not implemented there, and `orders` instead reads the same upstream resource as `purchaseorders`, tagged `type: PURCHASE`.\n- `salesorders` — Sales orders. List, get, create. See the note on `orders`: where a platform has no distinct sales-order entity, this is a projection of the same upstream documents rather than a separate set. `purchaseorders` is always distinct.\n- `purchaseorders` — Purchase orders. List, get, create. Always a distinct upstream resource, unlike the orders/salesorders pair."
    },
    {
      "name": "CRM",
      "description": "CRM vertical — connection-scoped resources under /v1/crm/*.\n\n**Resources**\n\n- `providers` — Static metadata about enabled CRM platforms.\n- `contacts` — People — leads, prospects, customers. Full CRUD.\n- `companies` — Organisations / accounts. Full CRUD.\n- `deals` — Sales opportunities. Full CRUD.\n- `pipelines` — Deal pipelines and stages. Read-only.\n- `activities` — Tasks, calls, meetings, emails. Full CRUD.\n- `notes` — Free-form notes attached to contacts, companies, or deals. Full CRUD."
    },
    {
      "name": "Ecommerce",
      "description": "Ecommerce vertical — connection-scoped resources under /v1/ecommerce/*.\n\n**Resources**\n\n- `Products` — Product catalogue. Full CRUD.\n- `Variants` — Product variants (SKUs). Full CRUD.\n- `Collections` — Product collections / categories. Full CRUD.\n- `Locations` — Inventory locations / warehouses. Read-only.\n- `Inventory` — Inventory levels. List, get, adjust, set.\n- `Orders` — Orders with line items, fulfillments, refunds. List, get, create, update, cancel.\n- `Fulfillments` — Order fulfillments and shipments. List, get, create, update, cancel.\n- `Refunds` — Order refunds. List, get, create.\n- `Transactions` — Payment transactions. List, get, create.\n- `Discounts` — Discount codes and automatic discounts. Full CRUD.\n- `Providers` — Static metadata about enabled ecommerce platforms."
    },
    {
      "name": "Logistics",
      "description": "Logistics vertical — connection-scoped resources under /v1/logistics/*.\n\n**Resources**\n\n- `providers` — List available adapters and their metadata\n- `shipments` — Shipment CRUD and status\n- `orders` — Fulfilment order CRUD\n- `carriers` — Carrier and service listing\n- `warehouses` — Warehouse / fulfilment centre listing\n- `trackingevents` — Parcel tracking event history\n- `rates` — Shipping rate quotes\n- `labels` — Shipping label purchase and management\n- `manifests` — End-of-day carrier manifests\n- `pickups` — Carrier pickup scheduling and cancellation"
    },
    {
      "name": "Payments",
      "description": "Payments vertical — connection-scoped resources under /v1/payments/*.\n\n**Resources**\n\n- `PaymentMethods` — Saved cards, bank accounts, wallets, mandates.\n- `Charges` — Charges / payment intents. List, get, create, capture, cancel.\n- `Refunds` — Full or partial refunds against charges.\n- `Subscriptions` — Recurring-billing records. List, get, create, update, cancel.\n- `Invoices` — Invoices (subscription-generated and standalone), line items, void, pay.\n- `Payouts` — Gateway-to-bank settlements. Read-only.\n- `Disputes` — Chargebacks / disputes and evidence submission.\n- `Catalog` — Catalog records: plans, prices, products. Absent on many gateways (`501` when unsupported).\n- `BalanceTransactions` — Ledger of every balance-affecting event. Absent on many gateways (`501` when unsupported)."
    },
    {
      "name": "Docsign",
      "description": "Docsign vertical — connection-scoped resources under /v1/docsign/*.\n\n**Resources**\n\n- `Envelopes` — Signing envelopes — list, get, void.\n- `Signers` — Recipients (signers, cc, witnesses) on an envelope.\n- `Documents` — Document metadata only. No content body returned.\n- `AuditTrailEntries` — First-class audit-trail entries per envelope.\n- `Templates` — Reusable envelope templates."
    },
    {
      "name": "Projects",
      "description": "Projects vertical — connection-scoped resources under /v1/projects/*.\n\n**Resources**\n\n- `Projects` — Projects (workspaces containers of tasks).\n- `Tasks` — Tasks with flat-with-parent-pointer hierarchy.\n- `Comments` — Comments on tasks or projects. Text included; attachment content refused.\n- `Tags` — Taxonomy.\n- `Workspaces` — Top-level org boundary.\n- `Users` — Platform user identity (name + email only)."
    },
    {
      "name": "CustomerSupport",
      "description": "CustomerSupport vertical — connection-scoped resources under /v1/customer-support/*.\n\n**Resources**\n\n- `Tickets` — Tickets / conversations / cases.\n- `Messages` — Body text inside a ticket. Public reply or internal note.\n- `Contacts` — Customer identity. PII-minimal.\n- `Users` — Agent identity.\n- `Tags` — Taxonomy.\n- `Teams` — Agent groups.\n- `Macros` — Canned-response templates."
    },
    {
      "name": "Inventory",
      "description": "Inventory vertical — connection-scoped resources under /v1/inventory/*.\n\n**Resources**\n\n- `Products` — SKU master records.\n- `StockLevels` — Qty per Product × Location.\n- `Locations` — Warehouses / stores / virtual locations.\n- `Suppliers` — Vendors / sources.\n- `PurchaseOrders` — Inbound stock orders.\n- `StockTransfers` — Movements between locations.\n- `StockAdjustments` — Cycle counts, write-offs, audit moves."
    },
    {
      "name": "Sandbox",
      "description": "The test-mode control surface. `/test/v1/*` serves synthetic data with an `osk_test_…` key — or a token from the deployment’s own **test issuer** (`/test/oidc`: discovery, JWKS, and `POST /token`, which trades a test key for an OIDC bearer) — and makes no outbound call to any platform. Sandbox-only routes here: self-serve keys (`POST /test/v1/keys`), connection discovery (`GET /test/v1/connections` — start there), data reset (`DELETE /test/v1/reset`), and the **mock OAuth ceremony** (`/test/v1/auth/{vertical}/sandbox/connect` → hosted authorize page or `?outcome=…` → `/callback` granting the derived connection id). The tenant control plane (customers, connections, events, webhook-subscriptions) and a curated platform catalog are served under `/test/v1` too, and every vertical resource route mirrors `/v1/*` — pick the sandbox entry in the Servers dropdown to try one. Sandbox connect links open a hosted mock picker/authorize/done journey (HTML pages, unpublished here — see the dev-api guide)."
    },
    {
      "name": "Platform",
      "description": "Service health + platform catalog. The unified-backend surface that isn't per-vertical."
    },
    {
      "name": "Auth",
      "description": "OAuth connect / callback / revoke for every (vertical, platform) pair."
    },
    {
      "name": "Connections",
      "description": "Connection management — list / get / rename / delete a single OAuth connection. Tenant-scoped routes (`/v1/connections*`) use a Bearer dev key + `connections:*` scope and are exercisable in test mode (`/test/v1/connections*`); operator-only routes (`/admin/connections*`) require `X-Admin-Secret` and span every tenant."
    },
    {
      "name": "Customers",
      "description": "Customer (end-user) management + Connect Link creation. Tenant-scoped developer API."
    },
    {
      "name": "Events",
      "description": "Verified inbound platform events, tenant-scoped. Poll `GET /v1/events` with the monotonic `seq` cursor; the same stream is available with synthetic rows in test mode at `/test/v1/events`."
    },
    {
      "name": "Sync",
      "description": "Background full-sync jobs across the five verticals. POST `/v1/{vertical}/sync` enqueues; the per-vertical SyncWorker drains. Operator overview via `/admin/sync-jobs`."
    },
    {
      "name": "Webhooks",
      "description": "Inbound webhook normalisation. Verifies signatures, fans out across connections, optionally forwards to a callback URL."
    },
    {
      "name": "Admin",
      "description": "Operator-only routes gated by `X-Admin-Secret` — platform management, cross-tenant connection inspection, sync-job admin."
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    },
    {
      "OAuth2Bearer": []
    }
  ]
}
