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

# Send offline commands

> Applies up to 100 commands (1 MB at most) as the member, in order, each
exactly as the same change made in the app. Every command answers with
`applied`, `rejected` or `deferred`. `applied` comes with the result.
`rejected` is final and comes with a `code`, a `message` and the
invalid `fields`. `deferred` means not run: a dependency is unfinished
in another batch or the batch used its 20 second budget, so send it
again after `retry_after` seconds. A command
sent again returns its stored result with `replayed: true` and runs
nothing; the same id with another payload is rejected
`command_id_reused`. A command whose dependency was rejected is
rejected `dependency_rejected`. Needs a token of a registered device
with `sync:write`, and each command needs its own permission, plan
feature and scope when it is applied.



## OpenAPI

````yaml /openapi.json post /sync/commands
openapi: 3.1.2
info:
  title: StockShift API
  version: 1.0.0
  description: >-
    The StockShift REST API. Start with the guides for authentication, scopes,
    pagination, errors and webhooks.
servers:
  - url: https://app.stockshift.io/api/v1
    description: Production
  - url: https://app.beta.stockshift.io/api/v1
    description: Beta
security:
  - apiKey: []
  - oauth2: []
tags:
  - name: Witnessed stock actions
    description: >-
      Hold a stock action for a second person, who recounts blind and signs, and
      read both signatures. Stock changes only once the witness signs.
  - name: Item stock
    description: >-
      Everything about one item's stock: where it is, what is promised, how it
      is tracked and what it costs.
  - name: Transfers
    description: >-
      Move stock from one location to another, with time in transit between
      shipping and receiving.
  - name: Landed costs
    description: >-
      Add freight, duty and other charges to the cost of stock you have
      received.
  - name: Stock counts
    description: >-
      Count what is on the shelf, compare it with what StockShift expects and
      post the difference once someone approves it.
  - name: Locations
    description: >-
      The warehouses, rooms and bins stock is kept in. Most stock calls need a
      location ID from here.
  - name: Periods
    description: >-
      Close each month once it is reported: lock what is dated in it, check
      nothing is left open and keep the stock value at its end.
  - name: Inventory imports
    description: >-
      Load opening stock from a CSV file, with a preview before anything is
      posted.
  - name: Release requests
    description: >-
      Ask QA to release stock that is on hold, and decline or withdraw the
      request. Releasing the stock closes it.
  - name: Signers
    description: >-
      Who may sign witnessed stock actions: whose identity was checked, how and
      when, and the failed signings reviewers must see.
  - name: Stock
    description: >-
      How much of each item is where. Read levels, now or at a past date, and
      post adjustments when stock is found, lost or damaged.
  - name: Witnessing rules
    description: >-
      Which stock actions wait for a second person to recount and sign, such as
      removing a controlled substance.
  - name: Allocation rules
    description: >-
      Which lots are picked first when stock is reserved or shipped, such as
      first expiry first out.
  - name: Inventory settings
    description: >-
      How the organization handles stock, such as whether stock may go negative
      and how it is costed.
  - name: Lots
    description: Batches of stock that share a lot number, and when they expire.
  - name: Movements
    description: >-
      The ledger behind every stock level. Movements are never edited; you
      correct one by reversing it.
  - name: Serial numbers
    description: Individually tracked units, and where each one is now.
  - name: Stock moves
    description: >-
      Move stock from one location to another in one step, such as from a dock
      to a shelf, and undo a move whole.
  - name: Bulk previews
    description: >-
      Check a list of stock lines before a bulk move, adjustment, hold or print,
      and see what each line needs decided.
  - name: Items
    description: >-
      The products and materials you stock, buy, make or sell. An item's ID or
      SKU is what most other endpoints ask for.
  - name: Families
    description: >-
      Groups of items that differ only by options such as size or color, and the
      variants made from them.
  - name: Catalog imports
    description: >-
      Create or update items from a CSV file, with a preview before anything is
      saved.
  - name: Custom fields
    description: >-
      Extra fields the organization adds to its items. Define them here, then
      set their values on each item.
  - name: Product library
    description: >-
      Look up a product by its GTIN and create an item from what the library
      knows about it.
  - name: Units
    description: >-
      Units of measure, such as each, box or kg. Items count in one base unit
      and convert from the others.
  - name: Scanning
    description: Turn a scanned barcode into the item, unit or labeled piece it identifies.
  - name: Suppliers
    description: >-
      The companies you buy from, the people you deal with there and what they
      charge you.
  - name: Purchase orders
    description: >-
      Orders to suppliers. Draft one, approve it, send it and receive the goods
      against it.
  - name: Purchasing imports
    description: Load suppliers and their catalogs from CSV files.
  - name: Purchasing settings
    description: >-
      How the organization buys, such as the approval threshold and how far a
      receipt may go over the order.
  - name: Receipts
    description: >-
      Goods received against purchase orders. Reverse a receipt to correct it,
      or print labels for what came in.
  - name: Item suppliers
    description: Which suppliers sell an item, and at what price.
  - name: Purchasing exports
    description: >-
      Download suppliers or their catalogs as CSV, in the same columns the
      import reads.
  - name: Sales orders
    description: >-
      Customer orders. Take one as a draft, confirm it to hold stock, then ship
      it and invoice it.
  - name: Customers
    description: The companies you sell to and the people you deal with there.
  - name: Invoices
    description: Bills for what you have sold, and the payments recorded against them.
  - name: Price lists
    description: >-
      The prices a customer pays, with quantity breaks. Give a customer a price
      list and their orders price themselves.
  - name: Quotes
    description: Offers to customers. An accepted quote becomes a sales order.
  - name: Tax rates
    description: The sales tax rates invoices are charged at.
  - name: Sales imports
    description: Load customers and price lists from CSV files.
  - name: Returns
    description: >-
      Goods customers send back: authorize the return, then receive it into
      stock and credit it.
  - name: Shipments
    description: What left the building for each sales order.
  - name: Sales settings
    description: >-
      How the organization sells, such as when stock is reserved and whether
      invoices can go out before shipping.
  - name: Certificates of conformance
    description: >-
      Signed certificates that the goods on a shipment conform to the order,
      kept exactly as they were signed.
  - name: Prices
    description: >-
      Ask what a customer would pay for a quantity of an item before you put it
      on an order.
  - name: Sales exports
    description: >-
      Download customers and price lists as CSV, in the same columns the import
      reads.
  - name: Builds
    description: >-
      Orders to make something. Release a build to the floor, issue its parts
      and complete it into stock.
  - name: Repairs
    description: >-
      Repairs of units customers send back: check the warranty, record the parts
      put in and taken out, then complete the repair or bill it.
  - name: Routings
    description: The steps a build goes through and the work center each step runs at.
  - name: Work centers
    description: The machines, cells or teams where the steps of a routing are done.
  - name: Warranty terms
    description: >-
      How long an item is under warranty and whether it counts from shipment or
      build, with terms of their own for some customers.
  - name: Genealogy
    description: >-
      Trace a lot or serial number back to what went into it, or forward to what
      it went into.
  - name: Manufacturing settings
    description: >-
      How the organization builds, such as whether operations may overlap and
      the status finished goods go into.
  - name: Scheduling
    description: Plan open builds onto working days.
  - name: Cost variances
    description: Where a completed build cost more or less than its standard cost.
  - name: BOMs
    description: >-
      Bills of materials: the parts and quantities that go into an item, kept as
      revisions.
  - name: Engineering changes
    description: >-
      Change orders that propose new BOM revisions and release them once
      approved.
  - name: Engineering imports
    description: Load bills of materials from a CSV file or a CAD export.
  - name: Engineering settings
    description: >-
      How the organization manages engineering changes, such as how many
      approvals a change order needs.
  - name: Engineering exports
    description: Download bills of materials as CSV, in the same columns the import reads.
  - name: Where used
    description: Find every BOM an item appears in, before you change or retire it.
  - name: Inspection plans
    description: >-
      What to check, on which items and how many: the characteristics, sampling
      and inspection point of each plan.
  - name: Inspections
    description: >-
      Inspections opened by receipts, operations and builds. Record their
      results to pass or fail the stock they hold.
  - name: Forecasts
    description: >-
      Expected demand for each item, week by week, and the changes planners make
      to it.
  - name: Scenarios
    description: Copies of the forecast to try out changes without touching the real plan.
  - name: Demand
    description: Past demand for an item at a location, which the forecasts are built from.
  - name: Suggestions
    description: >-
      What the plan says to buy or build. Accept one to raise the purchase order
      or build, or dismiss it.
  - name: Replenishment
    description: >-
      How each item is kept in stock at each location: reorder points, minimums
      and maximums or periodic review.
  - name: Holidays
    description: >-
      Days the organization does not work, which the plan skips when it counts
      lead times.
  - name: Planning settings
    description: >-
      How the organization plans, such as the forecast horizon and service
      level.
  - name: Automations
    description: >-
      Rules that run steps when something happens or on a schedule. Edit the
      draft, then publish it to turn it on.
  - name: Runs
    description: >-
      Each time an automation ran: what started it, what each step did and where
      it failed.
  - name: Approvals
    description: Runs paused for a person to approve or reject before they carry on.
  - name: Automation settings
    description: >-
      Organization-wide limits on automations, such as runs a minute and whether
      someone may approve their own run.
  - name: Automation templates
    description: Ready-made automations to start from.
  - name: Events
    description: >-
      The events an automation can be triggered by, and the data each one
      carries.
  - name: Step catalog
    description: Every step an automation can use and the inputs each one takes.
  - name: Views
    description: >-
      Saved reports: the dataset, filters, grouping and chart someone set up,
      ready to run again.
  - name: Dashboards
    description: Pages of charts and KPIs laid out on a grid.
  - name: Datasets
    description: >-
      The data you can report on and the fields in each. Start here to build a
      report.
  - name: Schedules
    description: >-
      Send a report by email on a schedule, or alert someone when a value
      crosses a threshold.
  - name: KPIs
    description: Single numbers worth watching, defined as a formula over a dataset.
  - name: View folders
    description: Folders that keep saved views organized.
  - name: Insights exports
    description: >-
      Export a report to a file. Large exports run in the background and are
      ready to download later.
  - name: Report templates
    description: Ready-made reports, such as stock aging, to start a view from.
  - name: Reports
    description: >-
      Run a report definition and get its rows or its chart back, without saving
      it first.
  - name: Dashboard
    description: >-
      The figures on the app's home screen, if you want to show the same numbers
      elsewhere.
  - name: Dashboard templates
    description: Ready-made dashboards to start from.
  - name: Formulas
    description: >-
      Check a formula against a dataset before you save it in a KPI or a
      calculated field.
  - name: Connections
    description: >-
      Connected accounts in other systems, what each one syncs and the history
      of its sync runs.
  - name: Shipping
    description: >-
      Carrier rates, the labels bought for orders and returns, and the scans
      that track each parcel.
  - name: Sourcing
    description: >-
      Distributor part prices and stock: search a connected distributor, link
      items to its parts and price a BOM revision.
  - name: Tax addresses
    description: The addresses a connected tax service taxes each sale by, checked with it.
  - name: Connectors
    description: The systems StockShift can connect to, and what each connector can sync.
  - name: Label sets
    description: Every batch of labels printed, so you can find it again and reprint it.
  - name: Label templates
    description: The layouts labels are printed with.
  - name: Pieces
    description: >-
      Look up a labeled piece from the code on its label: the item, lot or
      serial and how much it holds.
  - name: Branding and templates
    description: >-
      The logo, colors, terms and custom fields every quote, purchase order,
      invoice and packing slip prints with.
  - name: Mobile apps
    description: >-
      How the StockShift mobile apps enroll a device, sign in and stay in step
      with the server.
  - name: Devices
    description: >-
      The phones and scanners enrolled in the organization. Lock a lost one,
      wipe it or retire it.
  - name: Scanner setup
    description: >-
      Printable sheets of barcodes that configure a hardware scanner, and each
      person's scanner preferences.
  - name: Enrollments
    description: Make the QR codes that enroll shared devices and kiosks.
  - name: Sync feeds
    description: >-
      Download a snapshot of the data a device needs, then pull the changes
      since.
  - name: Sync commands
    description: >-
      Send the changes a device made while offline. Each command is applied
      once, however often it is sent.
  - name: Sync files
    description: Download the files, such as item images, that a feed points to.
  - name: Profile
    description: >-
      The signed-in person's own account: their details, password, passkeys,
      second factor and sessions.
  - name: Notifications
    description: >-
      The signed-in member's inbox: what needs them, what is unread, and what
      they are told about and how.
  - name: Invitations
    description: Invite people to join the organization, and accept an invitation.
  - name: Roles
    description: Roles and the permissions in each. A member can do what their roles allow.
  - name: Staff access
    description: >-
      Requests from StockShift support to look at the organization's data, which
      an owner must grant.
  - name: Team
    description: The people in the organization and the roles they hold.
  - name: API keys
    description: Create and revoke the keys scripts and integrations use to call this API.
  - name: Organizations
    description: The organizations the signed-in person belongs to.
  - name: Signatures
    description: >-
      Some actions need an electronic signature. Get a signing token here and
      send it with the call.
  - name: Registration
    description: Sign up for a new account and organization.
  - name: Organization
    description: >-
      Organization-wide policy: how long records are kept, session rules, legal
      holds and closing the organization down.
  - name: Address
    description: The billing address that appears on the organization's invoices.
  - name: History
    description: Who changed which field of a record, when and from what.
  - name: Destruction certificates
    description: Check that a certificate of data destruction is genuine.
  - name: Billing
    description: >-
      Check or change the plan, buy run packs for automations, see invoices and
      update the payment method.
  - name: Webhooks
    description: >-
      Register URLs to be told when things happen, and see each delivery and its
      response.
  - name: OAuth apps
    description: >-
      Third-party apps members have connected through OAuth. Revoke one to cut
      off its access.
  - name: REST hooks
    description: >-
      For connected apps such as Zapier: subscribe one event to a URL, and
      unsubscribe it.
  - name: MCP server
    description: >-
      Let an AI assistant work in StockShift through the Model Context Protocol,
      with the same permissions as the member who connects it.
  - name: Recent events
    description: >-
      The latest events of a type, as deliveries send them, to poll or to use as
      samples.
  - name: Webhook events
    description: Every event webhooks and REST hooks can send, with the shape of its data.
