Wholesale Suite API
  • REST API
  • wholesale/v1 (Free)
    • Products
      • List All Wholesale Products
      • Retrieve a Wholesale Product
      • Create a Wholesale Product
      • Update a Wholesale Product
      • Delete a Wholesale Product
      • Batch Update Products
    • Variations
      • List All Wholesale Variations
      • Retrieve a Wholesale Variation
      • Create a Wholesale Variation
      • Update a Wholesale Variation
      • Delete a Wholesale Variation
      • Batch Update Variations
    • Wholesale Role
      • List Wholesale Roles
      • Retrieve a Wholesale Role
      • Update a Wholesale Role
  • wholesale/v1 (Premium)
    • Products
      • List All Wholesale Products
      • Retrieve a Wholesale Product
      • Create a Wholesale Product
      • Update a Wholesale Product
      • Delete a Wholesale Product
      • Batch Update Products
    • Variations
      • List All Wholesale Variations
      • Retrieve a Wholesale Variation
      • Create a Wholesale Variation
      • Update a Wholesale Variation
      • Delete a Wholesale Variation
      • Batch Update Variations
    • Wholesale Role
      • List Wholesale Roles
      • Retrieve a Wholesale Role
      • Create a Wholesale Role
      • Update a Wholesale Role
      • Delete a Wholesale Role
    • Category Discounts
      • List Category Discounts
      • Retrieve Category Discount
      • Create Category Discount
      • Update Category Discount
      • Delete Category Discount
    • General Discounts
      • List General Discounts
      • Retrieve Specific Role Discount
      • Create a General Discount
      • Update a general Discount
      • Delete a General Discount
    • Bundle
      • Create Bundle Product
      • Batch Update
    • Composite
      • Create Composite Product
      • Batch Update
Powered by GitBook
On this page

Was this helpful?

  1. wholesale/v1 (Free)
  2. Products

Batch Update Products

This API handles batch create, update and delete a wholesale or non-wholesale product.

Method

Endpoint

POST

/wp-json/wholesale/v1/products/batch

Postman

Batch update products.

POST: /wp-json/wholesale/v1/products/batch

JSON Body:
{
    "create": [
        {
            "name": "Premium Quality",
            "type": "simple",
            "regular_price": "21.99",
            "wholesale_price": {
                "wholesale_customer": "15"
            }
        }
    ],
    "update": [
        {
            "id": {product_id},
            "name": "Product Title Updated",
            "wholesale_price": {
                "wholesale_customer": "35"
            }
        }
    ],
    "delete": [
        {product_ids}
    ]
}

Status: 200 OK

Batch update products.

POST: /wp-json/wholesale/v1/products/batch

JSON Body:
{
    "create": [
        {
            "name": "Premium Quality",
            "type": "simple",
            "regular_price": "21.99",
            "wholesale_price": {
                "wholesale_customer": "15"
            }
        }
    ],
    "update": [
        {
            "id": {product_id},
            "name": "Product Title Updated",
            "wholesale_price": {
                "wholesale_customer": "35"
            }
        }
    ],
    "delete": [
        {product_id}
    ]
}

