• Resolved nvhdab

    (@nvhdab)


    We have thoroughly revised docs/api for Product Add Ons version 3.0.32 latest as of the date of this post (link to API Docs here).

    So far we’ve been able to execute successfully some operations.

    But we are finding the following difficulty: there’s no way to change price_type on the options of Product Add Ons plugin via API.

    Automattic and Woocommerce don’t cover these specifics and when sending the price_type, e.g.:

    PATCH {{wc-url}}/wp-json/wc-product-add-ons/v1/product-add-ons/{{product_id}}

    {
        "fields": [
            {
    		    "name": "Extras Producto",
                "description": "",
                "type": "checkbox",
                "position": 0,
                "required": 0,
                "options": [
                    {
                        "label": "Queso",
                        "price": "675",
                        "price_type": "flat_fee"
                    },
                    {
                        "label": "Aguacate",
                        "price": "775",
                        "price_type": "flat_fee"
                    }
                ]
            }
        ]
    }

    We get this error:

    
    {
        "code": "woocommerce_product_add_ons_rest__invalid_parameter",
        "message": "Invalid value given for 'fields': Invalid value given for 'options': Unexpected key 'price_type' was provided.",
        "data": {
            "status": 400
        }
    }

    IMAGE of this issue https://drive.google.com/file/d/1jKut-oNZd6yAiBbsc7obBwGyjmp9wAGv/view?usp=sharing

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi, @nvhdab,

    This is a fairly complex development topic that’s specific to the https://woocommerce.com/products/product-add-ons/?aff=10486&cid=1131038. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out, but you may have better results in the following places for more development-oriented questions:

    1. WooCommerce Slack Community: https://woocommerce.com/community-slack/
    2. WooCommerce FB group: https://www.facebook.com/groups/advanced.woocommerce/
    Thread Starter nvhdab

    (@nvhdab)

    That was fast Mike! Thanks for the recommendation, I just posted the issue on the Facebook Group: https://www.facebook.com/groups/advanced.woocommerce/permalink/3484782188202842/

    Thread Starter nvhdab

    (@nvhdab)

    Guys, additional API Docs Alert, {{wc-url}}/wp-json/wc/v1/product-add-ons/order/{{id-product}} is not working!

    As per Product Add Ons API Docs (docs/api/orders.md) the route wp-json/wc/v1/product-add-ons/order/ should retrieve or Get the Add-ons for Items in an Order… but it’s not working on version 3.0.32 latest as of the date of this post.

    Instead, we are getting this error:

    {
        "code": "rest_no_route",
        "message": "No route was found matching the URL and request method",
        "data": {
            "status": 404
        }
    }

    I’ve also posted this on Facebook. Looks like API for this plugin has some issues ??

    Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    Seeing as this relates to one of our extensions – would you mind opening a support ticket directly at https://woocommerce.com/my-account/tickets ? If needed, we’d be happy to rope in our Product Add-ons developers to take a closer look.

    In the meantime, I’m also going to close this thread as the forum here is focused on the core aspects of the WooCommerce plugin only.

    Thanks!

    Thread Starter nvhdab

    (@nvhdab)

    Hi RK @riaanknoetze thanks for noticing our request.

    We had already opened a support request (ticket #2954616) on woocommerce.com but they had suggested to post our request here on the forums… we purchased the plugin for a customer and are looking forward to understand if the API is fully usable as expected so we can go ahead and use this plugin for future implementations.

    I just updated our ticket with your latest reply on this forum asking them to re-review the case. Hopefully we can sort this out soon.

    Regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Unexpected key price_type for Product Add Ons Woocommerce Plugin API Call’ is closed to new replies.