Title: Get custom fields data from Make.com
Last modified: March 20, 2023

---

# Get custom fields data from Make.com

 *  Resolved [kuzmanovicn](https://wordpress.org/support/users/kuzmanovicn/)
 * (@kuzmanovicn)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/get-custom-fields-data-from-make-com/)
 * Hello everyone, my goal is to extract data from new orders in Woocommerce and
   share them on Slack using Make.com on Integromat. Although I have managed to 
   retrieve all the fields and their corresponding values, one particular custom
   field is not visible on Make.com. I suspect that Make.com is obtaining values
   through an API.
 * Would it be possible to obtain data from a custom field?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [ThemeHigh](https://wordpress.org/support/users/themehigh/)
 * (@themehigh)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/get-custom-fields-data-from-make-com/#post-16579168)
 * Please add the below code snippet in your child theme’s functions.php file in
   order to get the custom field values through API
 * `add_filter('woocommerce_rest_prepare_shop_order_object', 'filter_order_response',
   10, 3); function filter_order_response($response, $post, $request){ // Customize
   response data here $order_id = $post->get_id(); $value = ( $value = get_post_meta(
   $order_id, 'field_name', true) ) ? $value : '';    $response->data['billing']['
   field_name'] = $value; return $response; }`
 * Please note that when an order is placed the field values are saved as billing_’
   field name’ and shipping_’field name’ in order meta. So please provide the field
   name accordingly.
 * Thank you!
 *  Plugin Author [ThemeHigh](https://wordpress.org/support/users/themehigh/)
 * (@themehigh)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/get-custom-fields-data-from-make-com/#post-16583970)
 * As a follow-up, please add the below code snippet in your child theme’s functions.
   php file in order to get the custom field values through API
 *     ```wp-block-code
       add_filter('woocommerce_rest_prepare_shop_order_object', 'filter_order_response', 10, 3);
       function filter_order_response($response, $post, $request){
           // Customize response data here
           $order_id = $post->get_id();
   
           $value = ( $value = get_post_meta($order_id, 'field_name', true) ) ? $value : '';
           $response->data['billing']['field_name'] = $value;
           return $response;
       }
       ```
   
 * Please note that when an order is placed the field values are saved as billing_’
   field name’ and shipping_’field name’ in order meta. So please provide the field
   name accordingly.
 * Thank you!
 *  [andresfluna](https://wordpress.org/support/users/andresfluna/)
 * (@andresfluna)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/get-custom-fields-data-from-make-com/#post-16930502)
 * Hi.
 * I’m having trouble with this piece of code. After following the steps and replacing
   the field name, I just get an empty field information in Make.com. The custom
   name field is “numerodoc”, and thus this is the code I’m using:
 *     ```wp-block-code
       add_filter('woocommerce_rest_prepare_shop_order_object', 'filter_order_response', 10, 3);
       function filter_order_response($response, $post, $request){
           $order_id = $post->get_id();
           $value = ( $value = get_post_meta($order_id, 'numerodoc', true) ) ? $value : '';
           $response->data['billing']['numerodoc'] = $value;
           return $response;
       }
       ```
   
 * Ideally, we would need to fetch in Make.com the data of 3 different custom fields:
   billing_tipodoc, billing_numerodoc and billing_email_facturas. I tried with this
   code, and again I’m getting empty data in Make.com (I’m not an expert, and this
   was made with the help of ChatGPT):
 *     ```wp-block-code
       add_filter('woocommerce_rest_prepare_shop_order_object', 'filter_order_response', 10, 3);
   
       function filter_order_response($response, $post, $request) {
           // Customize response data here
           $order_id = $post->get_id();
   
           // Get the value of 'email_facturas'
           $value1 = ( $value1 = get_post_meta($order_id, 'email_facturas', true) ) ? $value1 : '';
           $response->data['billing']['email_facturas'] = $value1;
   
           // Get the value of 'tipodoc'
           $value2 = ( $value2 = get_post_meta($order_id, 'tipodoc', true) ) ? $value2 : '';
           $response->data['billing']['tipodoc'] = $value2;
   
           // Get the value of 'numerodoc'
           $value3 = ( $value3 = get_post_meta($order_id, 'numerodoc', true) ) ? $value3 : '';
           $response->data['billing']['numerodoc'] = $value3;
   
           return $response;
       }
       ```
   
 * I really appreciate your help!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Get custom fields data from Make.com’ is closed to new replies.

 * ![](https://ps.w.org/woo-checkout-field-editor-pro/assets/icon-256x256.gif?rev
   =3479964)
 * [Checkout Field Editor (Checkout Manager) for WooCommerce](https://wordpress.org/plugins/woo-checkout-field-editor-pro/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-checkout-field-editor-pro/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-checkout-field-editor-pro/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-checkout-field-editor-pro/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-checkout-field-editor-pro/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-checkout-field-editor-pro/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [andresfluna](https://wordpress.org/support/users/andresfluna/)
 * Last activity: [2 years, 10 months ago](https://wordpress.org/support/topic/get-custom-fields-data-from-make-com/#post-16930502)
 * Status: resolved