Response:
{
    "create": [
        {
            "id": 7073,
            "name": "Premium Quality",
            "slug": "premium-quality",
            "permalink": "https://example.com/product/premium-quality/",
            "date_created": "2021-10-20T12:55:14",
            "date_created_gmt": "2021-10-20T12:55:14",
            "date_modified": "2021-10-20T12:55:14",
            "date_modified_gmt": "2021-10-20T12:55:14",
            "type": "simple",
            "status": "publish",
            "featured": false,
            "catalog_visibility": "visible",
            "description": "",
            "short_description": "",
            "sku": "",
            "price": "21.99",
            "regular_price": "21.99",
            "sale_price": "",
            "date_on_sale_from": null,
            "date_on_sale_from_gmt": null,
            "date_on_sale_to": null,
            "date_on_sale_to_gmt": null,
            "on_sale": false,
            "purchasable": true,
            "total_sales": 0,
            "virtual": false,
            "downloadable": false,
            "downloads": [],
            "download_limit": -1,
            "download_expiry": -1,
            "external_url": "",
            "button_text": "",
            "tax_status": "taxable",
            "tax_class": "",
            "manage_stock": false,
            "stock_quantity": null,
            "backorders": "no",
            "backorders_allowed": false,
            "backordered": false,
            "low_stock_amount": null,
            "sold_individually": false,
            "weight": "",
            "dimensions": {
                "length": "",
                "width": "",
                "height": ""
            },
            "shipping_required": true,
            "shipping_taxable": true,
            "shipping_class": "",
            "shipping_class_id": 0,
            "reviews_allowed": true,
            "average_rating": "0",
            "rating_count": 0,
            "upsell_ids": [],
            "cross_sell_ids": [],
            "parent_id": 0,
            "purchase_note": "",
            "tags": [],
            "images": [],
            "attributes": [],
            "default_attributes": [],
            "variations": [],
            "grouped_products": [],
            "menu_order": 0,
            "price_html": "<span class=\"woocommerce-Price-amount amount\"><bdi><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>21.99</bdi></span> <small class=\"woocommerce-price-suffix\">inc. VAT</small>",
            "related_ids": [
                6351,
                6365,
                6362,
                7043,
                6363
            ],
            "stock_status": "instock",
            "wholesale_data": {
                "wholesale_price": {
                    "wholesale_customer": "15"
                }
            }
        }
    ],
    "update": [
        {
            "id": 7072,
            "name": "Product Title Updated",
            "slug": "premium-quality",
            "permalink": "https://example.com/product/premium-quality/",
            "date_created": "2021-10-20T12:41:58",
            "date_created_gmt": "2021-10-20T12:41:58",
            "date_modified": "2021-10-20T12:55:14",
            "date_modified_gmt": "2021-10-20T12:55:14",
            "type": "simple",
            "status": "publish",
            "featured": false,
            "catalog_visibility": "visible",
            "description": "",
            "short_description": "",
            "sku": "",
            "price": "21.99",
            "regular_price": "21.99",
            "sale_price": "",
            "date_on_sale_from": null,
            "date_on_sale_from_gmt": null,
            "date_on_sale_to": null,
            "date_on_sale_to_gmt": null,
            "on_sale": false,
            "purchasable": true,
            "total_sales": 0,
            "virtual": false,
            "downloadable": false,
            "downloads": [],
            "download_limit": -1,
            "download_expiry": -1,
            "external_url": "",
            "button_text": "",
            "tax_status": "taxable",
            "tax_class": "",
            "manage_stock": false,
            "stock_quantity": null,
            "backorders": "no",
            "backorders_allowed": false,
            "backordered": false,
            "low_stock_amount": null,
            "sold_individually": false,
            "weight": "",
            "dimensions": {
                "length": "",
                "width": "",
                "height": ""
            },
            "shipping_required": true,
            "shipping_taxable": true,
            "shipping_class": "",
            "shipping_class_id": 0,
            "reviews_allowed": true,
            "average_rating": "0",
            "rating_count": 0,
            "upsell_ids": [],
            "cross_sell_ids": [],
            "parent_id": 0,
            "purchase_note": "",
            "tags": [],
            "images": [],
            "attributes": [],
            "default_attributes": [],
            "variations": [],
            "grouped_products": [],
            "menu_order": 0,
            "price_html": "<span class=\"woocommerce-Price-amount amount\"><bdi><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>21.99</bdi></span> <small class=\"woocommerce-price-suffix\">inc. VAT</small>",
            "related_ids": [
                7070,
                6514,
                7012,
                6353,
                6372
            ],
            "stock_status": "instock",
            "wholesale_data": {
                "wholesale_price": {
                    "wholesale_customer": "35"
                }
            }
        }
    ],
    "delete": [
        {
            "id": 7071,
            "name": "Premium Quality Test",
            "slug": "premium-quality-test-2",
            "permalink": "https://example.com/product/premium-quality-test-2/",
            "date_created": "2021-10-20T12:37:53",
            "date_created_gmt": "2021-10-20T12:37:53",
            "date_modified": "2021-10-20T12:37:53",
            "date_modified_gmt": "2021-10-20T12:37:53",
            "type": "simple",
            "status": "publish",
            "featured": false,
            "catalog_visibility": "visible",
            "description": "",
            "short_description": "",
            "sku": "",
            "price": "21.99",
            "regular_price": "21.99",
            "sale_price": "",
            "date_on_sale_from": null,
            "date_on_sale_from_gmt": null,
            "date_on_sale_to": null,
            "date_on_sale_to_gmt": null,
            "on_sale": false,
            "purchasable": true,
            "total_sales": 0,
            "virtual": false,
            "downloadable": false,
            "downloads": [],
            "download_limit": -1,
            "download_expiry": -1,
            "external_url": "",
            "button_text": "",
            "tax_status": "taxable",
            "tax_class": "",
            "manage_stock": false,
            "stock_quantity": null,
            "backorders": "no",
            "backorders_allowed": false,
            "backordered": false,
            "low_stock_amount": null,
            "sold_individually": false,
            "weight": "",
            "dimensions": {
                "length": "",
                "width": "",
                "height": ""
            },
            "shipping_required": true,
            "shipping_taxable": true,
            "shipping_class": "",
            "shipping_class_id": 0,
            "reviews_allowed": true,
            "average_rating": "0",
            "rating_count": 0,
            "upsell_ids": [],
            "cross_sell_ids": [],
            "parent_id": 0,
            "purchase_note": "",
            "tags": [],
            "images": [],
            "attributes": [],
            "default_attributes": [],
            "variations": [],
            "grouped_products": [],
            "menu_order": 0,
            "price_html": "<span class=\"woocommerce-Price-amount amount\"><bdi><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>21.99</bdi></span> <small class=\"woocommerce-price-suffix\">inc. VAT</small>",
            "related_ids": [
                6365,
                7024,
                7070,
                6502,
                6351
            ],
            "stock_status": "instock",
            "wholesale_data": {
                "wholesale_price": {
                    "wholesale_customer": "123"
                }
            }
        }
    ]
}
PreviousDelete a Wholesale ProductNextVariations

Last updated 3 years ago

Was this helpful?