update pricing using the rest api
-
Hello,
We have a custom backend system separate from our WordPress/WooCommerce backend, which handles orders. We are looking to implement a feature that allows us to update product information from our custom backend directly into the WooCommerce system.
Typically, product updates can be performed by calling the WooCommerce API endpoint for the specific product and providing the necessary data. For example, updating the product name and price can be done as follows:
$this->client->post(
'products/1191116',
[
'name' => 'update123',
'price' => '100.25',
]
);
However, we also need to update the tiered pricing rules for our products, which isn't as straightforward. The desired format for tiered pricing is as follows:
$this->client->post(
'products/1191116',
[
'name' => 'update123',
'price' => '100.25',
'tiered_pricing_fixed_rules' => [
'2' => '10',
'3' => '9',
'5' => '8',
'10' => '7',
'25' => '6'
]
]
);Could you please guide us on how to properly structure the data for
tiered_pricing_fixed_rules
when making a request to the WooCommerce API?Thx!
The page I need help with: [log in to see the link]
- You must be logged in to reply to this topic.