public function get($productVariantId, array $fields = array())
    {
        $params = array();
        if (!empty($fields)) {
            $params['fields'] = $fields;
        }
        $endpoint = '/admin/variants/'.$productVariantId.'.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createObject(ProductVariant::class, $response['variant']);
    }
public function get($productVariantId, array $fields = array())
    {
        $params = array();
        if (!empty($fields)) {
            $params['fields'] = $fields;
        }
        $endpoint = '/admin/variants/'.$productVariantId.'.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createObject(ProductVariant::class, $response['variant']);
    }
public function get ( $ productVariantId , array $ fields = array ( ) ) { $ params = array ( ) ; if ( ! empty ( $ fields ) ) { $ params [ 'fields' ] = $ fields ; } $ endpoint = '/admin/variants/' . $ productVariantId . '.json' ; $ response = $ this -> request ( $ endpoint , 'GET' , $ params ) ; return $ this -> createObject ( ProductVariant :: class , $ response [ 'variant' ] ) ; }
Receive a single product variant

@link   https://help.shopify.com/api/reference/product_variant#show
@param  integer $productVariantId
@param  array   $fields
@return ProductVariant
Receive a single product variant