WC_Connect_API_Client::get_label_status PHP Method

get_label_status() public method

Gets the shipping label status (refund status, tracking code, etc)
public get_label_status ( $label_id ) : object | WP_Error
$label_id integer
return object | WP_Error
        public function get_label_status($label_id)
        {
            return $this->request('GET', '/shipping/label/' . $label_id);
        }

Usage Example

 public function get_item($request)
 {
     $response = $this->api_client->get_label_status($request['label_id']);
     if (is_wp_error($response)) {
         $error = new WP_Error($response->get_error_code(), $response->get_error_message(), array('message' => $response->get_error_message()));
         $this->logger->log($error, __CLASS__);
         return $error;
     }
     $this->settings_store->update_label_order_meta_data($request['order_id'], $response->label);
     return array('success' => true, 'label' => $response->label);
 }