woocommerce How to set the default variation for the product using the api - woocommerce-rest-api

I'm unable to set the default attribute using the API please help
I tried to send this body to the updated product and add it when adding the product
{"default_attributes":[{"id":1
,"option":"blue"}]}]
but it didn't change

Related

How to add `custom_keys` for a particular zoom meeting?

So I am using below API to fetch details of a meeting
https://marketplace.zoom.us/docs/api-reference/zoom-api/methods/#tag/Dashboards/operation/dashboardMeetingDetail
In the response of above API I can see a field custom_keys, which is some sort of identifier fo a particular meeting.
Any idea how to set these custom_keys when creating a meeting?

Changing "purchasable" in WooCommerce using REST API

I am trying to update the "purchasable" flag on a product variation using REST API
/wp-json/wc/v3/products/<prodID>/variations/<varID>
I have tried sending a simple
{"purchasable":false}
as well as getting the current data for the variation, changing the "purchasable" entry to the new state, and submitting the entire data back to WooCommerce. In no case have I been able to change this value using REST API.
I am using jw-auth for authentication and have a proper token (I do receive a proper response back with all the data for the variation, but still with the old value of "purchasable" in it, so I know I'm communicating with the back-end).
Is there some setting elsewhere that needs to be set for me to be able to change this specific property? The variations have been created using REST API as well, and on the shop it works fine (I can pick the variations as expected).
What am I doing wrong? Or have I found a bug in WooCommerce? :-)
That field is listed as ReadOnly in the api docs. I believe Woo uses other criteria to set that value. In my research, it appears that setting the Stock Status to "outofstock" seems to be a common method for keeping an item from being purchased. Also, setting the price to null or empty.
https://woocommerce.github.io/woocommerce-rest-api-docs/#product-properties

Could not retrieve label of a custom field with Azure DevOps API

I'm integrating our product with Azure DevOps but currently I could not retrieve the label of custom field. I cannot use the name property because the name does not reflect the change from Azure DevOps.
I'm using "https://dev.azure.com/{organize}/{projectId}/_apis/wit/fields/Custom.NewHungField" API for getting information about the custom field, but it does not return label of the field.
Thank you.
Yes, you can not find label when you use Fields - Get directly. But you can see the label of the custom fileds using Work Item Types - Get.
For more information, you can check below demo:
Using API:
GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitemtypes/{type}?api-version=5.1
Get the response:
You can find the label of custom fields in it.

Custom POST/PUT route/endpoint based on meta value

I'm currently making a store which is receiving it's data from external sources. Being new to the world of editing/creating REST API, I've come across a problem. The problem is that the external source have no idea what ID the product gets in woocommerce so update/delete products is not possible with the current endpoints/routes. However, the external source does have it's own ID on it's product and I've stored this in a custom meta field in woo and I can see it and update it through api on Postman.
How can i create a new endpoint/route that uses the custom meta field called externalProductId and use this to update the product instead of the woocommerce ID?
What you can do, which I particularly did in my case ... Create a field id_product_woo in your external bank, the time you create the product in Woocommerce, it returns a JSON with the information of the product created, including the ID inside Woocommerce... When you create or update a product in Woocommerce, you then pass the id stored in the id_product_woo field of your external bank.
Apparently, this for me, worked perfectly.

Woocommerce Custom Email path in Plugin

I create a custom order status and the . also cerated a custom email that are fired manually when the status is changed to my new custom status.
It works 100% if my custom email template reside in plugins/woocommerce/
\plugins/woocommerce/templates/emails/logistics-eft-paid.php
But i need to add the custom email to my childtheme.
themes/ms-store/woocommerce/emails/logistics-eft-paid.php
I used this plugin, and I realise that woocommerce_get_template is outdated and replaced by wc_get_template, but is simply can't get it to work.
Even if I can hardcode the path to the email template, it will be a start.
Plugin used:
https://github.com/skyverge/woocommerce-expedited-order-email
Any help will be appreciated,
Thank you.