Title: API REST
Last modified: February 13, 2019

---

# API REST

 *  Resolved [Maximus697](https://wordpress.org/support/users/maximus697/)
 * (@maximus697)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/api-rest-3/)
 * Hi,
 * I try to get the order list with a custom status but with the REST API V3 it 
   finds me nothing and with the V2 I have oders but also orders with status completed..
   And when I try to make a update commands with the REST API on a custom status
   it puts me the status pending .. do you know why?
 * Thx

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

 *  Thread Starter [Maximus697](https://wordpress.org/support/users/maximus697/)
 * (@maximus697)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/api-rest-3/#post-11202480)
 * It works, we had to add the filter
 * add_filter(‘wc_order_statuses’, ‘wc_order_statuses_custom’);
 *  [komal-maru](https://wordpress.org/support/users/komal-maru/)
 * (@komal-maru)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/api-rest-3/#post-11209767)
 * Hi [@maximus697](https://wordpress.org/support/users/maximus697/)
 * Thank you for sharing the solution with us and with other customers.
 * I am glad to know that you have found a solution which works in order to achieve
   your requirements.
 * Please let us know if you have any further queries.
 * Regards,
    Komal Maru
 *  Thread Starter [Maximus697](https://wordpress.org/support/users/maximus697/)
 * (@maximus697)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/api-rest-3/#post-11210039)
 * Hi,
 * The complete solution is:
 * add_filter(‘wc_order_statuses’, ‘wc_order_statuses_custom’);
    function wc_order_statuses_custom(
   $order_statuses) { $order_statuses[‘wc-processing-cec’] = _x( ‘En attente d\’
   expédition’, ‘Order status’, ‘woocommerce’ ); $order_statuses[‘wc-despatched’]
   = _x( ‘Expédié’, ‘Order status’, ‘woocommerce’ ); $order_statuses[‘wc-in_preparation’]
   = _x( ‘Prise en charge par cec’, ‘Order status’, ‘woocommerce’ ); $order_statuses[‘
   wc-failed-cec’] = _x( ‘Erreur logisitque CEC’, ‘Order status’, ‘woocommerce’ );
 *  return $order_statuses;
    }
 * function custom_post_status(){
    register_post_status( ‘wc-processing-cec’, array(‘
   label’ => _x( ‘Processing CEC’, ‘recipes’ ), ‘public’ => false, ‘exclude_from_search’
   => true, ‘show_in_admin_all_list’ => true, ‘show_in_admin_status_list’ => true,‘
   label_count’ => _n_noop( ‘Processing CEC <span class=”count”>(%s)</span>’, ‘Processing
   CEC <span class=”count”>(%s)</span>’ ), ) );
 *  register_post_status( ‘wc-despatched’, array(
    ‘label’ => _x( ‘Despatched CEC’,‘
   recipes’ ), ‘public’ => false, ‘exclude_from_search’ => true, ‘show_in_admin_all_list’
   => true, ‘show_in_admin_status_list’ => true, ‘label_count’ => _n_noop( ‘Despatched
   CEC <span class=”count”>(%s)</span>’, ‘Despatched CEC <span class=”count”>(%s)
   </span>’ ), ) );
 *  register_post_status( ‘wc-in_preparation’, array(
    ‘label’ => _x( ‘In preparation
   CEC’, ‘recipes’ ), ‘public’ => false, ‘exclude_from_search’ => true, ‘show_in_admin_all_list’
   => true, ‘show_in_admin_status_list’ => true, ‘label_count’ => _n_noop( ‘In preparation
   CEC <span class=”count”>(%s)</span>’, ‘In preparation CEC <span class=”count”
   >(%s)</span>’ ), ) );
 *  register_post_status( ‘wc-failed-cec’, array(
    ‘label’ => _x( ‘Failed CEC’, ‘
   recipes’ ), ‘public’ => false, ‘exclude_from_search’ => true, ‘show_in_admin_all_list’
   => true, ‘show_in_admin_status_list’ => true, ‘label_count’ => _n_noop( ‘Failed
   CEC <span class=”count”>(%s)</span>’, ‘Failed CEC <span class=”count”>(%s)</span
   >’ ), ) ); } add_action( ‘init’, ‘custom_post_status’ );
 *  [komal-maru](https://wordpress.org/support/users/komal-maru/)
 * (@komal-maru)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/api-rest-3/#post-11217499)
 * Hi [@maximus697](https://wordpress.org/support/users/maximus697/)
 * Thank you for sharing the whole solution with us and with other customers.
 * Please let me know if you have any further queries.
 * Regards,
    Komal Maru

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

The topic ‘API REST’ is closed to new replies.

 * ![](https://ps.w.org/custom-order-statuses-woocommerce/assets/icon-256x256.jpg?
   rev=2350277)
 * [Custom Order Status for WooCommerce](https://wordpress.org/plugins/custom-order-statuses-woocommerce/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-order-statuses-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-order-statuses-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-order-statuses-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-order-statuses-woocommerce/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [komal-maru](https://wordpress.org/support/users/komal-maru/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/api-rest-3/#post-11217499)
 * Status: resolved