Skip to content
Developerhome
X3

Example GraphQL queries for Stock

  Less than to read

Stock transactions query

{
  xtremX3Stock {
    stockTransaction {
      query {
        totalCount
        edges {
          node {
            _id
            code
            transactionType
            localizedDescription
            document
            defaultStockMovementGroup {
              _id
              code
              description
              shortDescription
              defaultValue
            }
            printingMode
            identifier1Detail
            identifier2Detail
            identifier1Entry
            identifier2Entry
            supplierLot
            stockAutomaticJournal
            isActive
            preloadedQuantity
            identifier1Destination
            identifier2Destination
          }
        }
      }
    }
  }
}

Stock count list query

{
  xtremX3Stock {
    stockCountList {
      query {
        totalCount
        edges {
          node {
            _id
            stockCountSessionNumber {
              _id
              stockCountSession
              stockCountSessionDescription
              stockCountSessionType
              stockCountSessionMode
              stockCountSessionStatus
              stockCountDate
              stockCountSortCode
              isGlobal
            }
            stockCountListNumber
            stockCountListDescription
            stockCountDate
            stockSite {
              _id
              code
              name
              isStockSite
            }
            stockCountListStatus
            stockCountListStatusDate
            isStockCountLocked
            numberOfLines
            stockCountOperator
            allocationDate
            movementDescription
            warehouse {
              _id
              code
              description
              shortDescription
              exportNumber
            }
            lastAllocationDate
            exportNumber
          }
        }
      }
    }
  }
}

Stock change by Licence Plate Number query

