{
 "openapi": "3.1.0",
 "info": {
  "title": "Movement History (Supply Chain)",
  "version": "20261030b",
  "description": "One movement in progress. Scan a barcode, wave a tag or photograph the pallet; the platform decodes it, checks it and posts it. Every kind of movement is the same three steps."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "scan-sessions": {
    "type": "object",
    "required": [
     "movement_type"
    ],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "session_no": {
      "type": "string",
      "description": "Session no",
      "readOnly": true
     },
     "movement_type": {
      "type": "string",
      "description": "Movement"
     },
     "capture_mode": {
      "type": "string",
      "description": "Captured by"
     },
     "warehouse_id": {
      "type": "string",
      "format": "uuid",
      "description": "Warehouse"
     },
     "bin_id": {
      "type": "string",
      "format": "uuid",
      "description": "Bin"
     },
     "to_bin_id": {
      "type": "string",
      "format": "uuid",
      "description": "Destination bin"
     },
     "reference_type": {
      "type": "string",
      "description": "Against what",
      "enum": [
       "purchase_order",
       "delivery",
       "work_order",
       "asn",
       "wms",
       "none"
      ]
     },
     "reference_id": {
      "type": "string",
      "format": "uuid",
      "description": "Reference id"
     },
     "reference_no": {
      "type": "string",
      "description": "Reference number"
     },
     "supplier_id": {
      "type": "string",
      "format": "uuid",
      "description": "Supplier"
     },
     "reason_code": {
      "type": "string",
      "description": "Reason"
     },
     "device_id": {
      "type": "string",
      "description": "Device"
     },
     "operator_id": {
      "type": "string",
      "format": "uuid",
      "description": "Operator id"
     },
     "reader_id": {
      "type": "string",
      "format": "uuid",
      "description": "RFID reader"
     },
     "wms_system_id": {
      "type": "string",
      "format": "uuid",
      "description": "Wms system id",
      "readOnly": true
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "scan_count": {
      "type": "integer",
      "description": "Scan count",
      "readOnly": true
     },
     "accepted_count": {
      "type": "integer",
      "description": "Accepted count",
      "readOnly": true
     },
     "rejected_count": {
      "type": "integer",
      "description": "Rejected count",
      "readOnly": true
     },
     "posted_count": {
      "type": "integer",
      "description": "Posted count",
      "readOnly": true
     },
     "total_quantity": {
      "type": "string",
      "format": "decimal",
      "description": "Total quantity",
      "readOnly": true
     },
     "manual_count": {
      "type": "integer",
      "description": "Manual count",
      "readOnly": true
     },
     "cost_center_id": {
      "type": "string",
      "format": "uuid",
      "description": "Cost center"
     },
     "journal_id": {
      "type": "string",
      "format": "uuid",
      "description": "Journal id",
      "readOnly": true
     },
     "posted_at": {
      "type": "string",
      "format": "date-time",
      "description": "Posted at",
      "readOnly": true
     },
     "posted_by": {
      "type": "string",
      "format": "uuid",
      "description": "Posted by",
      "readOnly": true
     },
     "notes": {
      "type": "string",
      "description": "Notes"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "document_date": {
      "type": "string",
      "format": "date",
      "description": "Document date"
     },
     "posting_date": {
      "type": "string",
      "format": "date",
      "description": "Posting date"
     },
     "delivery_note": {
      "type": "string",
      "description": "Delivery note"
     },
     "bill_of_lading": {
      "type": "string",
      "description": "Bill of lading"
     },
     "material_slip": {
      "type": "string",
      "description": "Material slip"
     },
     "unloading_point": {
      "type": "string",
      "description": "Unloading point"
     },
     "goods_recipient": {
      "type": "string",
      "description": "Goods recipient"
     },
     "header_text": {
      "type": "string",
      "description": "Header text"
     },
     "item_text": {
      "type": "string",
      "description": "Item text"
     },
     "wbs_element": {
      "type": "string",
      "description": "Wbs element"
     },
     "gl_account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Gl account id"
     },
     "label_printer": {
      "type": "string",
      "description": "Label printer"
     },
     "label_copies": {
      "type": "integer",
      "description": "Label copies"
     },
     "reverses_id": {
      "type": "string",
      "format": "uuid",
      "description": "Reverses id",
      "readOnly": true
     },
     "xf_text_1": {
      "type": "string",
      "description": "Xf text 1",
      "readOnly": true
     },
     "xf_text_2": {
      "type": "string",
      "description": "Xf text 2",
      "readOnly": true
     },
     "xf_text_3": {
      "type": "string",
      "description": "Xf text 3",
      "readOnly": true
     },
     "xf_text_4": {
      "type": "string",
      "description": "Xf text 4",
      "readOnly": true
     },
     "xf_text_5": {
      "type": "string",
      "description": "Xf text 5",
      "readOnly": true
     },
     "xf_num_1": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 1",
      "readOnly": true
     },
     "xf_num_2": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 2",
      "readOnly": true
     },
     "xf_num_3": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 3",
      "readOnly": true
     },
     "xf_date_1": {
      "type": "string",
      "format": "date",
      "description": "Xf date 1",
      "readOnly": true
     },
     "xf_date_2": {
      "type": "string",
      "format": "date",
      "description": "Xf date 2",
      "readOnly": true
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/scm/scan-sessions": {
   "get": {
    "summary": "list scan-sessions",
    "operationId": "list_scan_sessions_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create scan-sessions",
    "operationId": "create_scan_sessions_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/scan-sessions/{id}": {
   "get": {
    "summary": "get scan-sessions",
    "operationId": "get_scan_sessions_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change scan-sessions",
    "operationId": "change_scan_sessions_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete scan-sessions",
    "operationId": "delete_scan_sessions_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/scan-sessions/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_scan_sessions_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/scan-sessions/{id}/scan": {
   "post": {
    "summary": "Scan",
    "operationId": "action_scan_sessions_0_6",
    "description": "Body keys: code, itemId, itemNo; scans: [{ code, itemNo, source, itemId, hint, quantity, lotNo, serialNo, binId, uom, expiryDate, unitCost, confidence }]",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/scan-sessions/{id}/capture-image": {
   "post": {
    "summary": "Capture image",
    "operationId": "action_scan_sessions_0_6",
    "description": "Body keys: image*, mediaType, note",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/scan-sessions/{id}/post": {
   "post": {
    "summary": "Post",
    "operationId": "action_scan_sessions_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/scan-sessions/{id}/cancel": {
   "post": {
    "summary": "Cancel",
    "operationId": "action_scan_sessions_0_6",
    "description": "Body keys: reason*",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/scan-sessions/{id}/export": {
   "post": {
    "summary": "Export",
    "operationId": "action_scan_sessions_0_6",
    "description": "Body keys: wmsSystemId",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/scan-sessions/{parentId}/events": {
   "get": {
    "summary": "Events",
    "operationId": "action_scan_sessions_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Events",
    "operationId": "action_scan_sessions_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/scan-sessions/{parentId}/events/{lineId}": {
   "put": {
    "summary": "Events",
    "operationId": "action_scan_sessions_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Events",
    "operationId": "action_scan_sessions_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}