Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #4514249
API documentation
Open

Comments

  •  1
    Michael started the conversation

    Hello,

    how must i send composite products data to the WooCommerce Product API in order to create or update a composite product?

    Can you show me a minimal POST request how to achieve this?

    Thank you and best regards
    Michael

  •  1,561
    Dustin replied

    Hi Michael,

    We save the settings for the composite to post_meta like this:

    2470641108.png

    Therefore, you can update the settings as you wish. However, the data for the component products stored in 'wooco_components' is very complex. Here is an example:

    {
        "prry": {
            "name": "Component 01",
            "desc": "",
            "type": "products",
            "orderby": "default",
            "order": "default",
            "products": [
                "_sku_woo-cap",
                "421"
            ],
            "optional": "yes",
            "price": "90%",
            "qty": "1",
            "custom_qty": "yes",
            "min": "0",
            "max": "1000",
            "m_min": "0",
            "m_max": "1000",
            "multiple": "yes",
            "selector": "list"
        },
        "qv77": {
            "name": "Component 02",
            "desc": "",
            "type": "product_cat",
            "orderby": "default",
            "order": "default",
            "other": [
                "music"
            ],
            "products": [
                "_sku_woo-cap",
                "421"
            ],
            "exclude": [
                "_sku_woo-album"
            ],
            "optional": "yes",
            "price": "",
            "qty": "1",
            "custom_qty": "yes",
            "min": "0",
            "max": "1000",
            "m_min": "0",
            "m_max": "1000",
            "multiple": "no",
            "selector": "default"
        }
    }

    Best regards,
    Dustin

  •  1
    Michael replied

    Thanks, Dustin