paths:
  /sync/commands:
    post:
      tags:
        - Sync commands
      summary: Send offline commands
      description: |-
        Applies up to 100 commands (1 MB at most) as the member, in order, each
        exactly as the same change made in the app. Every command answers with
        `applied`, `rejected` or `deferred`. `applied` comes with the result.
        `rejected` is final and comes with a `code`, a `message` and the
        invalid `fields`. `deferred` means not run: a dependency is unfinished
        in another batch or the batch used its 20 second budget, so send it
        again after `retry_after` seconds. A command
        sent again returns its stored result with `replayed: true` and runs
        nothing; the same id with another payload is rejected
        `command_id_reused`. A command whose dependency was rejected is
        rejected `dependency_rejected`. Needs a token of a registered device
        with `sync:write`, and each command needs its own permission, plan
        feature and scope when it is applied.
      operationId: v1.sync.commands.submit
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitCommandsRequest'
      responses:
        '200':
          description: '`CommandResultsResource`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CommandResultsResource'
                required:
                  - data
          headers:
            X-RateLimit-Limit:
              description: >-
                Requests a minute allowed for this token, or for the address
                without one.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests left this minute.
              schema:
                type: integer
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/DeviceRequired'
        '413':
          $ref: '#/components/responses/BatchTooLarge'
        '422':
          $ref: '#/components/responses/ValidationException'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
          headers:
            Retry-After:
              description: Seconds until the limit resets.
              schema:
                type: integer
            X-RateLimit-Limit:
              description: Requests a minute allowed.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: 'Requests left this minute: none.'
              schema:
                type: integer
      x-codeSamples:
        - lang: typescript
          label: TypeScript SDK
          source: >-
            import { StockShift } from "@stockshift/sdk";


            const stockshift = new StockShift({ token:
            process.env.STOCKSHIFT_TOKEN! });


            const result = await stockshift.post("/sync/commands", {
              body: { commands: [] },
            });
