Retrieving all product stock quantities through REST API

Hello there, I'm attempting to export product and matching quantity data from X3 using the REST API. I am successfully pulling generic product information using the default ITMMASTER representation, however I can't seem to find the representation which exposes product stock quantities and locations.

I'm also able to pull sites which house a certain product via the ITMFACILIT representation, but I'm not sure how to connect the site information from that data to a particular quantity count.

Can someone please help me locate the representation which I can use to access this information?

Thank you,

  • 0

    Have you look at ITMWRH representation.


    This is the same representation used on Read-only page called Product Warehouses, which is under Read-only pages, Common Data, Product warehouses


    This representation on detail facet has some quantities

  • 0 in reply to Esfahani
    I have looked at that representation, yes, but it does not seem to contain data that matches what I'm seeing in the front-end. The sample data has a product BMS001 with 460 quantity at site AO012, but that data cannot be found by querying the ITMWRH representation.

    I received an email from Sage support yesterday regarding this issue:

    "There is no standard template available for products with location and QTYs on hand that matches your request. Instead you need to create a custom template with the requested information. The new/modified template should have the STOCK table in it with the requested fields for QTY and Location. The STOCK table has the item reference, location and location type, QTY, LOT, SATUS among other fields.

    If you need assistance creating new templates, you might want to contact your partner or Sage Professional services."

    So it looks like inventory quantities are not available through the standard API, which is absolutely insane.

    Thanks for your help anyway, I'll have to figure something out with the client because this is now becoming something that future clients will need to set up in advance of our integration. Terrible.
  • 0 in reply to Eric_B
    Try STKCNSSDIM representation, it shows 460 qty for AO012.
  • 0 in reply to Esfahani

    Hi, very good, but How we can apply the X3 Logic, what I mean is: In X3 we have STKLIB where exist some subprogs that help us to get the avaiable stock:

    # STODISMOD Stock disponible d'un article en modif d'entrée
    # exploite le statut de la ligne à modifier
    # STOPRETOT Stock disponible prévisionnel d'un article
    # STODISTOT Stock disponible d'un article
    # STODISPO Stock disponible d'un article filtré par lot,emp,statut,dépôt
    # STODIS Stock disponible d'une ligne de stock
    # STODISSOR Stock disponible d'une ligne de stock pour sortie
    # STODISFIFO Stock disponible fifo
    # STOECCVAL Stock article site d'une version

    This representation I think we get the ITMMVT. 

    Then how we can reuse this kinf of TRT libs via REST API? is possible to convert to a webservice in the same way you can do with SOAP? 

    Best regards to everybody!