{
  xtremX3Stock {
    stockChangeByLpn {
      query {
        edges {
          node {
            id
            stockChangeDestination
            stockSite {
              code
              name
              isStockSite
            }
            project {
              id
            }
            effectiveDate
            documentDescription
            transactionType
            exportNumber
            importLine
            transportDocumentType
            destinationCode
            licensePlateNumberOperationMode
            stockChangeByLicencePlateNumberOrigin
            transactionCode
            stockChangeLines{
              query{
                edges{
                  node {
                    lineNumber
                    stockSite
                    statusDestination
                    exportNumber
                    importLine
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Stock count Serial Number query

{
  xtremX3Stock {
    stockCountSerialNumber {
      query {
        edges {
          node {
            stockCountSessionNumber
            stockCountListNumber {
              stockCountListNumber
              stockCountListDescription
              stockCountDate
              stockCountListStatus
              stockCountListStatusDate
              isStockCountLocked
              numberOfLines
              stockCountOperator
              allocationDate
              movementDescription
              lastAllocationDate
              exportNumber
            }
            serialNumberSequenceNumber
            serialNumberIndexNumber
            startingSerialNumber
            endingSerialNumber
            quantity
            stockCountVariance
            stockSite {
              code
              name
              isStockSite
            }
            
          }
        }
      }
    }
  }
}

Stock miscellaneous receipt with lines mutation (not executable on the read-only demo endpoint)

mutation {
  xtremX3Stock {
    miscellaneousReceipt {
      create(data:
        { 
          # Header information
          stockSite: "AO011",
          effectiveDate: "2020-12-30",
          
          # Line details
          miscellaneousReceiptLines: [
            
            # First line, product DIS004, quantity 230
            {stockSite: "AO011", product: "DIS004", quantityInPackingUnit: "230", packingUnit: "UN",
              
              # Sub-details: 200 in status 1, 30 in status Q
              stockDetails: [
                {quantityInPackingUnit: "200", packingUnit: "UN", location: "A1C11", status: "A"},
                {quantityInPackingUnit: "30", packingUnit: "UN", location: "A1C11", status: "Q"}
                            ]},

            # Second line: product DIS008, quantity 158, a unique sub-detail line (status A)
            {stockSite: "AO011", product: "DIS008", quantityInPackingUnit: "158", packingUnit: "UN",
              stockDetails: [
                {quantityInPackingUnit: "158", packingUnit: "UN", location: "A1C12", status: "A"}
                            ]},

            # Third line: product CON006, quantity 1, a unique sub-detail line (a serial number)

            {stockSite: "AO011", product: "CON006", quantityInPackingUnit: "1", packingUnit: "UN",
              stockDetails: [
                {quantityInPackingUnit: "1", packingUnit: "UN", serialNumber: "ABC082",
                location: "A1C11", status: "A"}
                            ]
            }                        ]})
      
      # If successful, return the id of the receipt and the effective date
      {
        id
        effectiveDate
      }
    }
  }
}

Stock miscellaneous issue with line mutation (not executable on the read-only demo endpoint)

mutation {
  xtremX3Stock {
    miscellaneousIssue {
      create(data:
        {
          stockSite: "AO011", effectiveDate: "2021-02-05",
          miscellaneousIssueLines: [
            {stockSite: "AO011", product: "DIS004", packingUnit: "UN",
              packingUnitToStockUnitConversionFactor: "1",
              quantityInPackingUnit: "100",
              stockDetails:[
                {packingUnit: "UN", packingUnitToStockUnitConversionFactor: "1",
                  quantityInPackingUnit: "100", location: "A1C11", status: "A"},
              ]}]})
      {
        id
      }
    }
  }
}

Location reorder mutation example for replenishment reorder (not executable on the read-only demo endpoint)


mutation {
    xtremX3Stock {
        stockReorder {
            reorderStock (stockEntryTransaction: "REP",
              documentNumber: "PARNA0110006",
              documentLine: 4968,
              stockSite: "NA011",
              destinationLocation: "REO001",
              source: 1,
              stockId: 11042,
              stockSequence: 99999998,
              product: "ADC-SERIAL-PRODUCT3",
              fromLocation: "ADC03",
              lot: "",
              sublot: "",
              serialNumber: "202",
              status: "A",
              identifier1: "",
              identifier2: "",
              licensePlateNumber: "",
              packingUnit: "UN",
              packingUnitToStockUnitConversionFactor: 1,
              packingQuantity: 5)
        }
    }
}

Putaway transaction for a tracked product (not executable on the read-only demo endpoint)

mutation {
  xtremX3Stock {
    storageDetails {
      processPutaway (
        stockEntryTransaction: "STD",
        storageSite: "NA021",
        stockId: 14285,
        documentType: 6,
        documentNumber: "RECNA0210511",
        documentLineNumber: 1000,
        storageSequenceNumber: 1,
        quantityInPackingUnit: 2,
        quantityInStockUnit: 2,
        lot: "LO2004NA0210003",
        sublot: "00001",
        startingSerialNumber: "RLF00018",
        endingSerialNumber: "RLF00019",
        status: "A",
        container: "CTR00001",
        licensePlateNumber: "BAG00001",
        location: "QUA01",
        locationType: "CQU",
        labelDestination: "PRT00001"
      )
    }
  }
}

Pick transaction for a pick ticket line with a quantity of 10 with lot controlled product (not executable on the read-only demo endpoint)

mutation {
    xtremX3Stock {
        pickTicketLine {
            updatePickTicketLine(
                entryTransaction: "STD"
                pickTicket: "PKT00000008"
                pickTicketLineId: 1
                productCode: "L-GLUTAMINE800"
                isShortPick: false
                isDeliverable: false
                destinationLocation: ""
                documentDestination: ""
                allocations: [
                    { sequenceNumber: 1, location: "STO05", lot: "202003100", quantityInStockUnit: 10, status: "A" }
                ]
            )
        }
    }
}

Internal stock change mutation

mutation {
    xtremX3Stock {
        stockChange {
            create(
                data: {
                    stockSite: "ATS01"
                    effectiveDate: "2020-09-03"
                    transportDocumentType: "SCS"
                    stockChangeDestination: internal
                    isLocationChange: true
                    isStatusChange: true
                    isPackingUnitChange: false
                    documentDescription: "Test TS"
                    stockMovementGroup: "010"
                    stockMovementCode: "CHS"
                    stockChangeLines: [
                        {
                            product: "ATS-LOTEMP"
                            productDescription: "Description ATS-LOTEMP"
                            lot: "LOT1108"
                            status: "A"
                            location: "SAPI001"
                            licensePlateNumber: "LPN00001"
                            packingUnit: "UN"
                            packingUnitToStockUnitConversionFactor: "1"
                            quantityInPackingUnit: "1"
                            quantityInStockUnitDestination: "1"
                            locationDestination: "A1C01"
                            statusDestination: "A1"
                            movementDescription: "Changement de stock"
                        }
                    ]
                }
            ) {
                id
            }
        }
    }
}

Stock count mutation

mutation {
    xtremX3Stock {
        stockCountListDetail {
            processCount(
                stockCountSessionNumber: "NA0212100008"
                stockCountListNumber: "NA0212104002"
                productRankNumber: 0
                product: "PROD1"
                licensePlateNumber: "LPN00001"
                location: "QUA01"
                lot: "PROD1LOT01"
                sublot: "00001"
                serialNumber: "PROD1SER01"
                status: "A"
                majorVersion: "01"
                minorVersion: "03"
                packingUnit: "BAG"
                packingUnitToStockUnitConversionFactor: 5
                countedStockInPackingUnit: 2
                multiCountNumber: 0
            )
        }
    }
}

Inter-site stock change mutation

mutation {
    xtremX3Stock {
        stockChange {
            create(
                data: {
                    stockChangeDestination: intersite
                    stockSite: "NA011"
                    effectiveDate: "2021-05-11"
                    transportDocumentType: "SCI"
                    stockSiteDestination: "NA012"
                    isStatusChange: false
                    isPackingUnitChange: false
                    stockChangeLines: [
                        {
                            product: "BMS001"
                            stockSite: "NA011"
                            packingUnit: "UN"
                            quantityInPackingUnit: 1
                            packingUnitToStockUnitConversionFactor: 1
                            status: "A"
                            packingUnitDestination: "UN"
                            quantityInStockUnitDestination: 1
                            location: "STO03"
                            locationDestination: "FLR06"
                        }
                    ]
                }
            ) {
                _id
            }
        }
    }
}

Stock change by Licence Plate Number mutation

mutation {
    xtremX3Stock {
        stockChangeByLpn {
            create(
                data: {
                    stockSite: "ATS01"
                    effectiveDate: "2021-04-21"
                    stockChangeDestination: internal
                    stockChangeByLicencePlateNumberOrigin: 1
                    documentDescription: "Test TS LPN"
                    transactionCode: "LPN"
                    stockChangeLines: [
                        {
                            stockSite: "ATS01"
                            licensePlateNumber: "LPN00001"
                            location: "REF001"
                        }
                    ]
                }
            ) {
                id
            }
        }
    }
}

Subcontract transfer mutation

mutation {
    xtremX3Stock {
        stockChange {
            create(
                data: {
                    stockSite: "StockSite"
                    effectiveDate: "yyyy-mm-dd"
                    transportDocumentType: "SCT"
                    stockChangeDestination: subcontractTransfer
                    isStatusChange: true
                    isPackingUnitChange: true
                    documentDescription: "Description"
                    stockMovementGroup: "010"
                    stockMovementCode: "CHS"
                    subcontractor: "AO051"
                    subcontractorAddress: "001"
                    subcontractLocation: "SST01"
                    stockChangeLines: [
                        {
                            product: "productCode"
                            productDescription: "Description Product"
                            lot: "LOT1108"
                            status: "A"
                            location: "SAPI001"
                            packingUnit: "UN"
                            packingUnitToStockUnitConversionFactor: "1"
                            quantityInPackingUnit: "6"
                            quantityInStockUnitDestination: "6"
                            statusDestination: "A1"
                            packingUnitDestination: "CAR"
                            packingUnitToStockUnitConversionFactorDestination: "6"
                            movementDescription: "Movement description"
                        }
                    ]
                }
            ) {
                id
            }
        }
    }
}

Renumber stock count list mutation

mutation {
  xtremX3Stock {
    stockCountListDetail {
      renumberCountList (
        stockCountSessionNumber: "NA0212100008",
        stockCountListNumber: "NA0212104002",
      )
    }
  }
}