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]
- How to add fee_lines using woocommerce rest API v3?
- Update a server-side render Block when woocommerce cart block changed
- Pass custom Checkout field value to Stripe gateway in WooCommerce
- WooCommerce Shop Page Not Found 404
- How can I show an empty WooCommerce cart? [closed]
- Woocommerce Pre Orders – Can i override templates?
- Programmatically adding product attributes to WP / Woo commerce
- Display File Types For Woocommerce Downloadable Products On Product Page
- Image is not displayed in overridden woocommerce email
- remove categories from product
- WooCommerce Display Digital Download Files Type and Size
- woo commerce get all orders item given category
- Add Stripe Connect data to wc_stripe_payment_request
- WooCommerce get default shipping rate & conditions
- Using WooCommerce for payments only?
- WooCommerce – Stock in Decimals, Using Quantity Intervals with Unique Prices [closed]
- WooCommerce Cart Link based on Cookie Values
- Adding Product Name on Admin Panel Order list and User’s My-Account Order List
- How to put Stripe first, PayPal second on the checkout page?
- woocommerce – how to get product link by id
- woocommerce_register_post action not firing [closed]
- Search in 1) Post, 2) Products (woocommerce) and 3) Custom post type or Taxonomy type on a single page
- display product’s category static slider name and image in loop wordpress
- Send admin new order email to logged in user as well
- How to reverse/swap the order of “Sales price” and “Regular prcie” in woocommerce?
- Woocommerce Canceled Order Notification email to admin
- Woocommerce before and after shop loop not works
- WooCommerce Admin order – Only run action if user is loaded
- Creating child theme out of Coeur
- Change Out of Stock Error Message in WooCommerce Cart
- I want a simple dropdown for locations in woocommerce
- Getting hundreds of spam orders in WooCommerce with failed stripe payment [closed]
- How to fetch woocommerce highest price and lowest price in custom template page?
- Please help me get rid of conflict with the JavaScript – I’m using WooCommerce with product blocks (Gutenb)
- Order Status without Email check. Only with Order-Number
- WooCommerce pagination: remove ‘page’ from url
- Coupon for product / woocommerce
- wc_get_product_id_by_sku() returns 0 for products added programatically via update_post_meta
- Display “Add to basket” and “Read more” buttons in the products shop page with woocommerce
- How Can I fix Woocommerce Billing Address Field? [closed]
- How to set up dynamic purchase pixel in Woocommerce?
- MySQL error or data corruption after database migration
- Select all products that have a custom field ‘is_new’ set to ‘Yes’
- Woocommerce – Shop can’t find products after domain name change
- Removing Product from Woocommerce checkout page using Ajax
- add_post_meta on subcription renewal
- login or register then access woocommerce website
- Move woocommerce shop page image to left
- WooCommerce Tax Filter Not Working
- Replace product link with just product name on WooCommerce downloads page
- Woocommerce Product category base same as product base causes 404
- Categories and products in cart Woocommerce
- Custom CSS Not working on Product page
- How to add ajax loading icon after click add to cart button on woocommerce
- Can’t display product categories on woocommerce getting Invalid taxonomy?
- Send form data to functions.php
- Create custom add to cart in WordPress
- WooCommerce – How to add a custom field to only a specific email template [closed]
- I want to update shipping charge $0 for all Woocommeerce Subscription auto-renewal orders