How to add custom fields meta_data in a woocommerce webhook
i would like to get meta data with key = numero_de_suivis and create a new value called tracking_number
meta_data
0 {...}
2 {...}
3 {...}
4 {
id: 0000
key: numero_de_suivis
value: my_value
}
tracking_number: my_value
add_action('woocommerce_webhook_payload', 'my_woocommerce_webhook_payload');
function my_woocommerce_webhook_payload($payload) {
$payload["tracking_number"] = // add the meta_data with key = "numero_de_suivis" here
return $payload;
}