Is it possible to get the cost via REST API?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #89564
    York Ortiz Menendez
    Participant

    Hi guys,

    Nice work, I’m building my own report on google sheets and I’m using integromat
    (https://www.integromat.com) to import data from woocommerce via API. The only element missing on my report to be completed is the cost of goods. Could you please help me on how can automatically integrate this value into my report.

    Is there a specific place that this data can be accesible through woocommerce API, i have checked everywhere and don’t find it.

    Do you have any API or other method i could use to import the cost of goods?

    Look forward to hearing from you

    #89565
    York Ortiz Menendez
    Participant

    Hi Guys,

    Any answer on this matter?

    #89566
    Zohaib
    Participant

    Hi

    If you have installed the plugin, you can import product costs.

    In your WordPress dashboard, under the tools menu you will find an option for importing costs and bulk editing costs

    #89567
    WPFactory Plugins
    Participant
    Plugin Author

    Hello York,

    Our cost meta is already available via REST API. For example it’s possible to get a product with ID 123 using this route:

    http://example.com/wp-json/wc/v3/products/123

    The cost will be available over the meta_data array.
    The key name is _alg_wc_cog_cost

    I’ve never tried Integromat but probably this info should be also available on their end as the cost value is stored as a simple product meta.

    #90684
    Pablo
    Moderator
    Plugin Support

    Just a note,

    It’s possible to get the order cost like this:

    http://example.com/wp-json/wc/v3/orders/456

    The order cost meta (_alg_wc_cog_order_cost) will be available on the meta_data node.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.