> ## Documentation Index
> Fetch the complete documentation index at: https://docs-pos.solya.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Replace the network settings

> Upserts the ENTIRE network preference document. This is a full replacement, not a patch: every key you omit is DELETED. Read the settings first, merge your change into the map you got back, and send the whole map — sending only the key you want to change silently wipes the rest of the network's configuration. The document is network-wide and takes effect on every store and every till, so this operation can reconfigure live registers mid-trading; do not call it speculatively, and confirm the intended change with the operator first. Values must be primitives — a nested object or a number is rejected with a 400 whose `error.fieldErrors` names the offending key. Returns the document exactly as persisted. PERMISSIONS: unlike the store and fleet writes in this same domain, this operation asserts NO kernel permission, so `pos.settings.manage` genuinely suffices on its own (`pos.settings.view` alone is a 403). The domain's two write stories differ — see solya-pos#950 for why the store/fleet writes additionally need `config:manage`.



## OpenAPI

````yaml /openapi.json put /v1/settings
openapi: 3.0.3
info:
  title: Solya POS API
  version: 1.0.0
  description: >-
    The Solya POS backend HTTP surface. Every documented operation is
    agent-ready: it carries an `operationId`, an agent-facing `description`, the
    `pos.*` scopes it enforces (`x-required-permissions`) and an `x-agent-tier`.
    Success responses return the payload as raw JSON; failures return the
    `ErrorResponse` envelope (`{ error: { code, message, statusCode } }`).
servers:
  - url: /
    description: The backend, relative to its deployed origin.
security: []
paths:
  /v1/settings:
    put:
      tags:
        - Settings
      summary: Replace the network settings
      description: >-
        Upserts the ENTIRE network preference document. This is a full
        replacement, not a patch: every key you omit is DELETED. Read the
        settings first, merge your change into the map you got back, and send
        the whole map — sending only the key you want to change silently wipes
        the rest of the network's configuration. The document is network-wide
        and takes effect on every store and every till, so this operation can
        reconfigure live registers mid-trading; do not call it speculatively,
        and confirm the intended change with the operator first. Values must be
        primitives — a nested object or a number is rejected with a 400 whose
        `error.fieldErrors` names the offending key. Returns the document
        exactly as persisted. PERMISSIONS: unlike the store and fleet writes in
        this same domain, this operation asserts NO kernel permission, so
        `pos.settings.manage` genuinely suffices on its own (`pos.settings.view`
        alone is a 403). The domain's two write stories differ — see
        solya-pos#950 for why the store/fleet writes additionally need
        `config:manage`.
      operationId: updateNetworkSettings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                preferences:
                  type: object
                  additionalProperties:
                    anyOf:
                      - type: boolean
                      - type: string
              required:
                - preferences
              example:
                preferences:
                  auto-sync: false
                  currency: eur
                  receipt-mode: on-request
      responses:
        '200':
          description: >-
            The settings document as it was persisted (identical to the request
            body).
          content:
            application/json:
              schema:
                type: object
                properties:
                  preferences:
                    type: object
                    additionalProperties:
                      anyOf:
                        - type: boolean
                        - type: string
                required:
                  - preferences
                additionalProperties: false
                description: >-
                  The settings document as it was persisted (identical to the
                  request body).
                example:
                  preferences:
                    auto-sync: false
                    currency: eur
                    receipt-mode: on-request
        '400':
          description: >-
            The request failed schema validation; `error.fieldErrors` lists the
            fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '401':
          description: No valid credential was presented — send a bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: The actor is authenticated but lacks the required `pos.*` scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: An unexpected server error — safe to retry idempotent requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    ValidationErrorResponse:
      type: object
      required:
        - error
      additionalProperties: false
      description: >-
        A `VALIDATION_FAILED` envelope carrying the offending fields in
        `fieldErrors`.
      properties:
        error:
          type: object
          required:
            - code
            - message
            - statusCode
          additionalProperties: false
          properties:
            code:
              type: string
              enum:
                - VALIDATION_FAILED
            message:
              type: string
            statusCode:
              type: integer
            fieldErrors:
              type: array
              description: >-
                One entry per rejected field: the field path and why it was
                rejected.
              items:
                type: object
                required:
                  - field
                  - message
                additionalProperties: false
                properties:
                  field:
                    type: string
                    description: Dot-path of the offending field.
                  message:
                    type: string
                    description: Why the field was rejected.
    ErrorResponse:
      type: object
      required:
        - error
      additionalProperties: false
      description: The uniform failure envelope every non-2xx response returns.
      properties:
        error:
          type: object
          required:
            - code
            - message
            - statusCode
          additionalProperties: false
          properties:
            code:
              type: string
              enum:
                - VALIDATION_FAILED
                - UNAUTHORIZED
                - FORBIDDEN
                - NOT_FOUND
                - CONFLICT
                - BUSINESS_RULE_VIOLATION
                - INTERNAL_ERROR
              description: >-
                Machine-readable kernel `ResultCode` — branch on this, not on
                `message`.
            message:
              type: string
              description: >-
                Human-readable explanation. Safe to surface; never leaks server
                internals.
            statusCode:
              type: integer
              description: >-
                The HTTP status, mirrored into the body so a client need not
                read headers.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        `Authorization: Bearer <token>`. Accepts EITHER a Keycloak access token
        (scopes-in-token) OR an opaque POS session token; both resolve to the
        same `pos.*` scope vocabulary the route guards enforce.

````