• Resolved jesse4liberate

    (@jesse4liberate)


    Hi,

    I am looking for a way to make certain attributes mandatory when creating a product via the API. That is, for the API to return a code 400 and a message along the lines of “required attributes missing” when the JSON body sent to the products endpoint doesn’t include these attributes.

    Any ideas?

    Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Mirko P.

    (@rainfallnixfig)

    Hi there,

    At the moment, there’s no default option to make product attributes mandatory via REST API, and customizing that would require a bit of additional coding. Custom coding goes beyond the scope of support we are able to provide in this forum.

    If you require more help with the actual coding, we’d recommend hiring a developer or one of the customization experts listed at https://woocommerce.com/customizations/.

    That said, I’m going to leave this thread open for a bit to see if anyone is able to chime in to help you out.

    You can also visit the WooCommerce Facebook Community 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.

    Mirko P.

    (@rainfallnixfig)

    Hi there,

    We’ve not seen any activity on this thread for a while, so I’m marking it as resolved.

    Hopefully, you were able to find a solution and the above resources for developers were helpful. If you have further questions, please feel free to open a new topic.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘make attributes mandatory when creating product via API’ is closed to new replies.