@@ -1629,115 +1629,6 @@ woocommerce.get("products").parsed_response
1629
1629
<code>tag</code>, <code>shipping_class</code> and <code>pa_*</code> filters are available starting from WooCommerce 2.5.
1630
1630
</aside >
1631
1631
1632
- ## Duplicate product ##
1633
-
1634
- This API helps you to duplicate a product.
1635
-
1636
- ### HTTP request ###
1637
-
1638
- <div class =" api-endpoint " >
1639
- <div class="endpoint-data">
1640
- <i class="label label-post">POST</i>
1641
- <h6>/wp-json/wc/v3/products/<product_id>/duplicate</h6>
1642
- </div>
1643
- </div >
1644
-
1645
- ``` shell
1646
- curl https://example.com/wp-json/wc/v3/products/< product_id> /duplicate \
1647
- -u consumer_key:consumer_secret
1648
- ```
1649
-
1650
- ``` javascript
1651
- WooCommerce .post (" products/2/duplicate" )
1652
- .then ((response ) => {
1653
- console .log (response .data );
1654
- })
1655
- .catch ((error ) => {
1656
- console .log (error .response .data );
1657
- });
1658
- ```
1659
-
1660
- ``` php
1661
- <?php print_r($woocommerce->post('products/2/duplicate')); ?>
1662
- ```
1663
-
1664
- ``` python
1665
- print (wcapi.post(" products/2/duplicate" ).json())
1666
- ```
1667
-
1668
- ``` ruby
1669
- woocommerce.post(" products/2/duplicate" ).parsed_response
1670
- ```
1671
-
1672
- > JSON response example:
1673
-
1674
- ``` json
1675
- {
1676
- "id" : 824 ,
1677
- "name" : " Premium Quality (Copy)" ,
1678
- "slug" : " " ,
1679
- "date_created" : {
1680
- "date" : " 2024-05-30 19:16:39.000000" ,
1681
- "timezone_type" : 1 ,
1682
- "timezone" : " +00:00"
1683
- },
1684
- "date_modified" : {
1685
- "date" : " 2024-03-08 15:03:19.000000" ,
1686
- "timezone_type" : 1 ,
1687
- "timezone" : " +00:00"
1688
- },
1689
- "status" : " draft" ,
1690
- "featured" : false ,
1691
- "catalog_visibility" : " visible" ,
1692
- "description" : " " ,
1693
- "short_description" : " " ,
1694
- "sku" : " product-22-1" ,
1695
- "price" : " " ,
1696
- "regular_price" : " " ,
1697
- "sale_price" : " " ,
1698
- "date_on_sale_from" : null ,
1699
- "date_on_sale_to" : null ,
1700
- "total_sales" : 0 ,
1701
- "tax_status" : " taxable" ,
1702
- "tax_class" : " " ,
1703
- "manage_stock" : false ,
1704
- "stock_quantity" : null ,
1705
- "stock_status" : " instock" ,
1706
- "backorders" : " no" ,
1707
- "low_stock_amount" : " " ,
1708
- "sold_individually" : false ,
1709
- "weight" : " " ,
1710
- "length" : " " ,
1711
- "width" : " " ,
1712
- "height" : " " ,
1713
- "upsell_ids" : [],
1714
- "cross_sell_ids" : [],
1715
- "parent_id" : 0 ,
1716
- "reviews_allowed" : true ,
1717
- "purchase_note" : " " ,
1718
- "attributes" : [],
1719
- "default_attributes" : [],
1720
- "menu_order" : 0 ,
1721
- "post_password" : " " ,
1722
- "virtual" : false ,
1723
- "downloadable" : false ,
1724
- "category_ids" : [
1725
- 15
1726
- ],
1727
- "tag_ids" : [],
1728
- "shipping_class_id" : 0 ,
1729
- "downloads" : [],
1730
- "image_id" : " " ,
1731
- "gallery_image_ids" : [],
1732
- "download_limit" : -1 ,
1733
- "download_expiry" : -1 ,
1734
- "rating_counts" : [],
1735
- "average_rating" : " 0" ,
1736
- "review_count" : 0 ,
1737
- "meta_data" : []
1738
- }
1739
- ```
1740
-
1741
1632
## Update a Product ##
1742
1633
1743
1634
This API lets you make changes to a product.
0 commit comments