• Hi,

    I’ve operated shopping page with woocommerce. And now trying to develop an app for customers.

    So I’m digging woocommerce REST API.

    BTW,

    I can’t figure out how can I create an order of variable products by API.

    curl -X POST https://example.com/wc-api/v3/orders \
    -u consumer_key:consumer_secret \
    -H “Content-Type: application/json” \
    -d ‘{
    (skip)
    “line_items”: [
    {
    “product_id”: 546,
    “quantity”: 2
    },
    {
    “product_id”: 613,
    “quantity”: 1,
    “variations”: {
    “pa_color”: “Black”
    }
    }
    ],

    This is an example of create a paid order from woocommerce REST API document.

    Without variation product, I can create an order with API. But with any variable item, I only got this message.

    “errors”:[{“code”:”woocommerce_api_missing_callback_param”,”message”:”\uc5c6\ub294 \ub9e4\uac1c\ubcc0\uc218 data”

    Even if I created new attribute named “color” and variation “Black” to follow the example exactly, it keeps failed.

    How can I solve this problem?

    I appreciate your attention and help in advance.

  • The topic ‘woocommerce creat an order of variable products by API’ is closed to new replies.