Migration guide - ProductAvailabilitiesRestApi

Edit on GitHub

Upgrading from version 3.* to version 4.*

In this new version of the ProductAvailabilitiesRestApi module, we have added support of decimal stock. You can find more details about the changes on the ProductAvailabilitiesRestApi module release page.

This release is a part of the Decimal Stock concept migration. When you upgrade this module version, you should also update all other installed modules in your project to use the same concept as well as to avoid inconsistent behavior. For more information, see Decimal Stock Migration Concept.

To upgrade to the new version of the module, do the following:

  1. Upgrade the ProductAvailabilitiesRestApi module to the new version:

spryker/product-availabilities-rest-api:4.0.0 has a critical issue fixed in the subsequent minor release (spryker/product-availabilities-rest-api:4.1.0). Version 4.0.0 should never be used by the projects.

composer require spryker/product-availabilities-rest-api: "^4.1.0" --update-with-dependencies
  1. Update the database entity schema for each store in the system:
APPLICATION_STORE=DE console propel:schema:copy
APPLICATION_STORE=US console propel:schema:copy
...
  1. Run the database migration:
console propel:install
console transfer:generate
  1. Update the apps and integrations that use the product availabilities API. From now on, support of high precision availability quantity is required in string representation (15 becomes ‘15.0000000000’). The API response changed as follows:
GET /concrete-products/sku/concrete-product-availabilities

Was:

{
    "data": [
        {
            "type": "concrete-product-availabilities",
            "id": "sku",
            "attributes": {
                "isNeverOutOfStock": true,
                "availability": true,
                "quantity": 10
            },
            "links": {
                "self": "https://glue.mysprykershop.com/concrete-products/sku/concrete-product-availabilities"
            }
        }
    ],
    "links": {
        "self": "https://glue.mysprykershop.com/concrete-products/sku/concrete-product-availabilities"
    }
}

Becomes:

{
    "data": [
        {
            "type": "concrete-product-availabilities",
            "id": "sku",
            "attributes": {
                "isNeverOutOfStock": true,
                "availability": true,
                "quantity": "10.0000000000"
            },
            "links": {
                "self": "https://glue.mysprykershop.com/concrete-products/sku/concrete-product-availabilities"
            }
        }
    ],
    "links": {
        "self": "https://glue.mysprykershop.com/concrete-products/sku/concrete-product-availabilities"
    }
}
GET /abstract-products/sku/abstract-product-availabilities

Was:

{
    "data": [
        {
            "type": "abstract-product-availabilities",
            "id": "sku",
            "attributes": {
                "availability": true,
                "quantity": 10
            },
            "links": {
                "self": "https://glue.mysprykershop.com/abstract-products/sku/abstract-product-availabilities"
            }
        }
    ],
    "links": {
        "self": "https://glue.mysprykershop.com/abstract-products/sku/abstract-product-availabilities"
    }
}

Becomes:

{
    "data": [
        {
            "type": "abstract-product-availabilities",
            "id": "sku",
            "attributes": {
                "availability": true,
                "quantity": "10.0000000000"
            },
            "links": {
                "self": "https://glue.mysprykershop.com/abstract-products/sku/abstract-product-availabilities"
            }
        }
    ],
    "links": {
        "self": "https://glue.mysprykershop.com/abstract-products/sku/abstract-product-availabilities"
    }
}

Estimated migration time: 5 min

Upgrading from version 1.* to version 3.0.0

In order to dismantle the Horizontal Barrier and enable partial module updates on projects, a Technical Release took place. Public API of source and target major versions are equal. No migration efforts are required. Please contact us if you have any questions.