> ## 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.

# Bulk-import proposed inter-store transfer plans (transferts inter-magasins)

> Pushes the merch app's ML-computed rebalancing lines into the centrale as transfer requests. Each `transfers[]` item is `{ id, sourceStoreId, destinationStoreId, lines: [{ skuId, requestedQuantity }] }` and runs through the SAME request-transfer use-case the interactive route uses (source ≠ destination enforced). Idempotent by id (`skipped` on re-push); a malformed item is `failed` without aborting the rest. Machine-only (`X-Internal-Token`).



## OpenAPI

````yaml /openapi.json post /v1/import/transfers
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/import/transfers:
    post:
      tags:
        - Merchandising import
      summary: >-
        Bulk-import proposed inter-store transfer plans (transferts
        inter-magasins)
      description: >-
        Pushes the merch app's ML-computed rebalancing lines into the centrale
        as transfer requests. Each `transfers[]` item is `{ id, sourceStoreId,
        destinationStoreId, lines: [{ skuId, requestedQuantity }] }` and runs
        through the SAME request-transfer use-case the interactive route uses
        (source ≠ destination enforced). Idempotent by id (`skipped` on
        re-push); a malformed item is `failed` without aborting the rest.
        Machine-only (`X-Internal-Token`).
      operationId: importTransfers
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                transfers:
                  minItems: 1
                  type: array
                  items: {}
                  description: >-
                    The pushed transfers; each item is re-validated server-side
                    and reported per row.
              required:
                - transfers
              example:
                transfers:
                  - id: tr-merch-2026-0007
                    sourceStoreId: shop-lyon-02
                    destinationStoreId: shop-paris-01
                    lines:
                      - skuId: sku-espresso-1kg
                        requestedQuantity: 12
      responses:
        '200':
          description: >-
            A per-row report: every pushed item as `created` / `skipped` /
            `failed`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: >-
                            The item's business id (`?` when the pushed item
                            carried none).
                        status:
                          type: string
                          enum:
                            - created
                            - skipped
                            - failed
                          description: >-
                            `created` on success, `skipped` when it already
                            exists (idempotent), else `failed`.
                        reason:
                          description: >-
                            Why a row was skipped (`already-exists`) or failed
                            (the validation / domain error).
                          type: string
                      required:
                        - id
                        - status
                      additionalProperties: false
                    description: One entry per pushed item, in payload order.
                  created:
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                    description: How many items were newly persisted.
                  skipped:
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                    description: How many already existed (no-op / idempotent).
                  failed:
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                    description: How many were rejected (see each `reason`).
                required:
                  - results
                  - created
                  - skipped
                  - failed
                additionalProperties: false
                description: >-
                  A per-row report: every pushed item as `created` / `skipped` /
                  `failed`.
                example:
                  results:
                    - id: po-merch-2026-0001
                      status: created
                    - id: po-merch-2026-0002
                      status: skipped
                      reason: already-exists
                    - id: po-merch-2026-0003
                      status: failed
                      reason: 'Supplier not found: sup-unknown'
                  created: 1
                  skipped: 1
                  failed: 1
        '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'
        '422':
          description: The request is well-formed but violates a domain rule.
          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:
        - internalToken: []
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:
    internalToken:
      type: apiKey
      in: header
      name: X-Internal-Token
      description: >-
        The data-platform SERVICE token (`DATA_PLATFORM_API_TOKEN`) in the
        `X-Internal-Token` header. Guards the machine-only incremental CDC
        export; not a user credential and never a POS session — reachable only
        server-to-server.

````