Search code examples
magentomagento2

Magento Global Special Price - Create or Update - HTTP Request


Problem: I would like to update the global special price of a product in Magento using a HTTP POST or PUT request.

Product Special Price

Whilst I've seen the endpoint /V1/products/special-price in the docs, this is per store and not global.

Which endpoint should I send to, with what data?

Use Cases:

  1. I'll be creating a whole new product, with a special price included at the start
  2. I'll be updating an existing product with a new special price
  3. I'll be deleting the special price from a product

Solution

  • This code worked for scheduling an update. To make it global, I set the store_id to 0.

      {
          "prices": [
            {
              "price": 45.00,
              "store_id": 0,
              "sku": "virtualProductTest",
              "price_from": "2023-01-13 08:43:00",
              "price_to": "2024-10-16 22:30:45",
              "extension_attributes": {}
            }
          ]
        }