Getting Null value in price and value fields(product query)

Hi Tomas,
In the product query I’m getting null value in the price and value field but I have value in both fields can you please let me know what’s wrong?

Hi @madhupatel!
Is there any chance you could share the request_id you are getting when requesting those values by any chance?
Thanks in advance!
Tom

Hi @tomasw
Thanks for your response. 6010efe35501e487e68c229c is my request_id.

Hi @madhupatel
Thanks for that ID!
The reason you are seeing it null is that those fields (as well as value currency) are warehouse specific, so you will need to include them on the warehouse_products connection, like this:

query {
  products(updated_from: "2021-01-23") {
    request_id
    complexity
    data(first: 1000) {
      edges {
        cursor
        node {
          id
          legacy_id
          account_id
          name
          sku

          barcode
          country_of_manufacture
          dimensions {
            weight
            height
            width
            length
          }
          tariff_code
          tags
          warehouse_products {
            warehouse_id
            warehouse_identifier
            on_hand
            inventory_bin
            inventory_overstock_bin
            reserve_inventory
            replenishment_level
            reorder_amount
            reorder_level
            custom
            price
            value
            value_currency
          }
        }
      }
    }
  }
}

Let me know if that still doesn’t work.
Thanks again!
Tom

2 Likes

Hi @tom
Thanks for the above solution it worked for me.
I have one more question for you can we get the Cost Of Goods Report via API?
I have attached 2 images for reference, Please have a look at the images to know what I want to achieve from API.
If it is possible, Please provide me a query for the same.
Thanks again!
Madhu Patel

Hi @madhupatel
Thanks for that explanation!
Unfortunately, this is not available on the Public API. The calculation for this is done internally, and to be able to achieve this using data from the Public API you would need to get all the information for each product and order, and that might be super expensive to achieve.
I apologize for the inconvenience but this won’t be available on the Public API any time soon
Thanks again!
Tom