• Resolved hampalm1

    (@hampalm1)


    Hi
    My site is a simple listings directory. Among other things I list holiday villas and the partner I work with updates me with prices and availability. They have no added an api to their site to send out or make these updates available to other websites automatically. They need me to integrte with their api but I have no idea what I’m dfoing. I believe woocommerce has api integration built in but the guide refers to creating keys for other people to hook in to my website, so that implies to me that this is for me to share data with other sites as opposed to connecting to another sites api for them to share data with me. Can anyone help advise on this please ?

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • You can add/edit products with the API – however you will need a mechanism to connect to the supplier API and send the data to yours.

    Tools like Zapier, Make or N8N can do this without a huge amount of coding.

    If you have a developer available N8N is a great option as you can install and use the open source version yourself. They also have a Windows/Mac desktop app that you can use too.

    Thread Starter hampalm1

    (@hampalm1)

    Thank you so much for the advice but I am not a coder and have to find a way to do this for free. I dont suppose there any guide that can guide me through copying and pasting code required to achieve this is there ?

    Kind regards, Andrew

    Saif

    (@babylon1999)

    Hello @hampalm1,

    You can update a product using the following API call:
    PUT /wp-json/wc/v3/products/<id>

    In python the setup should look something like this to update a price for example:

    from woocommerce import API
    
    wcapi = API(
        url="https://SiteURL.com",
        consumer_key="ck_######",
        consumer_secret="cs_#######",
        version="wc/v3"
    )
    data = {
        "regular_price": "24.54"
    }
    
    print(wcapi.put("products/794", data).json())

    Documentation

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Cheers!

    Thread Starter hampalm1

    (@hampalm1)

    Thank you Saif

    I am a complete layman but I’m not sure we are talking about the same thing. My partner has added an api to their site for me to connect to which ensure any changes they make to holiday rentals that i list on my site are automatically updated on my site as well e.g. pricing and availability. I dont know if that means they push changes or i call them when I look at a calendar which gives prices. I’m starting to think this is just going to be too complex for me but any input is appreciated. Thanks, Andrew

    Sounds like they have an API available that you can access and retrieve the data you need.

    To show a calendar and allow customers to pick date’s to retrieve prices is a pretty complex thing to create yourself. I’m currently setting up a site that will use N8N to update price and stock on normal products from a supplier API – that’s fairly easy to do. Personally I wouldn’t know where to start with a booking form!!

    Do they have some form of embeddable widget that can be added? If not, then you’d need a developer to look at it for you!

    Hi @hampalm1

    In addition to what was mentioned above, these forums are meant for general support with the core functionality of WooCommerce itself. What you want to achieve is a bit complex and would require customization to do it. Since custom coding is outside our scope of support, I am leaving this thread open for a bit to see if anyone can chime in to help you out.

    For questions related to development and custom coding, your best bet is to ask on any of these channels for support. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, too.

    WooCommerce Community Forum
    – Hire a WooCommerce Expert

    Hope this helps!

    Thread Starter hampalm1

    (@hampalm1)

    OK, thanks a lot

    Kind regards

    Andrew

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘API Integration’ is closed to new replies.