• Resolved miadkol

    (@miadkol)


    Hello!

    I am having issues trying to set the product, when uploaded or amended via a woocommerce REST API , to accept backorders or notify at those.

    e. g.

    curl –location ‘https://domain.com/wp-json/wc/v3/products’ \

    –header ‘Content-Type: multipart/form-data’ \

    –header ‘Authorization: Basic key’ \

    –form ‘name=”Example product”‘ \

    –form ‘stock_quantity=”2″‘ \

    –form ‘stock_status=”instock”‘ \

    –form ‘backorders=”yes”‘

    The default action is that it does not and it is not to be altered by successive PUT request. According to the output from the API, none distinct from “yes”, “no” ,”notify” is accepted. How should I put this parameter?

    This is the cutout of what I receive from the API:

    “manage_stock”: true,

    “stock_quantity”: 0,

    “backorders”: “no”,

    “backorders_allowed”: false,

    “backordered”: false,

    Any help would be much appreciated.

    • This topic was modified 3 months, 3 weeks ago by miadkol.

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @miadkol

    It looks like you’re using the correct parameter backorders with the values yes, or no. However, please ensure that the product you’re trying to update has the manage_stock, backorders_allowed, and backordered parameter set to true. The backorders parameter will only work if manage_stock, backorders_allowed, and backordered are enabled.

    If you’ve already done this and the issue persists, it could be a problem with the API endpoint or the request method. Please ensure you use the correct endpoint (e.g., ‘/wp-json/wc/v3/products/’) and the HTTP method PUT for updating a product.

    More info: https://woocommerce.github.io/woocommerce-rest-api-docs/?python#update-a-product

    If you are still having problems, it’s best to ask for insight related to those on either the WooCommerce Advanced Facebook group or the WooCommerce Community Slack. Many of our developers hang out there and will be able to offer insights into your question.

    I wish I could help more, but hopefully, this gets you going in the right direction to get some further insight/information.

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @miadkol

    I’m marking this topic as “resolved” due to recent inactivity. If more assistance is needed, feel free to post back here or open a new topic.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.