After some research, i found this example : PUT /wp-json/wc/v3/products/<product_id>/variations/<id>
So in javascript we could do :
const data = {
regular_price: "10.00"
};
WooCommerce.put("products/22/variations/733", data)
.then((response) => {
console.log(response.data);
})
.catch((error) => {
console.log(error.response.data);
});
And the JSON API Response :
{
"id": 733,
"date_created": "2017-03-23T00:53:11",
"date_created_gmt": "2017-03-23T03:53:11",
"date_modified": "2017-03-23T00:53:11",
"date_modified_gmt": "2017-03-23T03:53:11",
"description": "",
"permalink": "https://example.com/product/ship-your-idea/?attribute_pa_color=green",
"sku": "",
"price": "10.00",
"regular_price": "10.00",
"sale_price": "",
...
}
I’ll do some test, but i think it’s possible to update a product variation price with WooCommerce API/REST.
Related Posts:
- WooCommerce: Can’t use wc_get_products for custom REST API endpoints
- Process checkout using WC REST API
- How to build a plugin that supports authenticated POST requests to the REST API from external servers?
- Extend Woocommerce rest api routes fails
- How to filter Post using Meta Data REST API
- How to stop a Gutenberg Block from firing multiple GET Requests?
- Output JSON object with woocommerce products
- Problem with cURL and rest API
- Category Tree In WooCommerce Product API
- How to upload Woocommerce product images via API? [closed]
- How to handle Woocommerce API credentials
- What will make Woocommerce REST API to issue 401 [closed]
- Woocommerce custom endpoints
- Woocommerce REST API – updating an order changes custom tax calculations
- Woocommerce Rest Api Categories problem [closed]
- API returns blank response after installing & uninstalling WP-rest-api plugin
- woocommerce axios react
- Get specific values in Woocommerce Rest API
- wc_get_products() not return the images details
- WooCommerce – Add product with image via REST API
- Tax are not showing on order while placing order with REST API
- JWT on Woocommerce cannot work with “Customer” role user
- Woocommerce REST API – add filter to set maximum query per page for product brands [closed]
- WooCommerce – Create multiple product tags via rest api endpoint
- Using the WordPress and WooCommerce REST APIs in the same Node app
- Retrieve Data from Custom Endpoint
- How to solve `Error getting remote image` in woocommerce rest api script?
- Getting in an exception for get product detail by id in woocommerce REST api
- Impossible to create a new WooCommerce customer using Rest API
- Woocommerce API security concerns
- How can I send information when a order is completed to my own POS?
- Woocommerce Rest API: woocommerce_product_invalid_image_id
- WC Booking query bookings with date ranges
- “error_message”: “Sorry, you cannot list resources.” using WooCommerce API
- Woocommerce REST API: creating variations
- Woocommerce REST API not considering discounts and coupons
- WooCommerce REST API endpoints don’t exist
- Fetch products with filter by similar categories at same time
- Send data to external websites when there is an update or create a post
- Auto generating API keys using the Application Authentication Endpoint [closed]
- GET woocommerce order request is not showing meta data [closed]
- Is it possible to add custom fields to a WooCommerce attribute term? [closed]
- Add custom variable to cart content [closed]
- Woocommerce My Account Endpoint – how to get ID parameter from URL?
- Default woocommerce placeholder image
- How to add Woocomrce cart page shipping calculator to my country state list
- Button to update order status Woocommerce with WC Marketplace
- WooCommerce: display text instead of raw checkbox value email
- WooCommerce single products images doesn’t zoom on hover and doesn’t change clicking on gallery
- Disabling the free shipping method when the cart has product/s which assigned a certain shipping class [closed]
- Woocommerce: Same gross price for different tax rates [closed]
- add shoppy.gg to woocommerce instead of add to card [closed]
- List of shipping on product page [closed]
- How to edit T&C checker text in Woocommerce checkout page? gettext?
- What is the reason for two classes storefront_woocommerce and storefront
- Get email type inside email template – order emails
- Caption not showing with Woo commerce thumbnails
- Confirm Password on checkout page not working in woocommerce 3.0.1
- Woocommerce’s add_to_cart function returns false and doesn’t add anything to the cart [closed]
- How to check woocommerce single product tag
- Send email notifications to a defined email address depending if a product in order has a specific TAG [closed]
- Adding author option to [products] woocommerce shortcode
- Set dynamic Options array in woocommerce_form_field
- WooCommerce product title formatting
- Colour of selected radio button seems backwards in Twenty Seventeen + Woocommerce
- How to modify WooCommerce button text in default and additional languages
- Customizing WooCommerce
- Get Post ID from attachment ID (Redirect to product page)
- WooCommerce set a min order price for a single country [closed]
- “Reset my password” links to itself (page refreshes) [closed]
- Woocommerce product tab is not showing probably
- How to list best seller products in woocommerce
- Updating failed. The response is not a valid JSON response. Gutenberg + Woocommerce Products
- Add product image to Woocommerce downloads page
- Sharing data between filters on a snippet (user specific) for Woocommerce
- How to add custom checkboxes from loop to WooCommerce product variation options?
- Restrict product tags archive to certain users
- Logo showing on some page but not on product categories pages
- Woocommerce doesn’t work with theme, header missing and css messed up
- Woocommerce Product Variation – Add Price Logic
- Display related product categories by subcategory
- Order again Woocommerce inside View Order
- Can’t update WooCommerce payment method title
- Set Post Thumbnail to external URL
- Custom theme woocommerce product detail page template not working
- WooCommerce related products load random posts per page
- how to show product custom taxonomies in woocommerce rest api
- WooCommerce: Adding a setup fee to certain products
- How to adjust Related Page Thumb Sizes on single page?
- Adding more than one item to Woocommerce cart
- Woocommerce – get product in category with specific attribute
- How to add a menu page for options in wordpress for user that has the role of vendor?
- Testimonials/Reviews for Products
- add custom menu in woocommerce dashboard [closed]
- Override function
- How to disable schema from Wocommerce? [closed]
- Updating order meta to have a meta entry from an item in the order
- Add second price option based on payment method at cart item price
- Create WordPress account on different domain when WooCommerce order completed
- Creating a woocommerce order when a user creates an account