components:
  schemas:
    SubmitCommandsRequest:
      type: object
      description: A batch of commands.
      properties:
        commands:
          type: array
          description: The commands, 1 to 100 and 1 MB in all. They run in this order.
          items:
            oneOf:
              - $ref: '#/components/schemas/SyncCommandInventoryCountsAddLine'
              - $ref: '#/components/schemas/SyncCommandInventoryCountsRecord'
              - $ref: '#/components/schemas/SyncCommandInventoryReleaseRequestsCreate'
              - $ref: '#/components/schemas/SyncCommandInventoryStockAdjust'
              - $ref: '#/components/schemas/SyncCommandInventoryStockChangeStatus'
              - $ref: '#/components/schemas/SyncCommandInventoryStockMove'
              - $ref: '#/components/schemas/SyncCommandInventoryStockReverse'
              - $ref: '#/components/schemas/SyncCommandInventoryStockReverseMove'
              - $ref: '#/components/schemas/SyncCommandInventoryTransfersCreate'
              - $ref: '#/components/schemas/SyncCommandInventoryTransfersReceive'
              - $ref: '#/components/schemas/SyncCommandInventoryTransfersShip'
              - $ref: '#/components/schemas/SyncCommandInventoryVerificationsCancel'
              - $ref: '#/components/schemas/SyncCommandInventoryVerificationsCount'
              - $ref: '#/components/schemas/SyncCommandInventoryVerificationsDecline'
              - $ref: '#/components/schemas/SyncCommandInventoryVerificationsReject'
              - $ref: '#/components/schemas/SyncCommandInventoryVerificationsRequest'
              - $ref: '#/components/schemas/SyncCommandInventoryVerificationsSubmit'
              - $ref: '#/components/schemas/SyncCommandInventoryVerificationsWitness'
              - $ref: '#/components/schemas/SyncCommandLabelsSetsPrint'
              - $ref: '#/components/schemas/SyncCommandManufacturingBuildsComplete'
              - $ref: '#/components/schemas/SyncCommandManufacturingBuildsIssueParts'
              - $ref: >-
                  #/components/schemas/SyncCommandManufacturingBuildsReportProblem
              - $ref: >-
                  #/components/schemas/SyncCommandManufacturingOperationsComplete
              - $ref: '#/components/schemas/SyncCommandManufacturingOperationsPause'
              - $ref: '#/components/schemas/SyncCommandManufacturingOperationsStart'
              - $ref: '#/components/schemas/SyncCommandPurchasingOrdersReceive'
              - $ref: '#/components/schemas/SyncCommandSalesOrdersShip'
          minItems: 1
          maxItems: 100
          uniqueItems: true
      required:
        - commands
      title: SubmitCommandsRequest
    CommandResultsResource:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/CommandResultResource'
      required:
        - results
      title: CommandResultsResource
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          format: uri
          description: Links to the documentation for this code.
        title:
          type: string
          description: The HTTP status text.
        status:
          type: integer
          description: The HTTP status code.
        code:
          type: string
          description: A stable machine readable name, such as validation_failed.
        detail:
          type: string
          description: What went wrong, for people.
        errors:
          type: object
          description: >-
            Errors by field. On validation_failed, and on a refusal with a code
            of its own such as insufficient_stock or document_closed.
          additionalProperties:
            type: array
            items:
              type: string
        feature:
          type: string
          description: The plan feature needed. Only on plan_upgrade_required.
        reason:
          type: string
          description: Why a device must download a feed again. Only on resync_required.
        attempts_left:
          type: integer
          description: >-
            How many refused signatures are left before the member is locked on
            the device. Only on signature_assertion_invalid.
        rule_ids:
          type: array
          description: >-
            The witnessing rules that cover the stock. Only on
            verification_required.
          items:
            type: string
        witness:
          type: string
          description: >-
            Where the witness signs: same_device, remote or either. Only on
            verification_required.
        blind_recount:
          type: boolean
          description: >-
            Whether the witness recounts before seeing the quantity. Only on
            verification_required.
        flags:
          type: array
          description: >-
            The flags a bulk line's decisions leave open, as the bulk preview
            names them. Only on decision_required.
          items:
            type: object
            properties:
              flag:
                type: string
              facts:
                type: object
                description: >-
                  The facts of the flag, as in the bulk preview; the others are
                  null.
                additionalProperties:
                  anyOf:
                    - type: string
                    - type: integer
                    - type: array
                      items:
                        type: string
                    - type: 'null'
              choices:
                type: array
                items:
                  type: string
            required:
              - flag
              - facts
              - choices
      required:
        - type
        - title
        - status
        - code
        - detail
      title: ProblemDetails
    SyncCommandInventoryCountsAddLine:
      type: object
      title: SyncCommandInventoryCountsAddLine
      description: The `inventory.counts.add_line` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: inventory.counts.add_line
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            count_id:
              type: string
            item:
              type: string
            quantity:
              type: string
            unit:
              type:
                - string
                - 'null'
            lot:
              type:
                - string
                - 'null'
            counted_at:
              type:
                - string
                - 'null'
              format: date-time
            contact_at:
              type:
                - string
                - 'null'
              format: date-time
          required:
            - count_id
            - item
            - quantity
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: inventory.counts.add_line
          depends_on: []
          created_at: '2026-11-02T10:00:00+00:00'
          payload:
            count_id: 0199a0d0-0000-7000-8000-00000000f002
            item: 0199a0d0-0000-7000-8000-00000000f003
            quantity: '40'
    SyncCommandInventoryCountsRecord:
      type: object
      title: SyncCommandInventoryCountsRecord
      description: The `inventory.counts.record` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: inventory.counts.record
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            count_id:
              type: string
            lines:
              type: array
              items:
                type: object
                properties:
                  line_id:
                    type: string
                  quantity:
                    type: string
                  unit:
                    type:
                      - string
                      - 'null'
                  counted_at:
                    type:
                      - string
                      - 'null'
                    format: date-time
                  contact_at:
                    type:
                      - string
                      - 'null'
                    format: date-time
                required:
                  - line_id
                  - quantity
          required:
            - count_id
            - lines
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: inventory.counts.record
          depends_on: []
          created_at: '2026-11-02T10:00:00+00:00'
          payload:
            count_id: 0199a0d0-0000-7000-8000-00000000f002
            lines:
              - line_id: 0199a0d0-0000-7000-8000-00000000f003
                quantity: '9'
              - line_id: 0199a0d0-0000-7000-8000-00000000f004
                quantity: '1'
                unit: each
    SyncCommandInventoryReleaseRequestsCreate:
      type: object
      title: SyncCommandInventoryReleaseRequestsCreate
      description: The `inventory.release_requests.create` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: inventory.release_requests.create
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            item:
              type: string
            location_id:
              type: string
            held_status:
              enum:
                - available
                - quarantined
                - rejected
            quantity:
              type: string
            unit:
              type:
                - string
                - 'null'
            lot:
              type:
                - string
                - 'null'
            serial:
              type:
                - string
                - 'null'
            piece:
              type:
                - string
                - 'null'
            note:
              type:
                - string
                - 'null'
            waiting_command_id:
              type:
                - string
                - 'null'
          required:
            - item
            - location_id
            - held_status
            - quantity
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d1-4a10-7000-8000-000000000001
          name: inventory.release_requests.create
          depends_on: []
          created_at: '2026-10-23T11:20:00+00:00'
          payload:
            item: N4BT-NVGY
            location_id: 0199a0c0-0000-7000-8000-000000000a12
            held_status: quarantined
            quantity: '12'
            piece: P-7Q2K9
            note: Moving it to A12-04-B
            waiting_command_id: 0199a0d0-0000-7000-8000-0000000000aa
    SyncCommandInventoryStockAdjust:
      type: object
      title: SyncCommandInventoryStockAdjust
      description: The `inventory.stock.adjust` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: inventory.stock.adjust
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            item:
              type: string
            location_id:
              type: string
            direction:
              enum:
                - receipt
                - issue
            quantity:
              type: string
            unit:
              type:
                - string
                - 'null'
            reason:
              enum:
                - found
                - damaged
                - lost
                - destroyed
                - correction
                - opening_balance
                - other
                - reversal
                - status_change
                - transfer
                - move
                - cycle_count
                - receipt
                - shipment
                - return
                - production_issue
                - production_receipt
                - repair_issue
                - revaluation
                - cost_correction
                - landed_cost
            note:
              type:
                - string
                - 'null'
            status:
              enum:
                - available
                - quarantined
                - rejected
            lot:
              type:
                - string
                - 'null'
            lot_expires_on:
              type:
                - string
                - 'null'
              format: date
            serials:
              type: array
              items:
                type: string
            unit_cost:
              type:
                - string
                - 'null'
            bulk_id:
              type:
                - string
                - 'null'
            bulk_line:
              type:
                - integer
                - 'null'
            decisions:
              type: object
              additionalProperties:
                type: string
            bulk_undo_of:
              type:
                - string
                - 'null'
          required:
            - item
            - location_id
            - direction
            - quantity
            - reason
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: inventory.stock.adjust
          depends_on: []
          created_at: '2026-11-02T10:00:00+00:00'
          payload:
            item: 0199a0d0-0000-7000-8000-000000000201
            location_id: 0199a0d0-0000-7000-8000-000000000101
            direction: issue
            quantity: '3'
            reason: damaged
            note: Crushed in the tote
    SyncCommandInventoryStockChangeStatus:
      type: object
      title: SyncCommandInventoryStockChangeStatus
      description: The `inventory.stock.change_status` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: inventory.stock.change_status
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            item:
              type: string
            location_id:
              type: string
            from:
              enum:
                - available
                - quarantined
                - rejected
            to:
              enum:
                - available
                - quarantined
                - rejected
            quantity:
              type: string
            unit:
              type:
                - string
                - 'null'
            note:
              type:
                - string
                - 'null'
            lot:
              type:
                - string
                - 'null'
            serials:
              type: array
              items:
                type: string
            bulk_id:
              type:
                - string
                - 'null'
            bulk_line:
              type:
                - integer
                - 'null'
            decisions:
              type: object
              additionalProperties:
                type: string
            bulk_undo_of:
              type:
                - string
                - 'null'
          required:
            - item
            - location_id
            - from
            - to
            - quantity
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: inventory.stock.change_status
          depends_on: []
          created_at: '2026-11-02T10:00:00+00:00'
          payload:
            item: 0199a0d0-0000-7000-8000-000000000201
            location_id: 0199a0d0-0000-7000-8000-000000000101
            from: available
            to: quarantined
            quantity: '4'
            note: Rust on the threads
    SyncCommandInventoryStockMove:
      type: object
      title: SyncCommandInventoryStockMove
      description: The `inventory.stock.move` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: inventory.stock.move
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            item:
              type: string
            from_location_id:
              type: string
            to_location_id:
              type: string
            quantity:
              type: string
            unit:
              type:
                - string
                - 'null'
            status:
              enum:
                - available
                - quarantined
                - rejected
            note:
              type:
                - string
                - 'null'
            lot:
              type:
                - string
                - 'null'
            serials:
              type: array
              items:
                type: string
            bulk_id:
              type:
                - string
                - 'null'
            bulk_line:
              type:
                - integer
                - 'null'
            bulk_undo_of:
              type:
                - string
                - 'null'
            decisions:
              type: object
              additionalProperties:
                type: string
          required:
            - item
            - from_location_id
            - to_location_id
            - quantity
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: inventory.stock.move
          depends_on: []
          created_at: '2026-11-02T10:00:00+00:00'
          payload:
            item: 0199a0d0-0000-7000-8000-000000000201
            from_location_id: 0199a0d0-0000-7000-8000-000000000101
            to_location_id: 0199a0d0-0000-7000-8000-000000000102
            quantity: '4'
            note: To the pick face
            bulk_id: 0199a0d0-0000-7000-8000-00000000b001
            bulk_line: 1
            decisions:
              short_dated: accept
    SyncCommandInventoryStockReverse:
      type: object
      title: SyncCommandInventoryStockReverse
      description: The `inventory.stock.reverse` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: inventory.stock.reverse
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            movement_id:
              type: string
            bulk_id:
              type:
                - string
                - 'null'
            bulk_line:
              type:
                - integer
                - 'null'
            bulk_undo_of:
              type:
                - string
                - 'null'
          required:
            - movement_id
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: inventory.stock.reverse
          depends_on: []
          created_at: '2026-11-02T10:00:00+00:00'
          payload:
            movement_id: 0199a0d0-0000-7000-8000-00000000f002
            bulk_id: 0199a0d0-0000-7000-8000-00000000b001
            bulk_line: 1
            bulk_undo_of: 0199a0d0-0000-7000-8000-00000000b001
    SyncCommandInventoryStockReverseMove:
      type: object
      title: SyncCommandInventoryStockReverseMove
      description: The `inventory.stock.reverse_move` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: inventory.stock.reverse_move
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            move_id:
              type: string
            bulk_id:
              type:
                - string
                - 'null'
            bulk_line:
              type:
                - integer
                - 'null'
            bulk_undo_of:
              type:
                - string
                - 'null'
          required:
            - move_id
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: inventory.stock.reverse_move
          depends_on: []
          created_at: '2026-11-02T10:00:00+00:00'
          payload:
            move_id: 0199a0d0-0000-7000-8000-00000000f002
            bulk_id: 0199a0d0-0000-7000-8000-00000000b001
            bulk_line: 1
            bulk_undo_of: 0199a0d0-0000-7000-8000-00000000b001
    SyncCommandInventoryTransfersCreate:
      type: object
      title: SyncCommandInventoryTransfersCreate
      description: The `inventory.transfers.create` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: inventory.transfers.create
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            from_location_id:
              type: string
            to_location_id:
              type: string
            lines:
              type: array
              items:
                type: object
                properties:
                  item:
                    type: string
                  quantity:
                    type: string
                  unit:
                    type:
                      - string
                      - 'null'
                  lot:
                    type:
                      - string
                      - 'null'
                  serials:
                    type: array
                    items:
                      type: string
                required:
                  - item
                  - quantity
            note:
              type:
                - string
                - 'null'
            id:
              type:
                - string
                - 'null'
          required:
            - from_location_id
            - to_location_id
            - lines
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: inventory.transfers.create
          depends_on: []
          created_at: '2026-11-02T10:00:00+00:00'
          payload:
            id: 0199a0d0-0000-7000-8000-00000000f002
            from_location_id: 0199a0d0-0000-7000-8000-000000000101
            to_location_id: 0199a0d0-0000-7000-8000-000000000102
            note: For the morning run
            lines:
              - item: 0199a0d0-0000-7000-8000-000000000201
                quantity: '4'
              - item: 0199a0d0-0000-7000-8000-000000000202
                quantity: '2'
    SyncCommandInventoryTransfersReceive:
      type: object
      title: SyncCommandInventoryTransfersReceive
      description: The `inventory.transfers.receive` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: inventory.transfers.receive
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            transfer_id:
              type: string
            lines:
              type: array
              items:
                type: object
                properties:
                  line_id:
                    type: string
                  quantity:
                    type: string
                  serials:
                    type: array
                    items:
                      type: string
                required:
                  - line_id
                  - quantity
          required:
            - transfer_id
            - lines
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: inventory.transfers.receive
          depends_on: []
          created_at: '2026-11-02T10:00:00+00:00'
          payload:
            transfer_id: 0199a0d0-0000-7000-8000-00000000f002
            lines:
              - line_id: 0199a0d0-0000-7000-8000-00000000f003
                quantity: '3'
    SyncCommandInventoryTransfersShip:
      type: object
      title: SyncCommandInventoryTransfersShip
      description: The `inventory.transfers.ship` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: inventory.transfers.ship
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            transfer_id:
              type: string
          required:
            - transfer_id
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: inventory.transfers.ship
          depends_on: []
          created_at: '2026-11-02T10:00:00+00:00'
          payload:
            transfer_id: 0199a0d0-0000-7000-8000-00000000f002
    SyncCommandInventoryVerificationsCancel:
      type: object
      title: SyncCommandInventoryVerificationsCancel
      description: The `inventory.verifications.cancel` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: inventory.verifications.cancel
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            verification_id:
              type: string
            reason:
              type: string
          required:
            - verification_id
            - reason
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: inventory.verifications.cancel
          depends_on: []
          created_at: '2026-11-02T10:00:30+00:00'
          payload:
            verification_id: 0199a0d0-0000-7000-8000-000000000401
            reason: Asked by mistake
    SyncCommandInventoryVerificationsCount:
      type: object
      title: SyncCommandInventoryVerificationsCount
      description: The `inventory.verifications.count` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: inventory.verifications.count
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            verification_id:
              type: string
            count:
              type:
                - string
                - 'null'
            lines:
              type: object
              additionalProperties:
                type: string
          required:
            - verification_id
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: inventory.verifications.count
          depends_on: []
          created_at: '2026-11-02T10:00:30+00:00'
          payload:
            verification_id: 0199a0d0-0000-7000-8000-000000000401
            count: '3'
    SyncCommandInventoryVerificationsDecline:
      type: object
      title: SyncCommandInventoryVerificationsDecline
      description: The `inventory.verifications.decline` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: inventory.verifications.decline
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            verification_id:
              type: string
            reason:
              type: string
          required:
            - verification_id
            - reason
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: inventory.verifications.decline
          depends_on: []
          created_at: '2026-11-02T10:00:30+00:00'
          payload:
            verification_id: 0199a0d0-0000-7000-8000-000000000401
            reason: Going off shift
    SyncCommandInventoryVerificationsReject:
      type: object
      title: SyncCommandInventoryVerificationsReject
      description: The `inventory.verifications.reject` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: inventory.verifications.reject
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            verification_id:
              type: string
            reason:
              type: string
          required:
            - verification_id
            - reason
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: inventory.verifications.count
          depends_on: []
          created_at: '2026-11-02T10:00:30+00:00'
          payload:
            verification_id: 0199a0d0-0000-7000-8000-000000000401
            count: '2'
    SyncCommandInventoryVerificationsRequest:
      type: object
      title: SyncCommandInventoryVerificationsRequest
      description: The `inventory.verifications.request` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: inventory.verifications.request
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            command:
              type: string
            payload:
              type: object
              additionalProperties: {}
            digest:
              type: string
            locale:
              type: string
          required:
            - command
            - payload
            - digest
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: inventory.verifications.request
          depends_on: []
          created_at: '2026-11-02T10:00:30+00:00'
          payload:
            command: inventory.stock.adjust
            payload:
              item: OXY-5
              location_id: 0199a0d0-0000-7000-8000-000000000301
              direction: issue
              quantity: '2'
              reason: damaged
            digest: abc
    SyncCommandInventoryVerificationsSubmit:
      type: object
      title: SyncCommandInventoryVerificationsSubmit
      description: The `inventory.verifications.submit` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: inventory.verifications.submit
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            command:
              type: string
            payload:
              type: object
              additionalProperties: {}
            digest:
              type: string
            locale:
              type: string
            performer_assertion:
              type: string
            witness_assertion:
              type: string
            attempts:
              type: array
              items:
                type: object
                properties:
                  at:
                    type: string
                    format: date-time
                  count:
                    type:
                      - string
                      - 'null'
                  lines:
                    type: object
                    additionalProperties:
                      type: string
                required:
                  - at
            failed_pins:
              type: array
              items:
                type: object
                properties:
                  role:
                    type: string
                  at:
                    type: string
                    format: date-time
                required:
                  - role
                  - at
          required:
            - command
            - payload
            - digest
            - locale
            - performer_assertion
            - witness_assertion
            - attempts
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: inventory.verifications.submit
          depends_on: []
          created_at: '2026-11-02T10:00:00+00:00'
          payload:
            command: inventory.stock.adjust
            payload:
              item: OXY-5
              location_id: 0199a0d0-0000-7000-8000-000000000301
              direction: issue
              quantity: '2'
              reason: damaged
            digest: 11e29cde467d3cde7dfbf4cccf925b590ec17dc5faccec79e2b8c4f7f9c1a99d
            locale: en
            performer_assertion: >-
              A JWS of type device-offline-signature+jwt the device key signed
              when the performer's PIN was checked, with the meaning PERFORMED
            witness_assertion: >-
              A JWS of type device-offline-signature+jwt the device key signed
              when the witness's PIN was checked, with the meaning WITNESSED
            attempts:
              - count: '3'
                at: '2026-11-02T09:11:00+00:00'
              - count: '2'
                at: '2026-11-02T09:11:40+00:00'
            failed_pins:
              - role: witness
                at: '2026-11-02T09:11:50+00:00'
    SyncCommandInventoryVerificationsWitness:
      type: object
      title: SyncCommandInventoryVerificationsWitness
      description: The `inventory.verifications.witness` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: inventory.verifications.witness
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            verification_id:
              type: string
            digest:
              type: string
            statement_digest:
              type: string
            locale:
              type: string
          required:
            - verification_id
            - digest
            - statement_digest
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: inventory.verifications.count
          depends_on: []
          created_at: '2026-11-02T10:01:00+00:00'
          payload:
            verification_id: 0199a0d0-0000-7000-8000-000000000401
            count: '2'
    SyncCommandLabelsSetsPrint:
      type: object
      title: SyncCommandLabelsSetsPrint
      description: The `labels.sets.print` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: labels.sets.print
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            lines:
              type: array
              items:
                type: object
                properties:
                  item:
                    type: string
                  quantity:
                    type: string
                  pieces:
                    type: integer
                  lot:
                    type:
                      - string
                      - 'null'
                  serial:
                    type:
                      - string
                      - 'null'
                required:
                  - item
                  - quantity
            bulk_id:
              type:
                - string
                - 'null'
          required:
            - lines
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: labels.sets.print
          depends_on: []
          created_at: '2026-11-02T10:00:00+00:00'
          payload:
            bulk_id: 0199a0d0-0000-7000-8000-00000000f002
            lines:
              - item: 0199a0d0-0000-7000-8000-000000000201
                quantity: '5'
                pieces: 3
              - item: 0199a0d0-0000-7000-8000-000000000202
                quantity: '1'
    SyncCommandManufacturingBuildsComplete:
      type: object
      title: SyncCommandManufacturingBuildsComplete
      description: The `manufacturing.builds.complete` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: manufacturing.builds.complete
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            build_id:
              type: string
            lot:
              type:
                - string
                - 'null'
            lot_expires_on:
              type:
                - string
                - 'null'
              format: date
            serials:
              type: array
              items:
                type: string
            as_recorded:
              type: boolean
            reasons:
              type: object
              additionalProperties:
                type: string
            links:
              type: array
              items:
                type: object
                properties:
                  output:
                    type: string
                  item:
                    type: string
                  lot:
                    type:
                      - string
                      - 'null'
                  serial:
                    type:
                      - string
                      - 'null'
                required:
                  - output
                  - item
          required:
            - build_id
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: manufacturing.builds.complete
          depends_on: []
          created_at: '2026-11-02T10:00:00+00:00'
          payload:
            build_id: 0199a0d0-0000-7000-8000-000000000601
            lot: B-2611
            lot_expires_on: '2028-01-31'
    SyncCommandManufacturingBuildsIssueParts:
      type: object
      title: SyncCommandManufacturingBuildsIssueParts
      description: The `manufacturing.builds.issue_parts` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: manufacturing.builds.issue_parts
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            build_id:
              type: string
            entries:
              type: array
              items:
                type: object
                properties:
                  line:
                    type: string
                  item:
                    type: string
                  quantity:
                    type: string
                  lot:
                    type:
                      - string
                      - 'null'
                  serials:
                    type: array
                    items:
                      type: string
                  reason:
                    type:
                      - string
                      - 'null'
                required:
                  - line
                  - item
                  - quantity
          required:
            - build_id
            - entries
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: manufacturing.builds.issue_parts
          depends_on: []
          created_at: '2026-11-02T10:00:00+00:00'
          payload:
            build_id: 0199a0d0-0000-7000-8000-000000000601
            entries:
              - line: 0199a0d0-0000-7000-8000-000000000604
                item: M4-10
                quantity: '4'
                lot: null
    SyncCommandManufacturingBuildsReportProblem:
      type: object
      title: SyncCommandManufacturingBuildsReportProblem
      description: The `manufacturing.builds.report_problem` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: manufacturing.builds.report_problem
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            build_id:
              type: string
            operation:
              type:
                - string
                - 'null'
            reason:
              enum:
                - material
                - machine
                - quality
                - instructions
                - other
            note:
              type: string
            id:
              type:
                - string
                - 'null'
          required:
            - build_id
            - reason
            - note
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: manufacturing.builds.report_problem
          depends_on: []
          created_at: '2026-11-02T10:00:00+00:00'
          payload:
            build_id: 0199a0d0-0000-7000-8000-000000000601
            operation: 0199a0d0-0000-7000-8000-000000000602
            reason: machine
            note: The saw stalls.
    SyncCommandManufacturingOperationsComplete:
      type: object
      title: SyncCommandManufacturingOperationsComplete
      description: The `manufacturing.operations.complete` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: manufacturing.operations.complete
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            build_id:
              type: string
            operation_id:
              type: string
            good_quantity:
              type: string
            scrap_quantity:
              type: string
            scrap_reason:
              type:
                - string
                - 'null'
            checks:
              type: array
              items:
                type: object
                properties:
                  check_id:
                    type: string
                  result:
                    enum:
                      - pass
                      - fail
                      - na
                  value:
                    type:
                      - string
                      - 'null'
                  note:
                    type:
                      - string
                      - 'null'
                required:
                  - check_id
                  - result
          required:
            - build_id
            - operation_id
            - good_quantity
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: manufacturing.operations.complete
          depends_on: []
          created_at: '2026-11-02T10:00:00+00:00'
          payload:
            build_id: 0199a0d0-0000-7000-8000-000000000601
            operation_id: 0199a0d0-0000-7000-8000-000000000602
            good_quantity: '2'
            checks:
              - check_id: length
                result: pass
                value: '400.2'
              - check_id: burr
                result: fail
                note: Deburred by hand
              - check_id: label
                result: na
    SyncCommandManufacturingOperationsPause:
      type: object
      title: SyncCommandManufacturingOperationsPause
      description: The `manufacturing.operations.pause` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: manufacturing.operations.pause
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            build_id:
              type: string
            operation_id:
              type: string
          required:
            - build_id
            - operation_id
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: manufacturing.operations.pause
          depends_on: []
          created_at: '2026-11-02T10:00:00+00:00'
          payload:
            build_id: 0199a0d0-0000-7000-8000-000000000601
            operation_id: 0199a0d0-0000-7000-8000-000000000602
    SyncCommandManufacturingOperationsStart:
      type: object
      title: SyncCommandManufacturingOperationsStart
      description: The `manufacturing.operations.start` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: manufacturing.operations.start
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            build_id:
              type: string
            operation_id:
              type: string
          required:
            - build_id
            - operation_id
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: manufacturing.operations.start
          depends_on: []
          created_at: '2026-11-02T10:00:00+00:00'
          payload:
            build_id: 0199a0d0-0000-7000-8000-000000000601
            operation_id: 0199a0d0-0000-7000-8000-000000000602
    SyncCommandPurchasingOrdersReceive:
      type: object
      title: SyncCommandPurchasingOrdersReceive
      description: The `purchasing.orders.receive` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: purchasing.orders.receive
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            order_id:
              type: string
            lines:
              type: array
              items:
                type: object
                properties:
                  order_line_id:
                    type: string
                  quantity:
                    type: string
                  unit:
                    type:
                      - string
                      - 'null'
                  status:
                    enum:
                      - available
                      - quarantined
                      - rejected
                  lot:
                    type:
                      - string
                      - 'null'
                  lot_expires_on:
                    type:
                      - string
                      - 'null'
                    format: date
                  serials:
                    type: array
                    items:
                      type: string
                  origin_country:
                    type:
                      - string
                      - 'null'
                required:
                  - order_line_id
                  - quantity
            received_on:
              type:
                - string
                - 'null'
              format: date
            note:
              type:
                - string
                - 'null'
            id:
              type:
                - string
                - 'null'
          required:
            - order_id
            - lines
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: purchasing.orders.receive
          depends_on: []
          created_at: '2026-11-02T10:00:00+00:00'
          payload:
            order_id: 0199a0d0-0000-7000-8000-000000000301
            received_on: '2026-11-02'
            note: Box 2 of 3
            lines:
              - order_line_id: 0199a0d0-0000-7000-8000-000000000302
                quantity: '6'
                lot: L-2611
                lot_expires_on: '2028-01-31'
                origin_country: DE
              - order_line_id: 0199a0d0-0000-7000-8000-000000000303
                quantity: '4'
                status: quarantined
    SyncCommandSalesOrdersShip:
      type: object
      title: SyncCommandSalesOrdersShip
      description: The `sales.orders.ship` command.
      properties:
        id:
          type: string
          format: uuid
          description: A UUIDv7 the device made. The idempotency key.
        name:
          type: string
          const: sales.orders.ship
        depends_on:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Ids of commands that must be finished first.
        created_at:
          type: string
          format: date-time
          description: The device clock. Advisory.
        payload:
          type: object
          properties:
            order_id:
              type: string
            lines:
              type: array
              items:
                type: object
                properties:
                  order_line_id:
                    type: string
                  quantity:
                    type: string
                  unit:
                    type:
                      - string
                      - 'null'
                  lot:
                    type:
                      - string
                      - 'null'
                  serials:
                    type: array
                    items:
                      type: string
                required:
                  - order_line_id
                  - quantity
            shipped_on:
              type:
                - string
                - 'null'
              format: date
            carrier:
              type:
                - string
                - 'null'
            tracking_number:
              type:
                - string
                - 'null'
            note:
              type:
                - string
                - 'null'
            packages:
              type: array
              items:
                type: object
                properties:
                  weight:
                    type: object
                    properties:
                      value:
                        type: string
                      unit:
                        type: string
                    required:
                      - value
                      - unit
                  length:
                    type:
                      - object
                      - 'null'
                    properties:
                      value:
                        type: string
                      unit:
                        type: string
                    required:
                      - value
                      - unit
                  width:
                    type:
                      - object
                      - 'null'
                    properties:
                      value:
                        type: string
                      unit:
                        type: string
                    required:
                      - value
                      - unit
                  height:
                    type:
                      - object
                      - 'null'
                    properties:
                      value:
                        type: string
                      unit:
                        type: string
                    required:
                      - value
                      - unit
                  package_preset_id:
                    type:
                      - string
                      - 'null'
                required:
                  - weight
            id:
              type:
                - string
                - 'null'
          required:
            - order_id
            - lines
      required:
        - id
        - name
        - created_at
        - payload
      examples:
        - id: 0199a0d0-0000-7000-8000-00000000f001
          name: sales.orders.ship
          depends_on: []
          created_at: '2026-11-02T10:00:00+00:00'
          payload:
            order_id: 0199a0d0-0000-7000-8000-000000000301
            shipped_on: '2026-11-02'
            carrier: UPS
            tracking_number: 1Z999AA10123456784
            note: Left at the dock
            lines:
              - order_line_id: 0199a0d0-0000-7000-8000-000000000302
                quantity: '6'
              - order_line_id: 0199a0d0-0000-7000-8000-000000000303
                quantity: '4'
            packages:
              - weight:
                  value: '1.2'
                  unit: kg
                length:
                  value: '30'
                  unit: cm
                width:
                  value: '20'
                  unit: cm
                height:
                  value: '10'
                  unit: cm
              - weight:
                  value: '0.4'
                  unit: kg
    CommandResultResource:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
          enum:
            - applied
            - rejected
            - deferred
        replayed:
          type: boolean
        result:
          description: >-
            The command's result, only when it ran in this request; null for a
            replay.
        result_ids:
          type: array
          items:
            type: string
        code:
          type:
            - string
            - 'null'
        message:
          type:
            - string
            - 'null'
        fields:
          type: object
          description: The invalid fields of a rejection, each with its messages.
          additionalProperties:
            type: array
            items:
              type: string
        retry_after:
          type:
            - integer
            - 'null'
      required:
        - id
        - status
        - replayed
        - result
        - result_ids
        - code
        - message
        - fields
        - retry_after
      title: CommandResultResource
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
    DeviceRequired:
      description: Device required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
    BatchTooLarge:
      description: Batch too large
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
  securitySchemes:
    apiKey:
      type: http
      description: >-
        For your own scripts and server-to-server integrations. Create a key in
        the app under Settings > Access > API keys and copy it then, because it
        is shown once. Send it as `Authorization: Bearer <key>`. The key acts as
        the member who made it, in the organization it was made in. A call needs
        the member's permission and one of the key's scopes, such as
        `inventory:read` or `sales:write`. A key with `*` has every scope.
      scheme: bearer
    oauth2:
      type: oauth2
      description: >-
        For apps that other people connect to their StockShift account. Use the
        OAuth 2.1 authorization code flow with PKCE (S256); there is no client
        secret. Discover the endpoints at
        `/.well-known/oauth-authorization-server` (RFC 8414) and register your
        app at `POST /oauth/register` (RFC 7591). The member chooses the
        organization and approves the scopes on the consent page, and the token
        can never do more than the member could. Send it as `Authorization:
        Bearer <token>`, as you would an API key. Access tokens last an hour;
        each refresh returns a new refresh token, so store it.
      flows:
        authorizationCode:
          authorizationUrl: https://app.stockshift.io/oauth/authorize
          tokenUrl: https://app.stockshift.io/oauth/token
          refreshUrl: https://app.stockshift.io/oauth/token
          scopes:
            access:read: Access read
            audit:read: Audit read
            address:read: Address read
            address:write: Address write
            billing:read: Billing read
            catalog:read: Catalog read
            catalog:write: Catalog write
            dashboard:read: Dashboard read
            dashboard:write: Dashboard write
            developer:read: Developer read
            developer:write: Developer write
            devices:read: Devices read
            devices:write: Devices write
            documents:read: Documents read
            documents:write: Documents write
            notifications:read: Notifications read
            notifications:write: Notifications write
            inventory:read: Inventory read
            inventory:write: Inventory write
            purchasing:read: Purchasing read
            purchasing:write: Purchasing write
            quality:read: Quality read
            quality:write: Quality write
            sales:read: Sales read
            sales:write: Sales write
            engineering:read: Engineering read
            engineering:write: Engineering write
            manufacturing:read: Manufacturing read
            manufacturing:write: Manufacturing write
            automation:read: Automation read
            automation:write: Automation write
            insights:read: Insights read
            insights:write: Insights write
            integrations:read: Integrations read
            integrations:write: Integrations write
            labels:read: Labels read
            labels:write: Labels write
            library:read: Library read
            organization:read: Organization read
            organization:write: Organization write
            planning:read: Planning read
            planning:write: Planning write
            sync:read: Sync read
            sync:write: Sync write

````

## Related topics

- [Record counted quantities](https://docs.stockshift.io/api-reference/stock-counts/record-counted-quantities.md)
- [Ask where a device stands](https://docs.stockshift.io/api-reference/mobile-apps/ask-where-a-device-stands.md)
- [Report that a device locked a member out of signing](https://docs.stockshift.io/api-reference/mobile-apps/report-that-a-device-locked-a-member-out-of-signing.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.